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_ID()
34 static const std::string MY_OBJECT_ID("main_object");
37 /// attribute name of tool object
38 inline static const std::string& TOOL_ID()
40 static const std::string MY_TOOL_ID("tool_object");
43 /// attribute name of operation type
44 inline static const std::string& TYPE_ID()
46 static const std::string MY_TYPE_ID("bool_type");
56 /// Returns the kind of a feature
57 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
59 static std::string MY_KIND = FeaturesPlugin_Boolean::ID();
63 /// Creates a new part document if needed
64 FEATURESPLUGIN_EXPORT virtual void execute();
66 /// Request for initialization of data model of the feature: adding all attributes
67 FEATURESPLUGIN_EXPORT virtual void initAttributes();
69 /// Use plugin manager for features creation
70 FeaturesPlugin_Boolean();
73 std::shared_ptr<GeomAPI_Shape> getShape(const std::string& theAttrName);
75 /// Load Naming data structure of the feature to the document
76 void LoadNamingDS(GeomAlgoAPI_Boolean* theFeature,
77 std::shared_ptr<ModelAPI_ResultBody> theResultBody,
78 std::shared_ptr<GeomAPI_Shape> theObject,
79 std::shared_ptr<GeomAPI_Shape> theTool,