1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: Model_AttributeDocRef.h
5 // Author: Mikhail PONIKAROV
7 #ifndef Model_AttributeDocRef_H_
8 #define Model_AttributeDocRef_H_
11 #include "ModelAPI_AttributeDocRef.h"
12 #include <TDataStd_Integer.hxx>
13 #include <TDF_Label.hxx>
15 /**\class Model_AttributeDocRef
17 * \brief Attribute that contains reference to another document.
20 class Model_AttributeDocRef : public ModelAPI_AttributeDocRef
22 /// persistent and unique identifier of the document in the application
23 Handle(TDataStd_Integer) myID;
26 /// Defines the document referenced from this attribute
27 MODEL_EXPORT virtual void setValue(std::shared_ptr<ModelAPI_Document> theDoc);
29 /// Returns document referenced from this attribute
30 MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Document> value();
32 /// Returns the persisten ID of the document
33 MODEL_EXPORT virtual int docId();
36 /// Initializes attibutes
37 Model_AttributeDocRef(TDF_Label& theLabel);
39 /// Reinitializes the internal state of the attribute (may be needed on undo/redo, abort, etc)
40 virtual void reinit();
42 friend class Model_Data;