1 // File: Model_AttributeRefAttr.h
3 // Author: Mikhail PONIKAROV
5 #ifndef Model_AttributeRefAttr_H_
6 #define Model_AttributeRefAttr_H_
9 #include "ModelAPI_AttributeRefAttr.h"
10 #include <TDF_Label.hxx>
11 #include <TDF_Reference.hxx>
12 #include <TDataStd_Comment.hxx>
14 /**\class Model_AttributeRefAttr
16 * \brief Attribute that contains reference to an attribute of a feature
17 * (located in the same document).
20 class Model_AttributeRefAttr : public ModelAPI_AttributeRefAttr
22 Handle_TDF_Reference myRef; ///< reference to the feature label
23 ///< ID of the referenced attirbute (empty if this is a reference to a feature)
24 Handle_TDataStd_Comment myID;
26 /// Returns true if this attribute references to a object (not to the attribute)
27 MODEL_EXPORT virtual bool isObject();
29 /// Defines the reference to the attribute
30 MODEL_EXPORT virtual void setAttr(boost::shared_ptr<ModelAPI_Attribute> theAttr);
32 /// Returns attribute referenced from this attribute
33 MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_Attribute> attr();
35 /// Defines the reference to the object
36 MODEL_EXPORT virtual void setObject(ObjectPtr theFeature);
38 /// Returns object referenced from this attribute
39 MODEL_EXPORT virtual ObjectPtr object();
42 /// Objects are created for features automatically
43 MODEL_EXPORT Model_AttributeRefAttr(TDF_Label& theLabel);
45 friend class Model_Data;