Salome HOME
Copyright update 2022
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_Union.cpp
index bc8bc1859a8f1a13701ba0f53db3ab10bf17b505..082016c98ec49d5811dc17721edc850a330b4764 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
@@ -31,12 +31,10 @@ FeaturesAPI_Union::FeaturesAPI_Union(const std::shared_ptr<ModelAPI_Feature>& th
 
 //================================================================================================
 FeaturesAPI_Union::FeaturesAPI_Union(const std::shared_ptr<ModelAPI_Feature>& theFeature,
-                                     const std::list<ModelHighAPI_Selection>& theBaseObjects,
-                                     const int theVersion)
+                                     const std::list<ModelHighAPI_Selection>& theBaseObjects)
 : ModelHighAPI_Interface(theFeature)
 {
   if(initialize()) {
-    fillAttribute(theVersion, theFeature->integer(FeaturesPlugin_VersionedBoolean::VERSION_ID()));
     setBase(theBaseObjects);
   }
 }
@@ -63,13 +61,10 @@ void FeaturesAPI_Union::dump(ModelHighAPI_Dumper& theDumper) const
 
   AttributeSelectionListPtr anAttrObjects =
     aBase->selectionList(FeaturesPlugin_Union::BASE_OBJECTS_ID());
-  AttributeIntegerPtr aVersion =
-    aBase->integer(FeaturesPlugin_Union::VERSION_ID());
 
   theDumper << aBase << " = model.addUnion(" << aDocName << ", " << anAttrObjects;
 
-  if (aVersion && aVersion->isInitialized() &&
-      aVersion->value() == FeaturesPlugin_VersionedBoolean::THE_VERSION_1)
+  if (!aBase->data()->version().empty())
     theDumper << ", keepSubResults = True";
 
   theDumper << ")" << std::endl;
@@ -80,8 +75,8 @@ UnionPtr addUnion(const std::shared_ptr<ModelAPI_Document>& thePart,
                   const std::list<ModelHighAPI_Selection>& theBaseObjects,
                   const bool keepSubResults)
 {
-  int aVersion = keepSubResults ? FeaturesPlugin_VersionedBoolean::THE_VERSION_1
-                                : FeaturesPlugin_VersionedBoolean::THE_VERSION_0;
   std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Union::ID());
-  return UnionPtr(new FeaturesAPI_Union(aFeature, theBaseObjects, aVersion));
+  if (!keepSubResults)
+    aFeature->data()->setVersion("");
+  return UnionPtr(new FeaturesAPI_Union(aFeature, theBaseObjects));
 }