Salome HOME
Change the paradigm of versioning of Boolean Operations on the Python API level.
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_BooleanSmash.cpp
index c23f639678f937da2fa8d0d135ea598798eb9c10..a91647c0979b8e4977479451c6a14cc24ee8e78a 100644 (file)
@@ -89,8 +89,9 @@ void FeaturesAPI_BooleanSmash::dump(ModelHighAPI_Dumper& theDumper) const
 
   theDumper << "(" << aDocName << ", " << anObjects << ", " << aTools;
 
-  if (aVersion && aVersion->isInitialized())
-    theDumper << ", " << aVersion->value();
+  if (aVersion && aVersion->isInitialized() &&
+      aVersion->value() == FeaturesPlugin_VersionedBoolean::THE_VERSION_1)
+    theDumper << ", keepSubResults = True";
 
   theDumper << ")" << std::endl;
 }
@@ -99,11 +100,13 @@ void FeaturesAPI_BooleanSmash::dump(ModelHighAPI_Dumper& theDumper) const
 BooleanSmashPtr addSmash(const std::shared_ptr<ModelAPI_Document>& thePart,
                          const std::list<ModelHighAPI_Selection>& theMainObjects,
                          const std::list<ModelHighAPI_Selection>& theToolObjects,
-                         const int theVersion)
+                         const bool keepSubResults)
 {
   std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_BooleanSmash::ID());
+  int aVersion = keepSubResults ? FeaturesPlugin_VersionedBoolean::THE_VERSION_1
+                                : FeaturesPlugin_VersionedBoolean::THE_VERSION_0;
   return BooleanSmashPtr(new FeaturesAPI_BooleanSmash(aFeature,
                                                       theMainObjects,
                                                       theToolObjects,
-                                                      theVersion));
+                                                      aVersion));
 }