Salome HOME
Update the internal persistence mechanism of documents identification: on load/save...
[modules/shaper.git] / src / PartSetPlugin / PartSetPlugin_Duplicate.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        PartSetPlugin_Duplicate.h
4 // Created:     20 May 2014
5 // Author:      Mikhail PONIKAROV
6
7 #ifndef PartSetPlugin_Duplicate_H_
8 #define PartSetPlugin_Duplicate_H_
9
10 #include "PartSetPlugin.h"
11 #include <ModelAPI_Feature.h>
12
13 /**\class PartSetPlugin_Duplicate
14  * \ingroup Plugins
15  * \brief Duplicates the active part (not root). Creates a new "part" feature.
16  */
17 class PartSetPlugin_Duplicate : public ModelAPI_Feature
18 {
19  public:
20  
21   /// Duplicate kind
22   inline static const std::string& ID()
23   {
24     static const std::string MY_REMOVE_KIND("Duplicate");
25     return MY_REMOVE_KIND;
26   }
27   /// Returns the kind of a feature
28   PARTSETPLUGIN_EXPORT virtual const std::string& getKind()
29   {
30     static std::string MY_KIND = PartSetPlugin_Duplicate::ID();
31     return MY_KIND;
32   }
33
34   /// Returns to which group in the document must be added feature
35   PARTSETPLUGIN_EXPORT virtual const std::string& getGroup()
36   {
37     static std::string MY_GROUP = "Parts";
38     return MY_GROUP;
39   }
40
41   /// Request for initialization of data model of the feature: adding all attributes
42   PARTSETPLUGIN_EXPORT virtual void initAttributes()
43   {
44   }
45
46   /// Not normal feature that stored in the tree
47   PARTSETPLUGIN_EXPORT virtual bool isAction()
48   {
49     return true;
50   }
51
52   /// Performs the "duplicate"
53   PARTSETPLUGIN_EXPORT virtual void execute();
54
55   /// Use plugin manager for features creation
56   PartSetPlugin_Duplicate()
57   {
58   }
59
60 };
61
62 #endif