SHAPER  9.13.0
Model_AttributeRefAttrList Class Reference

Attribute that contains list of references to features (located in the same document) or references to attributes of the features (list of AttributeRefAttr) More...

Inheritance diagram for Model_AttributeRefAttrList:
Inheritance graph

Public Member Functions

virtual void append (ObjectPtr theObject)
 Appends the feature to the end of a list. More...
 
virtual void append (AttributePtr theAttr)
 Appends the attribute to the end of a list. More...
 
virtual void remove (ObjectPtr theObject)
 Erases the first meet of the feature in the list. More...
 
virtual void remove (AttributePtr theAttr)
 Erases the first meet of the attribute in the list. More...
 
virtual void clear ()
 Removes all references from the list. More...
 
virtual int size () const
 Returns number of features in the list. More...
 
virtual std::list< std::pair< ObjectPtr, AttributePtr > > list ()
 Returns the list of features and attributes (if it is reference to the attribute) More...
 
virtual bool isInList (const ObjectPtr &theObj)
 Returns true if the object is in list. More...
 
virtual bool isInList (const AttributePtr &theObj)
 Returns true if the attribute is in list. More...
 
virtual bool isAttribute (const int theIndex) const
 Returns true if this is reference to an attribute, not just object. More...
 
virtual ObjectPtr object (const int theIndex) const
 Returns the referenced object by the zero-based index. More...
 
virtual AttributePtr attribute (const int theIndex) const
 Returns the referenced attribute by the zero-based index. More...
 
virtual void removeLast ()
 Removes the last element in the list. More...
 
virtual void remove (const std::set< int > &theIndices)
 Removes the elements from the list. More...
 
virtual bool isInitialized ()
 Returns true if attribute was initialized by some value. More...
 
virtual std::string attributeType ()
 Returns the type of this class of attributes, not static method. 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...
 
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...
 

Static Public Member Functions

static std::string typeId ()
 Returns the type of this class of attributes. More...
 

Protected Member Functions

 Model_AttributeRefAttrList (TDF_Label &theLabel)
 Objects are created for features automatically. More...
 
virtual void reinit ()
 Reinitializes the internal state of the attribute (may be needed on undo/redo, abort, etc) More...
 
virtual void setID (const std::string theID)
 Sets the ID of the attribute in Data (called from Data) 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
 

Detailed Description

Attribute that contains list of references to features (located in the same document) or references to attributes of the features (list of AttributeRefAttr)

Constructor & Destructor Documentation

◆ Model_AttributeRefAttrList()

Model_AttributeRefAttrList::Model_AttributeRefAttrList ( TDF_Label &  theLabel)
protected

Objects are created for features automatically.

Member Function Documentation

◆ append() [1/2]

void Model_AttributeRefAttrList::append ( ObjectPtr  theObject)
virtual

Appends the feature to the end of a list.

Implements ModelAPI_AttributeRefAttrList.

◆ append() [2/2]

void Model_AttributeRefAttrList::append ( AttributePtr  theAttr)
virtual

Appends the attribute to the end of a list.

Implements ModelAPI_AttributeRefAttrList.

◆ remove() [1/3]

void Model_AttributeRefAttrList::remove ( ObjectPtr  theObject)
virtual

Erases the first meet of the feature in the list.

Implements ModelAPI_AttributeRefAttrList.

◆ remove() [2/3]

void Model_AttributeRefAttrList::remove ( AttributePtr  theAttr)
virtual

Erases the first meet of the attribute in the list.

Implements ModelAPI_AttributeRefAttrList.

◆ clear()

void Model_AttributeRefAttrList::clear ( )
virtual

Removes all references from the list.

Implements ModelAPI_AttributeRefAttrList.

◆ size()

int Model_AttributeRefAttrList::size ( ) const
virtual

Returns number of features in the list.

Implements ModelAPI_AttributeRefAttrList.

◆ list()

std::list< std::pair< ObjectPtr, AttributePtr > > Model_AttributeRefAttrList::list ( )
virtual

