Salome HOME
Merge remote-tracking branch 'origin/BR_WIRE_RESULTS'
[modules/shaper.git] / src / ModelAPI / ModelAPI_AttributeSelection.h
1 // File:        ModelAPI_AttributeSelection.h
2 // Created:     2 Oct 2014
3 // Author:      Mikhail PONIKAROV
4
5 #ifndef ModelAPI_AttributeSelection_H_
6 #define ModelAPI_AttributeSelection_H_
7
8 #include "ModelAPI_Attribute.h"
9 #include <ModelAPI_ResultBody.h>
10
11 /**\class ModelAPI_AttributeSelection
12  * \ingroup DataModel
13  * \brief Attribute that contains reference to the sub-shape of some result, the selected shape.
14  */
15
16 class ModelAPI_AttributeSelection : public ModelAPI_Attribute
17 {
18  public:
19   /// Defines the result and its selected sub-shape
20   virtual void setValue(
21     const ResultBodyPtr& theContext, const boost::shared_ptr<GeomAPI_Shape>& theSubShape) = 0;
22
23   /// Returns the selected subshape
24   virtual boost::shared_ptr<GeomAPI_Shape> value() = 0;
25
26   /// Returns the context of the selection (the whole shape owner)
27   virtual ResultBodyPtr context() = 0;
28
29   /// Returns the type of this class of attributes
30   static std::string type()
31   {
32     return "Selection";
33   }
34
35   /// Returns the type of this class of attributes, not static method
36   virtual std::string attributeType()
37   {
38     return type();
39   }
40
41   /// To virtually destroy the fields of successors
42   virtual ~ModelAPI_AttributeSelection()
43   {
44   }
45
46  protected:
47   /// Objects are created for features automatically
48   MODELAPI_EXPORT ModelAPI_AttributeSelection()
49   {
50   }
51 };
52
53 #endif