-// Copyright (C) 2014-2019 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include <ModelAPI_Feature.h>
#include <ModelAPI_ResultBody.h>
#include <GeomAlgoAPI_MakeShape.h>
+#include <GeomAlgoAPI_MakeShapeList.h>
/// \class FeaturesPlugin_CompositeBoolean
/// \ingroup Plugins
/// \param[in] theTools list of tools.
/// \param[out] theObjects list of objects.
/// \param[out] theMakeShapes list of according algos.
- /// \return false in failed.
+ /// \return false if failed.
bool makeBoolean(const ListOfShape& theTools,
ListOfShape& theObjects,
ListOfMakeShape& theMakeShapes);
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);
+
protected:
ModelAPI_Feature* myFeature;
OperationType myOperationType;