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
31 inline static const std::string& ID()
33 static const std::string MY_ID("Boolean");
37 /// Attribute name of main objects.
38 inline static const std::string& OBJECT_LIST_ID()
40 static const std::string MY_OBJECT_LIST_ID("main_objects");
41 return MY_OBJECT_LIST_ID;
44 /// Attribute name of tool objects.
45 inline static const std::string& TOOL_LIST_ID()
47 static const std::string MY_TOOL_LIST_ID("tool_objects");
48 return MY_TOOL_LIST_ID;
51 /// Attribute name of operation type.
52 inline static const std::string& TYPE_ID()
54 static const std::string MY_TYPE_ID("bool_type");
58 /// \return the kind of a feature.
59 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
61 static std::string MY_KIND = FeaturesPlugin_Boolean::ID();
65 /// Creates a new part document if needed.
66 FEATURESPLUGIN_EXPORT virtual void execute();
68 /// Request for initialization of data model of the feature: adding all attributes.
69 FEATURESPLUGIN_EXPORT virtual void initAttributes();
71 /// Use plugin manager for features creation.
72 FeaturesPlugin_Boolean();
75 std::shared_ptr<GeomAPI_Shape> getShape(const std::string& theAttrName);
77 /// Load Naming data structure of the feature to the document
78 void loadNamingDS(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
79 const std::shared_ptr<GeomAPI_Shape> theBaseShape,
80 const ListOfShape& theTools,
81 const std::shared_ptr<GeomAPI_Shape> theResultShape,
82 GeomAlgoAPI_MakeShape& theMakeShape,
83 GeomAPI_DataMapOfShapeShape& theMapOfShapes);