Salome HOME
Make preview of python Box feature working correctly
[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   PARTSETPLUGIN_EXPORT virtual std::shared_ptr<ModelAPI_Document> documentToAdd();
47
48   /// Returns true if this feature must be displayed in the history (top level of Part tree)
49   PARTSETPLUGIN_EXPORT virtual bool isInHistory()
50   {
51     return false;
52   }
53
54   /// Use plugin manager for features creation
55   PartSetPlugin_Part();
56 };
57
58 #endif