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