SHAPER  9.12.0
ModelAPI_AttributeRefList Class Referenceabstract

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

Inheritance diagram for ModelAPI_AttributeRefList:
Inheritance graph

Public Member Functions

virtual std::string attributeType ()
 Returns the type of this class of attributes, not static method. More...
 
virtual void append (ObjectPtr theObject)=0
 Appends the feature to the end of a list. More...
 
virtual void remove (ObjectPtr theObject)=0
 Erases the first meet of the feature in the list. More...
 
virtual void clear ()=0
 Removes all references from the list. More...
 
virtual int size (const bool theWithEmpty=true) const =0
 Returns number of features in the list. More...
 
virtual std::list< ObjectPtr > list ()=0
 Returns the list of features. More...
 
virtual bool isInList (const ObjectPtr &theObj)=0
 Returns true if the object is in list. More...
 
virtual ObjectPtr object (const int theIndex, const bool theWithEmpty=true)=0
 Returns the referenced object by the zero-based index. More...
 
virtual void substitute (const ObjectPtr &theCurrent, const ObjectPtr &theNew)=0
 Substitutes the object by another one. Does nothing if such object is not found. More...
 
virtual void removeLast ()=0
 Removes the last element in the list. More...
 
virtual void remove (const std::set< int > &theIndices)=0
 Removes the elements from the list. 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...
 

Static Public Member Functions

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

Protected Member Functions

 ModelAPI_AttributeRefList ()
 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...
 

Detailed Description

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

Constructor & Destructor Documentation

◆ ModelAPI_AttributeRefList()

ModelAPI_AttributeRefList::ModelAPI_AttributeRefList ( )
protected

Objects are created for features automatically.

Member Function Documentation

◆ typeId()

static std::string ModelAPI_AttributeRefList::typeId ( )
inlinestatic

Returns the type of this class of attributes.

◆ attributeType()

std::string ModelAPI_AttributeRefList::attributeType ( )
virtual

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

Implements ModelAPI_Attribute.

◆ append()

virtual void ModelAPI_AttributeRefList::append ( ObjectPtr  theObject)
pure virtual

Appends the feature to the end of a list.

Implemented in Model_AttributeRefList.

◆ remove() [1/2]

virtual void ModelAPI_AttributeRefList::remove ( ObjectPtr  theObject)
pure virtual

Erases the first meet of the feature in the list.

Implemented in Model_AttributeRefList.

◆ clear()

virtual void ModelAPI_AttributeRefList::clear ( )
pure virtual

Removes all references from the list.

Implemented in Model_AttributeRefList.

◆ size()

virtual int ModelAPI_AttributeRefList::size ( const bool  theWithEmpty = true) const
pure virtual

Returns number of features in the list.

Parameters
theWithEmptyif it is false, returns the number of not-empty referenced objects

Implemented in Model_AttributeRefList.

◆ list()

virtual std::list<ObjectPtr> ModelAPI_AttributeRefList::list ( )
pure virtual

Returns the list of features.

Implemented in Model_AttributeRefList.

◆ isInList()

virtual bool ModelAPI_AttributeRefList::isInList ( const ObjectPtr &  theObj)
pure virtual

Returns true if the object is in list.

Implemented in Model_AttributeRefList.

◆ object()

virtual ObjectPtr ModelAPI_AttributeRefList::object ( const int  theIndex,
const bool  theWithEmpty = true 
)
pure virtual

Returns the referenced object by the zero-based index.

Parameters
theIndexzero-based index in the list
theWithEmptyif it is false, counts the not-empty referenced objects only

Implemented in Model_AttributeRefList.

◆ substitute()

virtual void ModelAPI_AttributeRefList::substitute ( const ObjectPtr &  theCurrent,
const ObjectPtr &  theNew 
)
pure virtual

Substitutes the object by another one. Does nothing if such object is not found.

Implemented in Model_AttributeRefList.

◆ removeLast()

virtual void ModelAPI_AttributeRefList::removeLast ( )
pure virtual

Removes the last element in the list.

Implemented in Model_AttributeRefList.

◆ remove() [2/2]

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

Removes the elements from the list.

Parameters
theIndicesa list of indices of elements to be removed

Implemented in Model_AttributeRefList.

◆ 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.

◆ isInitialized()

bool ModelAPI_Attribute::isInitialized ( )
virtualinherited

◆ 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.

◆ reinit()

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)