Salome HOME
The list of selection attributes is added
[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 boost::shared_ptr<GeomAPI_Shape>& theSubShape) = 0;
23
24   /// Returns the number ofselection attributes in the list
25   virtual int size() = 0;
26
27   /// Returns the attribute selection by the index (zero based)
28   virtual boost::shared_ptr<ModelAPI_AttributeSelection> value(const int theIndex) = 0;
29
30   /// Returns all attributes
31   virtual void clear() = 0;
32
33   /// Returns the type of this class of attributes
34   static std::string type()
35   {
36     return "SelectionList";
37   }
38
39   /// Returns the type of this class of attributes, not static method
40   virtual std::string attributeType()
41   {
42     return type();
43   }
44
45   /// To virtually destroy the fields of successors
46   virtual ~ModelAPI_AttributeSelectionList()
47   {
48   }
49
50  protected:
51   /// Objects are created for features automatically
52   MODELAPI_EXPORT ModelAPI_AttributeSelectionList()
53   {
54   }
55 };
56
57 #endif