Salome HOME
CEA : Lot2 - Normal to a face
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_BooleanFill.cpp
index 1d4b4d7e07c3a0c55a45026f3524419d83301942..08d7dfccb8dcfae18ab8f0b32f8432d3e3ede3a2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2021  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
@@ -75,7 +75,7 @@ void FeaturesAPI_BooleanFill::dump(ModelHighAPI_Dumper& theDumper) const
 {
   FeaturePtr aBase = feature();
 
-  theDumper << aBase << " = model.addFill";
+  theDumper << aBase << " = model.addSplit";
 
   const std::string& aDocName = theDumper.name(aBase->document());
   AttributeSelectionListPtr anObjects =
@@ -83,16 +83,22 @@ void FeaturesAPI_BooleanFill::dump(ModelHighAPI_Dumper& theDumper) const
   AttributeSelectionListPtr aTools =
     aBase->selectionList(FeaturesPlugin_BooleanFill::TOOL_LIST_ID());
 
-  theDumper << "(" << aDocName << ", " << anObjects << ", " << aTools << ")" << std::endl;
+  theDumper << "(" << aDocName << ", " << anObjects << ", " << aTools;
+
+  if (!aBase->data()->version().empty())
+    theDumper << ", keepSubResults = True";
+
+  theDumper << ")" << std::endl;
 }
 
 //==================================================================================================
-BooleanFillPtr addFill(const std::shared_ptr<ModelAPI_Document>& thePart,
-                       const std::list<ModelHighAPI_Selection>& theMainObjects,
-                       const std::list<ModelHighAPI_Selection>& theToolObjects)
+BooleanFillPtr addSplit(const std::shared_ptr<ModelAPI_Document>& thePart,
+                        const std::list<ModelHighAPI_Selection>& theMainObjects,
+                        const std::list<ModelHighAPI_Selection>& theToolObjects,
+                        const bool keepSubResults)
 {
   std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_BooleanFill::ID());
-  return BooleanFillPtr(new FeaturesAPI_BooleanFill(aFeature,
-                                                    theMainObjects,
-                                                    theToolObjects));
+  if (!keepSubResults)
+    aFeature->data()->setVersion("");
+  return BooleanFillPtr(new FeaturesAPI_BooleanFill(aFeature, theMainObjects, theToolObjects));
 }