20 #ifndef Model_AttributeRefAttrList_H_
21 #define Model_AttributeRefAttrList_H_
24 #include "ModelAPI_AttributeRefAttrList.h"
25 #include "ModelAPI_Feature.h"
27 #include <TDF_Label.hxx>
28 #include <TDataStd_ReferenceList.hxx>
29 #include <TDataStd_ExtStringList.hxx>
40 Handle_TDataStd_ReferenceList myRef;
41 Handle_TDataStd_ExtStringList myIDs;
44 MODEL_EXPORT
virtual void append(ObjectPtr theObject);
46 MODEL_EXPORT
virtual void append(AttributePtr theAttr);
49 MODEL_EXPORT
virtual void remove(ObjectPtr theObject);
51 MODEL_EXPORT
virtual void remove(AttributePtr theAttr);
54 MODEL_EXPORT
virtual void clear();
57 MODEL_EXPORT
virtual int size()
const;
60 MODEL_EXPORT
virtual std::list<std::pair<ObjectPtr, AttributePtr> >
list();
63 MODEL_EXPORT
virtual bool isInList(
const ObjectPtr& theObj);
65 MODEL_EXPORT
virtual bool isInList(
const AttributePtr& theObj);
68 MODEL_EXPORT
virtual bool isAttribute(
const int theIndex)
const;
72 MODEL_EXPORT
virtual ObjectPtr
object(
const int theIndex)
const;
75 MODEL_EXPORT
virtual AttributePtr
attribute(
const int theIndex)
const;
82 MODEL_EXPORT
virtual void remove(
const std::set<int>& theIndices);
Attribute that contains list of references to features (located in the same document) or references t...
Definition: ModelAPI_AttributeRefAttrList.h:34
Attribute that contains list of references to features (located in the same document) or references t...
Definition: Model_AttributeRefAttrList.h:38
virtual std::list< std::pair< ObjectPtr, AttributePtr > > list()
Returns the list of features and attributes (if it is reference to the attribute)
Definition: Model_AttributeRefAttrList.cpp:150
virtual bool isInitialized()
Returns true if attribute was initialized by some value.
Definition: Model_AttributeRefAttrList.cpp:142
virtual int size() const
Returns number of features in the list.
Definition: Model_AttributeRefAttrList.cpp:137
virtual bool isInList(const ObjectPtr &theObj)
Returns true if the object is in list.
Definition: Model_AttributeRefAttrList.cpp:174
virtual void reinit()
Reinitializes the internal state of the attribute (may be needed on undo/redo, abort,...
Definition: Model_AttributeRefAttrList.cpp:334
virtual void append(ObjectPtr theObject)
Appends the feature to the end of a list.
Definition: Model_AttributeRefAttrList.cpp:28
virtual bool isAttribute(const int theIndex) const
Returns true if this is reference to an attribute, not just object.
Definition: Model_AttributeRefAttrList.cpp:227
Model_AttributeRefAttrList(TDF_Label &theLabel)
Objects are created for features automatically.
Definition: Model_AttributeRefAttrList.cpp:328
virtual void remove(ObjectPtr theObject)
Erases the first meet of the feature in the list.
Definition: Model_AttributeRefAttrList.cpp:58
virtual ObjectPtr object(const int theIndex) const
Returns the referenced object by the zero-based index.
Definition: Model_AttributeRefAttrList.cpp:241
virtual void removeLast()
Removes the last element in the list.
Definition: Model_AttributeRefAttrList.cpp:285
virtual void clear()
Removes all references from the list.
Definition: Model_AttributeRefAttrList.cpp:125
virtual AttributePtr attribute(const int theIndex) const
Returns the referenced attribute by the zero-based index.
Definition: Model_AttributeRefAttrList.cpp:261
General object of the application that allows to get/set attributes from the document and compute res...
Definition: Model_Data.h:62