Salome HOME
3a4638a69c69588cbd0013cd73821c4f06e90eff
[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_Comment.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   Handle_TDataStd_Comment myComment;  ///< reference to document is identified as string-id
23   std::shared_ptr<ModelAPI_Document> myDoc; ///< document referenced by this attribute (if already loaded)
24  public:
25   /// Defines the document referenced from this attribute
26   MODEL_EXPORT virtual void setValue(std::shared_ptr<ModelAPI_Document> theDoc);
27
28   /// Returns document referenced from this attribute
29   MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Document> value();
30
31  protected:
32   /// Initializes attibutes
33   Model_AttributeDocRef(TDF_Label& theLabel);
34
35   friend class Model_Data;
36 };
37
38 #endif