1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: Model_AttributeRefAttr.h
5 // Author: Mikhail PONIKAROV
7 #ifndef Model_AttributeRefAttr_H_
8 #define Model_AttributeRefAttr_H_
11 #include "ModelAPI_AttributeRefAttr.h"
12 #include <TDF_Label.hxx>
13 #include <TDF_Reference.hxx>
14 #include <TDataStd_Comment.hxx>
16 /**\class Model_AttributeRefAttr
18 * \brief Attribute that contains reference to an attribute of a feature
19 * (located in the same document).
22 class Model_AttributeRefAttr : public ModelAPI_AttributeRefAttr
24 Handle_TDF_Reference myRef; ///< reference to the feature label
25 ///< ID of the referenced attribute (empty if this is a reference to a feature)
26 Handle_TDataStd_Comment myID;
28 /// Returns true if this attribute references to a object (not to the attribute)
29 MODEL_EXPORT virtual bool isObject();
31 /// Defines the reference to the attribute
32 MODEL_EXPORT virtual void setAttr(std::shared_ptr<ModelAPI_Attribute> theAttr);
34 /// Returns attribute referenced from this attribute
35 MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Attribute> attr();
37 /// Defines the reference to the object
38 MODEL_EXPORT virtual void setObject(ObjectPtr theFeature);
40 /// Returns object referenced from this attribute
41 MODEL_EXPORT virtual ObjectPtr object();
43 /// Returns true if attribute was initialized by some value
44 MODEL_EXPORT virtual bool isInitialized();
47 /// Objects are created for features automatically
48 MODEL_EXPORT Model_AttributeRefAttr(TDF_Label& theLabel);
50 friend class Model_Data;