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"
12 #include <GeomAlgoAPI_MakeShape.h>
14 #include <ModelAPI_Feature.h>
16 /// \class FeaturesPlugin_Boolean
18 /// \brief Feature for applying of Boolean operations on Solids.
19 /// Supports four kinds of Boolean operations: Cut, Fuse, Common and Smash.
20 class FeaturesPlugin_Boolean : public ModelAPI_Feature
32 inline static const std::string& ID()
34 static const std::string MY_ID("Boolean");
38 /// Attribute name of main objects.
39 inline static const std::string& OBJECT_LIST_ID()
41 static const std::string MY_OBJECT_LIST_ID("main_objects");
42 return MY_OBJECT_LIST_ID;
45 /// Attribute name of tool objects.
46 inline static const std::string& TOOL_LIST_ID()
48 static const std::string MY_TOOL_LIST_ID("tool_objects");
49 return MY_TOOL_LIST_ID;
52 /// Attribute name of operation type.
53 inline static const std::string& TYPE_ID()
55 static const std::string MY_TYPE_ID("bool_type");
59 /// \return the kind of a feature.
60 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
62 static std::string MY_KIND = FeaturesPlugin_Boolean::ID();
66 /// Creates a new part document if needed.
67 FEATURESPLUGIN_EXPORT virtual void execute();
69 /// Request for initialization of data model of the feature: adding all attributes.
70 FEATURESPLUGIN_EXPORT virtual void initAttributes();
72 /// Use plugin manager for features creation.
73 FeaturesPlugin_Boolean();
76 std::shared_ptr<GeomAPI_Shape> getShape(const std::string& theAttrName);
78 /// Load Naming data structure of the feature to the document
79 void loadNamingDS(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
80 const std::shared_ptr<GeomAPI_Shape> theBaseShape,
81 const ListOfShape& theTools,
82 const std::shared_ptr<GeomAPI_Shape> theResultShape,
83 GeomAlgoAPI_MakeShape& theMakeShape,
84 GeomAPI_DataMapOfShapeShape& theMapOfShapes);