Salome HOME
Separate definition from declaration for each ModelAPI class
[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(const ResultPtr& theContext,
24                       const GeomShapePtr& theSubShape) = 0;
25
26   /// Adds the new reference to the end of the list by the naming name of the selected shape
27   /// The type of shape is taken from the current selection type
28   virtual void append(std::string theNamingName) = 0;
29
30   /// Returns the number ofselection attributes in the list
31   virtual int size() = 0;
32
33   virtual int selectionType() = 0;
34
35   virtual void setSelectionType(int) = 0;
36
37   /// Returns the attribute selection by the index (zero based)
38   virtual std::shared_ptr<ModelAPI_AttributeSelection> value(const int theIndex) = 0;
39
40   /// Returns all attributes
41   virtual void clear() = 0;
42
43   /// Returns the type of this class of attributes
44   static std::string type()
45   {
46     return "SelectionList";
47   }
48
49   /// Returns the type of this class of attributes, not static method
50   virtual std::string attributeType();
51
52   /// To virtually destroy the fields of successors
53   virtual ~ModelAPI_AttributeSelectionList();
54
55  protected:
56   /// Objects are created for features automatically
57   MODELAPI_EXPORT ModelAPI_AttributeSelectionList();
58 };
59
60 //! Pointer on double attribute
61 typedef std::shared_ptr<ModelAPI_AttributeSelectionList> AttributeSelectionListPtr;
62
63 #endif