1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: FeaturesPlugin_Boolean.h
4 // Created: 02 Sept 2014
5 // Author: Vitaly SMETANNIKOV
7 #ifndef FeaturesPlugin_Cut_H_
8 #define FeaturesPlugin_Cut_H_
10 #include "FeaturesPlugin.h"
11 #include <ModelAPI_Feature.h>
12 #include <GeomAPI_Shape.h>
13 #include <GeomAlgoAPI_Boolean.h>
15 /**\class FeaturesPlugin_Boolean
17 * \brief Feature for applying of Boolean operations on Solids.
19 * Supports three kinds of Boolean operations: Cut, Fuse and Common.
20 * For all of them requires two Solids: object and tool.
22 class FeaturesPlugin_Boolean : public ModelAPI_Feature
26 inline static const std::string& ID()
28 static const std::string MY_ID("Boolean");
31 /// attribute name of referenced object
32 inline static const std::string& OBJECT_LIST_ID()
34 static const std::string MY_OBJECT_LIST_ID("main_objects");
35 return MY_OBJECT_LIST_ID;
37 /// attribute name of referenced object
38 inline static const std::string& OBJECT_ID()
40 static const std::string MY_OBJECT_ID("main_object");
43 /// attribute name of tool object
44 inline static const std::string& TOOL_ID()
46 static const std::string MY_TOOL_ID("tool_object");
49 /// attribute name of tool object
50 inline static const std::string& TOOL_LIST_ID()
52 static const std::string MY_TOOL_LIST_ID("tool_objects");
53 return MY_TOOL_LIST_ID;
55 /// attribute name of operation type
56 inline static const std::string& TYPE_ID()
58 static const std::string MY_TYPE_ID("bool_type");
68 /// Returns the kind of a feature
69 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
71 static std::string MY_KIND = FeaturesPlugin_Boolean::ID();
75 /// Creates a new part document if needed
76 FEATURESPLUGIN_EXPORT virtual void execute();
78 /// Request for initialization of data model of the feature: adding all attributes
79 FEATURESPLUGIN_EXPORT virtual void initAttributes();
81 /// Use plugin manager for features creation
82 FeaturesPlugin_Boolean();
85 std::shared_ptr<GeomAPI_Shape> getShape(const std::string& theAttrName);
87 /// Load Naming data structure of the feature to the document
88 void LoadNamingDS(GeomAlgoAPI_Boolean* theFeature,
89 std::shared_ptr<ModelAPI_ResultBody> theResultBody,
90 std::shared_ptr<GeomAPI_Shape> theObject,
91 std::shared_ptr<GeomAPI_Shape> theTool,