Salome HOME
Use validators to set import file formats
[modules/shaper.git] / src / Model / Model_AttributeDocRef.h
1 // File:        Model_AttributeDocRef.h
2 // Created:     2 Apr 2014
3 // Author:      Mikhail PONIKAROV
4
5 #ifndef Model_AttributeDocRef_H_
6 #define Model_AttributeDocRef_H_
7
8 #include "Model.h"
9 #include "ModelAPI_AttributeDocRef.h"
10 #include <TDataStd_Comment.hxx>
11 #include <TDF_Label.hxx>
12
13 /**\class Model_AttributeDocRef
14  * \ingroup DataModel
15  * \brief Attribute that contains reference to another document.
16  */
17
18 class Model_AttributeDocRef : public ModelAPI_AttributeDocRef
19 {
20   Handle_TDataStd_Comment myComment;  ///< reference to document is identified as string-id
21   boost::shared_ptr<ModelAPI_Document> myDoc; ///< document referenced by this attribute (if already loaded)
22  public:
23   /// Defines the document referenced from this attribute
24   MODEL_EXPORT virtual void setValue(boost::shared_ptr<ModelAPI_Document> theDoc);
25
26   /// Returns document referenced from this attribute
27   MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_Document> value();
28
29  protected:
30   /// Initializes attibutes
31   Model_AttributeDocRef(TDF_Label& theLabel);
32
33   friend class Model_Data;
34 };
35
36 #endif