20 #ifndef Model_AttributeSelectionList_H_
21 #define Model_AttributeSelectionList_H_
24 #include "Model_AttributeSelection.h"
25 #include <ModelAPI_AttributeSelectionList.h>
26 #include <TDataStd_Integer.hxx>
27 #include <TDataStd_Comment.hxx>
40 Handle(TDataStd_Integer) mySize;
42 Handle(TDataStd_Comment) mySelectionType;
43 std::shared_ptr<Model_AttributeSelection> myTmpAttr;
45 std::map<ObjectPtr, std::list<std::shared_ptr<GeomAPI_Shape> > > myCash;
53 MODEL_EXPORT
virtual void append(
54 const ObjectPtr& theContext,
const std::shared_ptr<GeomAPI_Shape>& theSubShape,
55 const bool theTemporarily =
false);
59 MODEL_EXPORT
virtual void append(
const std::wstring& theNamingName,
60 const std::string& theType=
"");
63 MODEL_EXPORT
virtual void append(
const std::shared_ptr<GeomAPI_Pnt>& thePoint,
64 const std::string& theType);
67 MODEL_EXPORT
virtual void append(
const std::string& theType,
68 const std::wstring& theContextName,
72 MODEL_EXPORT
virtual void copyTo(AttributeSelectionListPtr theTarget)
const;
82 MODEL_EXPORT
virtual void remove(
const std::set<int>& theIndices);
85 MODEL_EXPORT
virtual int size();
93 const ObjectPtr& theContext,
const std::shared_ptr<GeomAPI_Shape>& theSubShape,
94 const bool theTemporarily =
false);
105 MODEL_EXPORT
virtual std::shared_ptr<ModelAPI_AttributeSelection>
value(
const int theIndex);
108 MODEL_EXPORT
virtual void clear();
116 MODEL_EXPORT
virtual void cashValues(
const bool theEnabled);
118 MODEL_EXPORT
virtual void setGeometricalSelection(
const bool theIsGeometricalSelection)
override;
124 MODEL_EXPORT
virtual FiltersFeaturePtr
filters()
const;
127 MODEL_EXPORT
virtual void setFilters(FiltersFeaturePtr theFeature);
Attribute that contains list of references to the sub-shapes with possibility to manage them.
Definition: ModelAPI_AttributeSelectionList.h:37
Attribute that contains list of references to the sub-shapes with possibility to manage them.
Definition: Model_AttributeSelectionList.h:38
virtual void clear()
Returns all attributes.
Definition: Model_AttributeSelectionList.cpp:389
bool merge(Model_AttributeSelection *theStart)
Tries to merge attributes in this list with the same result shape.
virtual int size()
Returns the number of selection attributes in the list.
Definition: Model_AttributeSelectionList.cpp:282
virtual FiltersFeaturePtr filters() const
Returns a selection filters feature if it is defined for this selection list.
Definition: Model_AttributeSelectionList.cpp:509
virtual bool isInList(const ObjectPtr &theContext, const std::shared_ptr< GeomAPI_Shape > &theSubShape, const bool theTemporarily=false)
Returns true if the object with the shape are in list.
Definition: Model_AttributeSelectionList.cpp:302
virtual void setSelectionType(const std::string &theType)
Sets the type of all elements selection.
Definition: Model_AttributeSelectionList.cpp:364
virtual void removeLast()
Removes the last element in the list.
Definition: Model_AttributeSelectionList.cpp:150
virtual void copyTo(AttributeSelectionListPtr theTarget) const
Copy the selection list to the destination attribute.
Definition: Model_AttributeSelectionList.cpp:272
virtual void reinit()
Reinitializes the internal state of the attribute (may be needed on undo/redo, abort,...
Definition: Model_AttributeSelectionList.cpp:425
virtual void setFilters(FiltersFeaturePtr theFeature)
Sets a selection filters feature if it is defined for this selection list.
Definition: Model_AttributeSelectionList.cpp:532
virtual void remove(const std::set< int > &theIndices)
Removes the elements from the list.
Definition: Model_AttributeSelectionList.cpp:241
virtual void removeTemporaryValues()
Reset temporary stored values.
Definition: Model_AttributeSelectionList.cpp:143
virtual void append(const ObjectPtr &theContext, const std::shared_ptr< GeomAPI_Shape > &theSubShape, const bool theTemporarily=false)
Adds the new reference to the end of the list.
Definition: Model_AttributeSelectionList.cpp:55
virtual std::shared_ptr< ModelAPI_AttributeSelection > value(const int theIndex)
Returns the attribute selection by the index (zero based)
Definition: Model_AttributeSelectionList.cpp:370
virtual void cashValues(const bool theEnabled)
Starts or stops cashing of the values in the attribute (the cash may become invalid on modification o...
Definition: Model_AttributeSelectionList.cpp:438
virtual bool isGeometricalSelection() const override
Returns true if is geometrical selection.
Definition: Model_AttributeSelectionList.cpp:453
Model_AttributeSelectionList(TDF_Label &theLabel)
Objects are created for features automatically.
Definition: Model_AttributeSelectionList.cpp:419
virtual bool isInitialized()
Returns true if attribute was initialized by some value.
Definition: Model_AttributeSelectionList.cpp:411
virtual const std::string selectionType() const
The type of all elements selection.
Definition: Model_AttributeSelectionList.cpp:359
Attribute that contains reference to the sub-shape of some result, the selected shape.
Definition: Model_AttributeSelection.h:40
General object of the application that allows to get/set attributes from the document and compute res...
Definition: Model_Data.h:61