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_H_
6 #define Model_AttributeReference_H_
7
8 #include "Model.h"
9 #include "ModelAPI_AttributeReference.h"
10 #include <ModelAPI_Feature.h>
11 #include <TDF_Label.hxx>
12 #include <TDF_Reference.hxx>
13
14 /**\class Model_AttributeReference
15  * \ingroup DataModel
16  * \brief Attribute that contains reference to feature (located in the same document).
17  */
18
19 class Model_AttributeReference : public ModelAPI_AttributeReference
20 {
21   Handle_TDF_Reference myRef;  ///< references to the feature label
22  public:
23   /// Defines the object referenced from this attribute
24   MODEL_EXPORT virtual void setValue(ObjectPtr theObject);
25
26   /// Returns object referenced from this attribute
27   MODEL_EXPORT virtual ObjectPtr value();
28
29   MODEL_EXPORT ~Model_AttributeReference();
30
31   MODEL_EXPORT virtual void setObject(const boost::shared_ptr<ModelAPI_Object>& theObject);
32
33 protected:
34   /// Objects are created for features automatically
35   MODEL_EXPORT Model_AttributeReference(TDF_Label& theLabel);
36
37   friend class Model_Data;
38 };
39
40 #endif