Salome HOME
Merge branch 'master' of newgeom:newgeom.git into BR_PYTHON_PLUGIN
[modules/shaper.git] / src / ModelAPI / ModelAPI_AttributeSelectionList.h
1 // File:        ModelAPI_AttributeSelectionList.h
2 // Created:     22 Oct 2014
3 // Author:      Mikhail PONIKAROV
4
5 #ifndef ModelAPI_AttributeSelectionList_H_
6 #define ModelAPI_AttributeSelectionList_H_
7
8 #include "ModelAPI_AttributeSelection.h"
9 #include <ModelAPI_Result.h>
10
11 /**\class ModelAPI_AttributeSelectionList
12  * \ingroup DataModel
13  * \brief Attribute that contains list of references to the sub-shapes with
14  * possibility to manage them.
15  */
16
17 class ModelAPI_AttributeSelectionList : public ModelAPI_Attribute
18 {
19  public:
20   /// Adds the new reference to the end of the list
21   virtual void append(
22     const ResultPtr& theContext, const std::shared_ptr<GeomAPI_Shape>& theSubShape) = 0;
23
24   /// Returns the number ofselection attributes in the list
25   virtual int size() = 0;
26
27   virtual int selectionType() = 0;
28
29   virtual void setSelectionType(int) = 0;
30
31   /// Returns the attribute selection by the index (zero based)
32   virtual std::shared_ptr<ModelAPI_AttributeSelection> value(const int theIndex) = 0;
33
34   /// Returns all attributes
35   virtual void clear() = 0;
36
37   /// Returns the type of this class of attributes
38   static std::string type()
39   {
40     return "SelectionList";
41   }
42
43   /// Returns the type of this class of attributes, not static method
44   virtual std::string attributeType()
45   {
46     return type();
47   }
48
49   /// To virtually destroy the fields of successors
50   virtual ~ModelAPI_AttributeSelectionList()
51   {
52   }
53
54  protected:
55   /// Objects are created for features automatically
56   MODELAPI_EXPORT ModelAPI_AttributeSelectionList()
57   {
58   }
59 };
60
61 //! Pointer on double attribute
62 typedef std::shared_ptr<ModelAPI_AttributeSelectionList> AttributeSelectionListPtr;
63
64 #endif