- /// Define this function to init attributes for extrusion/revolution.
- virtual void initMakeSolidsAttributes() = 0;
-
- /// Define this function to create solids from faces with extrusion/revolution.
- virtual ListOfShape MakeSolids(const ListOfShape& theFaces) = 0;
-
- void LoadNamingDS(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
- const std::shared_ptr<GeomAPI_Shape>& theBaseShape,
- const ListOfShape& theTools,
- const GeomAlgoAPI_Boolean& theAlgo);
+ /// Initializes boolean attributes.
+ void initBooleanAttributes();
+
+ /// This function need to be defined for extrusion/revolution generation.
+ virtual bool makeGeneration(ListOfShape& theBaseShapes,
+ ListOfMakeShape& theMakeShapes) = 0;
+
+ /// Makes boolean operation.
+ /// \param[in] theTools list of tools.
+ /// \param[out] theObjects list of objects.
+ /// \param[out] theMakeShapes list of according algos.
+ /// \return false if failed.
+ bool makeBoolean(const ListOfShape& theTools,
+ ListOfShape& theObjects,
+ ListOfMakeShape& theMakeShapes);
+
+ /// Stores generation history.
+ virtual void storeGenerationHistory(ResultBodyPtr theResultBody,
+ const GeomShapePtr theBaseShape,
+ const GeomMakeShapePtr theMakeShape) = 0;
+
+ /// Stores modification history.
+ void storeModificationHistory(ResultBodyPtr theResultBody,
+ const GeomShapePtr theObject,
+ const ListOfShape& theTools,
+ const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape);
+
+ /// Stores deleted shapes.
+ void storeDeletedShapes(std::vector<ResultBaseAlgo>& theResultBaseAlgoList,
+ const ListOfShape& theTools,
+ const GeomShapePtr theResultShapesCompound);
+
+private:
+ /// Makes cut operation recursively.
+ /// Called from makeBoolean().
+ /// \param[in] theCompound the shape to be cut.
+ /// \param[in] theTools list of tools.
+ /// \param[out] theMakeShapeList list of according algos.
+ /// \param[out] theResult result of cut.
+ /// \return false if failed or no cuts done (this is normal case).
+ bool cutRecursiveCompound (const GeomShapePtr theCompound,
+ const ListOfShape& theTools,
+ std::shared_ptr<GeomAlgoAPI_MakeShapeList>& theMakeShapeList,
+ GeomShapePtr& theResult);
+
+ /// Add subshapes of \a theCompound to \a theSubShapesToAdd list,
+ /// except ones from \a theSubShapesToAvoid.
+ /// Called from makeBoolean().
+ /// \param[in] theCompound the shape to collect sub-shapes of.
+ /// \param[in] theSubShapesToAvoid list of shapes that should not be added to the result.
+ /// \param[out] theSubShapesToAdd list of found sub-shapes.
+ void addSubShapes (const GeomShapePtr theCompound,
+ const ListOfShape& theSubShapesToAvoid,
+ ListOfShape& theSubShapesToAdd);