Salome HOME
Merge branch 'master' of newgeom:newgeom.git
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Boolean.h
1 // File:        FeaturesPlugin_Boolean.h
2 // Created:     02 Sept 2014
3 // Author:      Vitaly SMETANNIKOV
4
5 #ifndef FeaturesPlugin_Cut_H_
6 #define FeaturesPlugin_Cut_H_
7
8 #include "FeaturesPlugin.h"
9 #include <ModelAPI_Feature.h>
10 #include <GeomAPI_Shape.h>
11
12 class FeaturesPlugin_Boolean : public ModelAPI_Feature
13 {
14  public:
15   /// Extrusion kind
16   inline static const std::string& ID()
17   {
18     static const std::string MY_CUT_ID("Boolean");
19     return MY_CUT_ID;
20   }
21   /// attribute name of referenced object
22   inline static const std::string& OBJECT_ID()
23   {
24     static const std::string MY_OBJECT_ID("main_object");
25     return MY_OBJECT_ID;
26   }
27   /// attribute name of tool object
28   inline static const std::string& TOOL_ID()
29   {
30     static const std::string MY_TOOL_ID("tool_object");
31     return MY_TOOL_ID;
32   }
33   /// attribute name of operation type
34   inline static const std::string& TYPE_ID()
35   {
36     static const std::string MY_TOOL_ID("bool_type");
37     return MY_TOOL_ID;
38   }
39
40   enum {
41     BOOL_CUT,
42     BOOL_FUSE,
43     BOOL_COMMON
44   };
45
46
47   /// Returns the kind of a feature
48   FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
49   {
50     static std::string MY_KIND = FeaturesPlugin_Boolean::ID();
51     return MY_KIND;
52   }
53
54   /// Creates a new part document if needed
55   FEATURESPLUGIN_EXPORT virtual void execute();
56
57   /// Request for initialization of data model of the feature: adding all attributes
58   FEATURESPLUGIN_EXPORT virtual void initAttributes();
59
60   /// Use plugin manager for features creation
61   FeaturesPlugin_Boolean();
62
63 private:
64   boost::shared_ptr<GeomAPI_Shape> getShape(const std::string& theAttrName);
65
66 };
67
68 #endif