]> SALOME platform Git repositories - modules/shaper.git/blob - src/PartSetPlugin/PartSetPlugin_Part.h
Salome HOME
Refactoring: static constants are replaced by inline functions in:
[modules/shaper.git] / src / PartSetPlugin / PartSetPlugin_Part.h
1 // File:        PartSetPlugin_Part.h
2 // Created:     27 Mar 2014
3 // Author:      Mikhail PONIKAROV
4
5 #ifndef PartSetPlugin_Part_HeaderFile
6 #define PartSetPlugin_Part_HeaderFile
7
8 #include "PartSetPlugin.h"
9 #include <ModelAPI_Feature.h>
10
11 /**\class PartSetPlugin_Part
12  * \ingroup DataModel
13  * \brief Feature for creation of the new part in PartSet.
14  */
15 class PartSetPlugin_Part: public ModelAPI_Feature
16 {
17 public:
18   /// Part kind
19   inline static const std::string& ID()
20   {
21     static const std::string MY_PART_KIND("Part");
22     return MY_PART_KIND;
23   }
24   /// part reference attribute
25   inline static const std::string& DOC_REF()
26   {
27     static const std::string MY_DOC_REF("PartDocument");
28     return MY_DOC_REF;
29   }
30   /// Returns the kind of a feature
31   PARTSETPLUGIN_EXPORT virtual const std::string& getKind() 
32   {static std::string MY_KIND = PartSetPlugin_Part::ID(); return MY_KIND;}
33
34   /// Returns to which group in the document must be added feature
35   PARTSETPLUGIN_EXPORT virtual const std::string& getGroup() 
36   {static std::string MY_GROUP = "Parts"; return MY_GROUP;}
37
38   /// Creates a new part document if needed
39   PARTSETPLUGIN_EXPORT virtual void execute();
40
41   /// Request for initialization of data model of the feature: adding all attributes
42   PARTSETPLUGIN_EXPORT virtual void initAttributes();
43
44   PARTSETPLUGIN_EXPORT virtual boost::shared_ptr<ModelAPI_Document> documentToAdd();
45
46   /// Returns true if this feature must be displayed in the history (top level of Part tree)
47   PARTSETPLUGIN_EXPORT virtual bool isInHistory() {return false;}
48
49   /// Use plugin manager for features creation
50   PartSetPlugin_Part();
51 };
52
53 #endif