Salome HOME
Merge branch 'Dev_0.6.1' of newgeom:newgeom into Dev_0.6.1
[modules/shaper.git] / src / ModelAPI / ModelAPI_ResultPart.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModelAPI_ResultPart.h
4 // Created:     07 Jul 2014
5 // Author:      Mikhail PONIKAROV
6
7 #ifndef ModelAPI_ResultPart_H_
8 #define ModelAPI_ResultPart_H_
9
10 #include "ModelAPI_Result.h"
11
12 #include <string>
13
14 /**\class ModelAPI_ResultPart
15  * \ingroup DataModel
16  * \brief The Part document, result of a creation of new part feature.
17  *
18  * This result leaves without feature: no parametricity for this element,
19  * only add/remove, undo/redo.
20  */
21 class ModelAPI_ResultPart : public ModelAPI_Result
22 {
23  public:
24   /// Returns the group identifier of this result
25   virtual std::string groupName()
26   {
27     return group();
28   }
29
30   /// Returns the group identifier of this result
31   static std::string group()
32   {
33     static std::string MY_GROUP = "Parts";
34     return MY_GROUP;
35   }
36
37   /// part document reference attribute
38   inline static const std::string& DOC_REF()
39   {
40     static const std::string MY_DOC_REF("PartDocument");
41     return MY_DOC_REF;
42   }
43
44   /// Returns the part-document of this result
45   virtual std::shared_ptr<ModelAPI_Document> partDoc() = 0;
46
47   /// Sets this document as current and if it is not loaded yet, loads it
48   virtual void activate() = 0;
49 };
50
51 //! Pointer on feature object
52 typedef std::shared_ptr<ModelAPI_ResultPart> ResultPartPtr;
53
54 #endif