Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / Model / Model_AttributeReference.h
1 // File:        Model_AttributeReference.h
2 // Created:     8 May 2014
3 // Author:      Mikhail PONIKAROV
4
5 #ifndef Model_AttributeReference_HeaderFile
6 #define Model_AttributeReference_HeaderFile
7
8 #include "Model.h"
9 #include "ModelAPI_AttributeReference.h"
10 #include <TDF_Label.hxx>
11 #include <TDF_Reference.hxx>
12
13 /**\class Model_AttributeReference
14  * \ingroup DataModel
15  * \brief Attribute that contains reference to feature (located in the same document).
16  */
17
18 class Model_AttributeReference : public ModelAPI_AttributeReference
19 {
20   Handle_TDF_Reference myRef; ///< references to the feature label
21 public:
22   /// Defines the feature referenced from this attribute
23   MODEL_EXPORT virtual void setValue(boost::shared_ptr<ModelAPI_Feature> theFeature);
24
25   /// Returns feature referenced from this attribute
26   MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_Feature> value();
27
28 protected:
29   /// Objects are created for features automatically
30   MODEL_EXPORT Model_AttributeReference(TDF_Label& theLabel);
31
32   friend class Model_Data;
33 };
34
35 #endif