1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: FeaturesPlugin_CompositeBoolean.h
4 // Created: 11 June 2015
5 // Author: Dmitry Bobylev
7 #ifndef FeaturesPlugin_CompositeBoolean_H_
8 #define FeaturesPlugin_CompositeBoolean_H_
10 #include "FeaturesPlugin.h"
12 #include <ModelAPI_Feature.h>
13 #include <ModelAPI_ResultBody.h>
14 #include <GeomAlgoAPI_MakeShape.h>
16 /// \class FeaturesPlugin_CompositeBoolean
18 /// \brief Interface for the composite boolean feature.
19 class FeaturesPlugin_CompositeBoolean
29 /// Attribute name of main objects.
30 inline static const std::string& OBJECTS_ID()
32 static const std::string MY_OBJECTS_ID("main_objects");
36 /// Creates a new part document if needed.
37 FEATURESPLUGIN_EXPORT virtual void executeCompositeBoolean();
40 FeaturesPlugin_CompositeBoolean(){};
42 /// Initializes boolean attributes.
43 void initBooleanAttributes();
45 /// This function need to be defined for extrusion/revolution generation.
46 virtual bool makeGeneration(ListOfShape& theBaseShapes,
47 ListOfMakeShape& theMakeShapes) = 0;
49 /// Makes boolean operation.
50 /// \param[in] theTools list of tools.
51 /// \param[out] theObjects list of objects.
52 /// \param[out] theMakeShapes list of according algos.
53 /// \return false in failed.
54 bool makeBoolean(const ListOfShape& theTools,
55 ListOfShape& theObjects,
56 ListOfMakeShape& theMakeShapes);
58 /// Stores generation history.
59 virtual void storeGenerationHistory(ResultBodyPtr theResultBody,
60 const GeomShapePtr theBaseShape,
61 const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
64 /// Stores modification history.
65 void storeModificationHistory(ResultBodyPtr theResultBody,
66 const GeomShapePtr theObject,
67 const ListOfShape& theTools,
68 const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
72 ModelAPI_Feature* myFeature;
73 OperationType myOperationType;