]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/FeaturesAPI/FeaturesAPI_Intersection.cpp
Salome HOME
Copyright update 2020
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_Intersection.cpp
index 5e85db2d38e5cdd0269c9c070f21049f0161545d..505cf8e12552edf710b387d8c1b85bab1f24cb7e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2020  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
@@ -66,14 +66,21 @@ void FeaturesAPI_Intersection::dump(ModelHighAPI_Dumper& theDumper) const
   AttributeSelectionListPtr anAttrObjects =
     aBase->selectionList(FeaturesPlugin_Intersection::OBJECT_LIST_ID());
 
-  theDumper << aBase << " = model.addIntersection(" << aDocName << ", "
-            << anAttrObjects << ")" << std::endl;
+  theDumper << aBase << " = model.addIntersection(" << aDocName << ", " << anAttrObjects;
+
+  if (!aBase->data()->version().empty())
+    theDumper << ", keepSubResults = True";
+
+  theDumper << ")" << std::endl;
 }
 
 //==================================================================================================
 IntersectionPtr addIntersection(const std::shared_ptr<ModelAPI_Document>& thePart,
-                                const std::list<ModelHighAPI_Selection>& theObjects)
+                                const std::list<ModelHighAPI_Selection>& theObjects,
+                                const bool keepSubResults)
 {
   std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Intersection::ID());
+  if (!keepSubResults)
+    aFeature->data()->setVersion("");
   return IntersectionPtr(new FeaturesAPI_Intersection(aFeature, theObjects));
 }