Salome HOME
Issue #1860: fix end lines with spaces
[modules/shaper.git] / src / Model / Model_AttributeDocRef.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        Model_AttributeDocRef.h
4 // Created:     2 Apr 2014
5 // Author:      Mikhail PONIKAROV
6
7 #ifndef Model_AttributeDocRef_H_
8 #define Model_AttributeDocRef_H_
9
10 #include "Model.h"
11 #include "ModelAPI_AttributeDocRef.h"
12 #include <TDataStd_Integer.hxx>
13 #include <TDF_Label.hxx>
14
15 /**\class Model_AttributeDocRef
16  * \ingroup DataModel
17  * \brief Attribute that contains reference to another document.
18  */
19
20 class Model_AttributeDocRef : public ModelAPI_AttributeDocRef
21 {
22   /// persistent and unique identifier of the document in the application
23   Handle(TDataStd_Integer) myID;
24  public:
25
26   /// Defines the document referenced from this attribute
27   MODEL_EXPORT virtual void setValue(std::shared_ptr<ModelAPI_Document> theDoc);
28
29   /// Returns document referenced from this attribute
30   MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Document> value();
31
32   /// Returns the persisten ID of the document
33   MODEL_EXPORT virtual int docId();
34
35  protected:
36   /// Initializes attibutes
37   Model_AttributeDocRef(TDF_Label& theLabel);
38
39   /// Reinitializes the internal state of the attribute (may be needed on undo/redo, abort, etc)
40   virtual void reinit();
41
42   friend class Model_Data;
43 };
44
45 #endif