SHAPER  9.12.0
ModelAPI_Attribute Class Referenceabstract

Generic attribute of the Object. More...

Inheritance diagram for ModelAPI_Attribute:
Inheritance graph

Public Member Functions

virtual std::string attributeType ()=0
 Returns the type of this class of attributes, not static method. More...
 
virtual ~ModelAPI_Attribute ()
 To virtually destroy the fields of successors. More...
 
virtual void setObject (const std::shared_ptr< ModelAPI_Object > &theObject)
 Sets the owner of this attribute. More...
 
const std::shared_ptr< ModelAPI_Object > & owner () const
 Returns the owner of this attribute. More...
 
virtual bool isInitialized ()
 Returns true if attribute was initialized by some value. More...
 
void setInitialized ()
 Makes attribute initialized. More...
 
bool blockSetInitialized (const bool theBlock)
 Blocks sending "attribute updated" if theBlock is true. More...
 
void setIsArgument (const bool theFlag)
 Set this attribute is argument for result (change of this attribute requires update of result). More...
 
bool isArgument ()
 Returns true if attribute causes the result change. More...
 
bool setImmutable (const bool theFlag)
 Immutable argument can not be changed programmatically (e.g. More...
 
bool isImmutable ()
 Returns true if can not be changed programmatically. More...
 
const std::string & id () const
 ID of the attribute in Data. More...
 
virtual void reset ()
 Resets attribute to deafult state. More...
 

Protected Member Functions

 ModelAPI_Attribute ()
 Objects are created for features automatically. More...
 
virtual void setID (const std::string theID)
 Sets the ID of the attribute in Data (called from Data) More...
 
virtual void reinit ()
 Reinitializes the internal state of the attribute (may be needed on undo/redo, abort, etc) More...
 

Protected Attributes

bool myIsInitialized
 is some value assigned to this attribute More...
 
bool mySetInitializedBlocked
 is initialized blocked More...
 
bool myIsArgument
 is this attribute used as an argument for execution More...
 
bool myIsImmutable
 is this attribute can be changed programmatically (e.g. by constraint) More...
 

Friends

class Model_Data
 
class Model_Objects
 

Detailed Description

Generic attribute of the Object.

Constructor & Destructor Documentation

◆ ~ModelAPI_Attribute()

ModelAPI_Attribute::~ModelAPI_Attribute ( )
virtual

To virtually destroy the fields of successors.

◆ ModelAPI_Attribute()

ModelAPI_Attribute::ModelAPI_Attribute ( )
protected

Objects are created for features automatically.

Member Function Documentation

◆ attributeType()

◆ setObject()

void ModelAPI_Attribute::setObject ( const std::shared_ptr< ModelAPI_Object > &  theObject)
virtual

Sets the owner of this attribute.

Reimplemented in Model_AttributeSelection, and Model_AttributeReference.

◆ owner()

const std::shared_ptr< ModelAPI_Object > & ModelAPI_Attribute::owner ( ) const

Returns the owner of this attribute.

◆ isInitialized()

bool ModelAPI_Attribute::isInitialized ( )
virtual

◆ setInitialized()

void ModelAPI_Attribute::setInitialized ( )

Makes attribute initialized.

◆ blockSetInitialized()

bool ModelAPI_Attribute::blockSetInitialized ( const bool  theBlock)

Blocks sending "attribute updated" if theBlock is true.

Parameters
theBlocka block value
Returns
the previous block value

◆ setIsArgument()

void ModelAPI_Attribute::setIsArgument ( const bool  theFlag)

Set this attribute is argument for result (change of this attribute requires update of result).

By default it is true.

◆ isArgument()

bool ModelAPI_Attribute::isArgument ( )

Returns true if attribute causes the result change.

◆ setImmutable()

bool ModelAPI_Attribute::setImmutable ( const bool  theFlag)

Immutable argument can not be changed programmatically (e.g.

by constraint) By default it is false. Returns the previous state of the attribute's immutability.

◆ isImmutable()

bool ModelAPI_Attribute::isImmutable ( )

Returns true if can not be changed programmatically.

◆ id()

const std::string & ModelAPI_Attribute::id ( ) const

ID of the attribute in Data.

◆ reset()

void ModelAPI_Attribute::reset ( )
virtual

Resets attribute to deafult state.

Reimplemented in Model_AttributeSelection, Model_AttributeDouble, GeomData_Point2D, and GeomData_Dir.

◆ setID()

void ModelAPI_Attribute::setID ( const std::string  theID)
protectedvirtual

Sets the ID of the attribute in Data (called from Data)

Reimplemented in Model_AttributeSelection.

◆ reinit()

Field Documentation

◆ myIsInitialized

bool ModelAPI_Attribute::myIsInitialized
protected

is some value assigned to this attribute

◆ mySetInitializedBlocked

bool ModelAPI_Attribute::mySetInitializedBlocked
protected

is initialized blocked

◆ myIsArgument

bool ModelAPI_Attribute::myIsArgument
protected

is this attribute used as an argument for execution

◆ myIsImmutable

bool ModelAPI_Attribute::myIsImmutable
protected

is this attribute can be changed programmatically (e.g. by constraint)