]> SALOME platform Git repositories - modules/shaper.git/blob - src/Model/Model_AttributeSelectionList.h
Salome HOME
602e5b2382f53f4153e00209f8b371048a133b21
[modules/shaper.git] / src / Model / Model_AttributeSelectionList.h
1 // File:        Model_AttributeSelectionList.h
2 // Created:     22 Oct 2014
3 // Author:      Mikhail PONIKAROV
4
5 #ifndef Model_AttributeSelectionList_H_
6 #define Model_AttributeSelectionList_H_
7
8 #include "Model.h"
9 #include "Model_AttributeSelection.h"
10 #include <ModelAPI_AttributeSelectionList.h>
11 #include <TDataStd_Integer.hxx>
12 #include <TDataStd_Real.hxx>
13 #include <vector>
14
15 /**\class Model_AttributeSelectionList
16  * \ingroup DataModel
17  * \brief Attribute that contains list of references to the sub-shapes with
18  * possibility to manage them.
19  */
20
21 class Model_AttributeSelectionList : public ModelAPI_AttributeSelectionList
22 {
23   Handle(TDataStd_Integer) mySize;  ///< Contains size of this list
24   Handle(TDataStd_Real) mySelectionType;  ///< Contains current index, TODO: make it integer, not real
25 public:
26   /// Adds the new reference to the end of the list
27   MODEL_EXPORT virtual void append(
28     const ResultPtr& theContext, const std::shared_ptr<GeomAPI_Shape>& theSubShape);
29
30   /// Returns the number ofselection attributes in the list
31   MODEL_EXPORT virtual int size();
32
33   MODEL_EXPORT virtual int selectionType();
34
35   MODEL_EXPORT virtual void setSelectionType(int);
36
37   /// Returns the attribute selection by the index (zero based)
38   MODEL_EXPORT virtual std::shared_ptr<ModelAPI_AttributeSelection> value(const int theIndex);
39
40   /// Returns all attributes
41   MODEL_EXPORT virtual void clear();
42
43 protected:
44   /// Objects are created for features automatically
45   MODEL_EXPORT Model_AttributeSelectionList(TDF_Label& theLabel);
46
47   friend class Model_Data;
48 };
49
50 #endif