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