Salome HOME
* store result only after checking if sewn
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Boolean.h
index 38c8a57ee2cf570b07bd79d4aeff2a4e38dc9b52..960edb58431382057908280b94c7ee57c4b36eb5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2022  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
 #ifndef FeaturesPlugin_Boolean_H_
 #define FeaturesPlugin_Boolean_H_
 
-#include "FeaturesPlugin.h"
-
-#include <GeomAlgoAPI_MakeShape.h>
-
-#include <ModelAPI_Feature.h>
+#include "FeaturesPlugin_VersionedBoolean.h"
 
 /// \class FeaturesPlugin_Boolean
 /// \ingroup Plugins
 /// \brief Feature for applying of Boolean operations on Solids.
 /// Supports four kinds of Boolean operations: Cut, Fuse, Common and Smash.
-class FeaturesPlugin_Boolean : public ModelAPI_Feature
+class FeaturesPlugin_Boolean : public FeaturesPlugin_VersionedBoolean
 {
 public:
   enum OperationType {
@@ -73,6 +69,14 @@ protected:
                     const std::shared_ptr<GeomAPI_Shape> theResultShape,
                     const GeomMakeShapePtr& theMakeShape);
 
+  /// Store result shape if it is not empty and increase results counter
+  void storeResult(const ListOfShape& theObjects,
+                   const ListOfShape& theTools,
+                   const GeomShapePtr theResultShape,
+                   int& theResultIndex,
+                   std::shared_ptr<GeomAlgoAPI_MakeShapeList> theMakeShapeList,
+                   std::vector<ModelAPI_Tools::ResultBaseAlgo>& theResultBaseAlgoList);
+
 private:
   OperationType myOperationType;
 };