Salome HOME
Clean Property panel before starting of a new operation.
[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 /// Part kind
12 const std::string PARTSET_PART_KIND("Part");
13
14 /// part reference attribute
15 const std::string PART_ATTR_DOC_REF = "PartDocument";
16
17 /**\class PartSetPlugin_Part
18  * \ingroup DataModel
19  * \brief Feature for creation of the new part in PartSet.
20  */
21 class PartSetPlugin_Part: public ModelAPI_Feature
22 {
23 public:
24   /// Returns the kind of a feature
25   PARTSETPLUGIN_EXPORT virtual const std::string& getKind() 
26   {static std::string MY_KIND = PARTSET_PART_KIND; return MY_KIND;}
27
28   /// Returns to which group in the document must be added feature
29   PARTSETPLUGIN_EXPORT virtual const std::string& getGroup() 
30   {static std::string MY_GROUP = "Parts"; return MY_GROUP;}
31
32   /// Creates a new part document if needed
33   PARTSETPLUGIN_EXPORT virtual void execute();
34
35   /// Request for initialization of data model of the feature: adding all attributes
36   PARTSETPLUGIN_EXPORT virtual void initAttributes();
37
38   PARTSETPLUGIN_EXPORT virtual boost::shared_ptr<ModelAPI_Document> documentToAdd();
39
40   /// Returns true if this feature must be displayed in the history (top level of Part tree)
41   PARTSETPLUGIN_EXPORT virtual bool isInHistory() {return false;}
42
43   /// Use plugin manager for features creation
44   PartSetPlugin_Part();
45 };
46
47 #endif