Returns the list of features and attributes (if it is reference to the attribute)

Implements ModelAPI_AttributeRefAttrList.

◆ isInList() [1/2]

bool Model_AttributeRefAttrList::isInList ( const ObjectPtr &  theObj)
virtual

Returns true if the object is in list.

Implements ModelAPI_AttributeRefAttrList.

◆ isInList() [2/2]

bool Model_AttributeRefAttrList::isInList ( const AttributePtr &  theObj)
virtual

Returns true if the attribute is in list.

Implements ModelAPI_AttributeRefAttrList.

◆ isAttribute()

bool Model_AttributeRefAttrList::isAttribute ( const int  theIndex) const
virtual

Returns true if this is reference to an attribute, not just object.

Implements ModelAPI_AttributeRefAttrList.

◆ object()

ObjectPtr Model_AttributeRefAttrList::object ( const int  theIndex) const
virtual

Returns the referenced object by the zero-based index.

Parameters
theIndexzero-based index in the list

Implements ModelAPI_AttributeRefAttrList.

◆ attribute()

AttributePtr Model_AttributeRefAttrList::attribute ( const int  theIndex) const
virtual

Returns the referenced attribute by the zero-based index.

Parameters
theIndexzero-based index in the list

Implements ModelAPI_AttributeRefAttrList.

◆ removeLast()

void Model_AttributeRefAttrList::removeLast ( )
virtual

Removes the last element in the list.

Implements ModelAPI_AttributeRefAttrList.

◆ remove() [3/3]

void Model_AttributeRefAttrList::remove ( const std::set< int > &  theIndices)
virtual

Removes the elements from the list.

Parameters
theIndicesa list of indices of elements to be removed

Implements ModelAPI_AttributeRefAttrList.

◆ isInitialized()

bool Model_AttributeRefAttrList::isInitialized ( )
virtual

Returns true if attribute was initialized by some value.

Reimplemented from ModelAPI_Attribute.

◆ reinit()

void Model_AttributeRefAttrList::reinit ( )
protectedvirtual

Reinitializes the internal state of the attribute (may be needed on undo/redo, abort, etc)

Reimplemented from ModelAPI_Attribute.

◆ typeId()

static std::string ModelAPI_AttributeRefAttrList::typeId ( )
inlinestaticinherited

Returns the type of this class of attributes.

◆ attributeType()

std::string ModelAPI_AttributeRefAttrList::attributeType ( )
virtualinherited

Returns the type of this class of attributes, not static method.

Implements ModelAPI_Attribute.

◆ setObject()

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

Sets the owner of this attribute.

Reimplemented in Model_AttributeSelection, and Model_AttributeReference.

◆ owner()

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

Returns the owner of this attribute.

◆ setInitialized()

void ModelAPI_Attribute::setInitialized ( )
inherited

Makes attribute initialized.

◆ blockSetInitialized()

bool ModelAPI_Attribute::blockSetInitialized ( const bool  theBlock)
inherited

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)
inherited

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 ( )
inherited

Returns true if attribute causes the result change.

◆ setImmutable()

bool ModelAPI_Attribute::setImmutable ( const bool  theFlag)
inherited

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 ( )
inherited

Returns true if can not be changed programmatically.

◆ id()

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

ID of the attribute in Data.

◆ reset()

void ModelAPI_Attribute::reset ( )
virtualinherited

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)
protectedvirtualinherited

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

Reimplemented in Model_AttributeSelection.

Field Documentation

◆ myIsInitialized

bool ModelAPI_Attribute::myIsInitialized
protectedinherited

is some value assigned to this attribute

◆ mySetInitializedBlocked

bool ModelAPI_Attribute::mySetInitializedBlocked
protectedinherited

is initialized blocked

◆ myIsArgument

bool ModelAPI_Attribute::myIsArgument
protectedinherited

is this attribute used as an argument for execution

◆ myIsImmutable

bool ModelAPI_Attribute::myIsImmutable
protectedinherited

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