]> SALOME platform Git repositories - modules/shaper.git/blob - src/Model/Model_AttributeSelection.h
Salome HOME
The list of selection attributes is added
[modules/shaper.git] / src / Model / Model_AttributeSelection.h
1 // File:        Model_AttributeSelection.h
2 // Created:     8 May 2014
3 // Author:      Mikhail PONIKAROV
4
5 #ifndef Model_AttributeSelection_H_
6 #define Model_AttributeSelection_H_
7
8 #include "Model.h"
9 #include "Model_AttributeReference.h"
10 #include <ModelAPI_AttributeSelection.h>
11
12 /**\class Model_AttributeSelection
13  * \ingroup DataModel
14  * \brief Attribute that contains reference to the sub-shape of some result, the selected shape.
15  */
16
17 class Model_AttributeSelection : public ModelAPI_AttributeSelection
18 {
19   Model_AttributeReference myRef;  ///< The reference functionality reusage
20 public:
21   /// Defines the result and its selected sub-shape
22   MODEL_EXPORT virtual void setValue(
23     const ResultPtr& theContext, const boost::shared_ptr<GeomAPI_Shape>& theSubShape);
24
25   /// Returns the selected subshape
26   MODEL_EXPORT virtual boost::shared_ptr<GeomAPI_Shape> value();
27
28   /// Returns the context of the selection (the whole shape owner)
29   MODEL_EXPORT virtual ResultPtr context();
30
31   /// Sets the feature object
32   MODEL_EXPORT virtual void setObject(const boost::shared_ptr<ModelAPI_Object>& theObject);
33
34 protected:
35   /// Objects are created for features automatically
36   MODEL_EXPORT Model_AttributeSelection(TDF_Label& theLabel);
37     /// Performs the selection for the body result (TNaming Selection)
38
39   /// Performs the selection for the body result (TNaming selection)
40   virtual void selectBody(
41     const ResultPtr& theContext, const boost::shared_ptr<GeomAPI_Shape>& theSubShape);
42   /// Performs the selection for the construction result (selection by index)
43   virtual void selectConstruction(
44     const ResultPtr& theContext, const boost::shared_ptr<GeomAPI_Shape>& theSubShape);
45
46   friend class Model_Data;
47   friend class Model_AttributeSelectionList;
48 };
49
50 #endif