Salome HOME
Added support of python high level API addons proposed by DBC as test of this approach.
[modules/shaper.git] / src / PartSetPlugin / PartSetPlugin_Part.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        PartSetPlugin_Part.h
4 // Created:     27 Mar 2014
5 // Author:      Mikhail PONIKAROV
6
7 #ifndef PartSetPlugin_Part_H_
8 #define PartSetPlugin_Part_H_
9
10 #include "PartSetPlugin.h"
11 #include <ModelAPI_Feature.h>
12
13 /**\class PartSetPlugin_Part
14  * \ingroup Plugins
15  * \brief Feature for creation of the new part in PartSet.
16  */
17 class PartSetPlugin_Part : public ModelAPI_Feature
18 {
19  public:
20   /// Part kind
21   inline static const std::string& ID()
22   {
23     static const std::string MY_PART_KIND("Part");
24     return MY_PART_KIND;
25   }
26   /// Returns the kind of a feature
27   PARTSETPLUGIN_EXPORT virtual const std::string& getKind()
28   {
29     static std::string MY_KIND = PartSetPlugin_Part::ID();
30     return MY_KIND;
31   }
32
33   /// Returns to which group in the document must be added feature
34   PARTSETPLUGIN_EXPORT virtual const std::string& getGroup()
35   {
36     static std::string MY_GROUP = "Parts";
37     return MY_GROUP;
38   }
39
40   /// Creates a new part document if needed
41   PARTSETPLUGIN_EXPORT virtual void execute();
42
43   /// Request for initialization of data model of the feature: adding all attributes
44   PARTSETPLUGIN_EXPORT virtual void initAttributes();
45
46   /// Part must be added only to PartSet
47   PARTSETPLUGIN_EXPORT virtual const std::string& documentToAdd();
48
49   /// Returns true if this feature must be displayed in the history (top level of Part tree)
50   PARTSETPLUGIN_EXPORT virtual bool isInHistory()
51   {
52     return false;
53   }
54
55   /// Use plugin manager for features creation
56   PartSetPlugin_Part();
57 };
58
59 #endif