-// 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
//================================================================================================
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);
}
}
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;
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));
}