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>
13 #include <GeomAlgoAPI_Boolean.h>
15 class GeomAlgoAPI_MakeShapeList;
17 /**\class FeaturesPlugin_Boolean
19 * \brief Feature for applying of Boolean operations on Solids.
21 * Supports three kinds of Boolean operations: Cut, Fuse and Common.
22 * For all of them requires two Solids: object and tool.
24 class FeaturesPlugin_Boolean : public ModelAPI_Feature
28 inline static const std::string& ID()
30 static const std::string MY_ID("Boolean");
33 /// attribute name of referenced object
34 inline static const std::string& OBJECT_LIST_ID()
36 static const std::string MY_OBJECT_LIST_ID("main_objects");
37 return MY_OBJECT_LIST_ID;
39 /// attribute name of referenced object
40 inline static const std::string& OBJECT_ID()
42 static const std::string MY_OBJECT_ID("main_object");
45 /// attribute name of tool object
46 inline static const std::string& TOOL_ID()
48 static const std::string MY_TOOL_ID("tool_object");
51 /// attribute name of tool object
52 inline static const std::string& TOOL_LIST_ID()
54 static const std::string MY_TOOL_LIST_ID("tool_objects");
55 return MY_TOOL_LIST_ID;
57 /// attribute name of operation type
58 inline static const std::string& TYPE_ID()
60 static const std::string MY_TYPE_ID("bool_type");
70 /// Returns the kind of a feature
71 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
73 static std::string MY_KIND = FeaturesPlugin_Boolean::ID();
77 /// Creates a new part document if needed
78 FEATURESPLUGIN_EXPORT virtual void execute();
80 /// Request for initialization of data model of the feature: adding all attributes
81 FEATURESPLUGIN_EXPORT virtual void initAttributes();
83 /// Use plugin manager for features creation
84 FeaturesPlugin_Boolean();
87 std::shared_ptr<GeomAPI_Shape> getShape(const std::string& theAttrName);
89 /// Load Naming data structure of the feature to the document
90 void LoadNamingDS(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
91 const std::shared_ptr<GeomAPI_Shape>& theBaseObject,
92 const ListOfShape& theTools,
93 const GeomAlgoAPI_Boolean& theAlgo);