X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesAPI%2FFeaturesAPI_Union.cpp;h=3c652adbadc69dac3d5b3bc0ca6c4fc036bac70f;hb=225d6f1701361554ace1069e200002c18cd83771;hp=7c960b13582f3762b8bec38aa28e6810caff9c62;hpb=5a10b65659c971be26bd7343c50a2488e48f49e3;p=modules%2Fshaper.git diff --git a/src/FeaturesAPI/FeaturesAPI_Union.cpp b/src/FeaturesAPI/FeaturesAPI_Union.cpp index 7c960b135..3c652adba 100644 --- a/src/FeaturesAPI/FeaturesAPI_Union.cpp +++ b/src/FeaturesAPI/FeaturesAPI_Union.cpp @@ -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 @@ -31,12 +31,10 @@ FeaturesAPI_Union::FeaturesAPI_Union(const std::shared_ptr& th //================================================================================================ FeaturesAPI_Union::FeaturesAPI_Union(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const int theVersion) + const std::list& theBaseObjects) : ModelHighAPI_Interface(theFeature) { if(initialize()) { - fillAttribute(theVersion, theFeature->integer(FeaturesPlugin_VersionedBoolean::VERSION_ID())); setBase(theBaseObjects); } } @@ -63,13 +61,11 @@ 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()) - theDumper << ", " << aVersion->value(); + if (!aBase->data()->version().empty()) + theDumper << ", keepSubResults = True"; theDumper << ")" << std::endl; } @@ -77,8 +73,10 @@ void FeaturesAPI_Union::dump(ModelHighAPI_Dumper& theDumper) const //================================================================================================== UnionPtr addUnion(const std::shared_ptr& thePart, const std::list& theBaseObjects, - const int theVersion) + const bool keepSubResults) { std::shared_ptr aFeature = thePart->addFeature(FeaturesAPI_Union::ID()); - return UnionPtr(new FeaturesAPI_Union(aFeature, theBaseObjects, theVersion)); + if (!keepSubResults) + aFeature->data()->setVersion(""); + return UnionPtr(new FeaturesAPI_Union(aFeature, theBaseObjects)); }