Salome HOME
updated copyright message
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_CompositeBoolean.h
index fd2fee853b0accaa82b72a299231afbec8ee05e6..86bb438b7a1cc0585eb06fb4294c3fd2f3d3ba81 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2020  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
@@ -25,6 +25,7 @@
 #include <ModelAPI_Feature.h>
 #include <ModelAPI_ResultBody.h>
 #include <GeomAlgoAPI_MakeShape.h>
+#include <GeomAlgoAPI_MakeShapeList.h>
 
 /// \class FeaturesPlugin_CompositeBoolean
 /// \ingroup Plugins
@@ -72,7 +73,7 @@ protected:
   /// \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);
@@ -93,6 +94,29 @@ protected:
                           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;