1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: Model_AttributeReference.h
5 // Author: Mikhail PONIKAROV
7 #ifndef Model_AttributeReference_H_
8 #define Model_AttributeReference_H_
11 #include "ModelAPI_AttributeReference.h"
12 #include <ModelAPI_Feature.h>
13 #include <TDF_Label.hxx>
14 #include <TDF_Reference.hxx>
16 /**\class Model_AttributeReference
18 * \brief Attribute that contains reference to feature (located in the same document).
21 class Model_AttributeReference : public ModelAPI_AttributeReference
23 Handle_TDF_Reference myRef; ///< references to the feature label
25 /// Defines the object referenced from this attribute
26 MODEL_EXPORT virtual void setValue(ObjectPtr theObject);
28 /// Returns object referenced from this attribute
29 MODEL_EXPORT virtual ObjectPtr value();
31 MODEL_EXPORT ~Model_AttributeReference();
33 MODEL_EXPORT virtual void setObject(const std::shared_ptr<ModelAPI_Object>& theObject);
35 /// Returns true if attribute was initialized by some value
36 MODEL_EXPORT virtual bool isInitialized();
40 /// Objects are created for features automatically
41 MODEL_EXPORT Model_AttributeReference(TDF_Label& theLabel);
43 friend class Model_Data;
44 friend class Model_AttributeSelection;