//==================================================================================================
FeaturesAPI_BooleanCommon::FeaturesAPI_BooleanCommon(
const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theMainObjects,
- const int theVersion)
+ const std::list<ModelHighAPI_Selection>& theMainObjects)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
fillAttribute(FeaturesPlugin_BooleanCommon::CREATION_METHOD_SIMPLE(), mycreationMethod);
- fillAttribute(theVersion, theFeature->integer(FeaturesPlugin_Boolean::VERSION_ID()));
fillAttribute(theMainObjects, mymainObjects);
execute(false);
FeaturesAPI_BooleanCommon::FeaturesAPI_BooleanCommon(
const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theMainObjects,
- const std::list<ModelHighAPI_Selection>& theToolObjects,
- const int theVersion)
+ const std::list<ModelHighAPI_Selection>& theToolObjects)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
fillAttribute(FeaturesPlugin_BooleanCommon::CREATION_METHOD_ADVANCED(), mycreationMethod);
- fillAttribute(theVersion, theFeature->integer(FeaturesPlugin_Boolean::VERSION_ID()));
fillAttribute(theMainObjects, mymainObjects);
fillAttribute(theToolObjects, mytoolObjects);
aBase->selectionList(FeaturesPlugin_BooleanCommon::OBJECT_LIST_ID());
AttributeSelectionListPtr aTools =
aBase->selectionList(FeaturesPlugin_BooleanCommon::TOOL_LIST_ID());
- AttributeIntegerPtr aVersion =
- aBase->integer(FeaturesPlugin_BooleanCommon::VERSION_ID());
theDumper << "(" << aDocName << ", " << anObjects;
theDumper << ", " << aTools;
}
- if (aVersion && aVersion->isInitialized() &&
- aVersion->value() == FeaturesPlugin_VersionedBoolean::THE_VERSION_1) {
+ if (!aBase->data()->version().empty())
theDumper << ", keepSubResults = True";
- }
theDumper << ")" << std::endl;
}
-//==================================================================================================
-static BooleanCommonPtr addCommon(const std::shared_ptr<ModelAPI_Document>& thePart,
- const std::list<ModelHighAPI_Selection>& theMainObjects,
- const int theVersion)
-{
- std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_BooleanCommon::ID());
- return BooleanCommonPtr(new FeaturesAPI_BooleanCommon(aFeature, theMainObjects, theVersion));
-}
-
-//==================================================================================================
-static BooleanCommonPtr addCommon(const std::shared_ptr<ModelAPI_Document>& thePart,
- const std::list<ModelHighAPI_Selection>& theMainObjects,
- const std::list<ModelHighAPI_Selection>& theToolObjects,
- const int theVersion)
-{
- std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_BooleanCommon::ID());
- return BooleanCommonPtr(new FeaturesAPI_BooleanCommon(aFeature,
- theMainObjects,
- theToolObjects,
- theVersion));
-}
-
//==================================================================================================
BooleanCommonPtr addCommon(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const std::list<ModelHighAPI_Selection>& theToolObjects,
const bool keepSubResults)
{
- int aVersion = keepSubResults ? FeaturesPlugin_VersionedBoolean::THE_VERSION_1
- : FeaturesPlugin_VersionedBoolean::THE_VERSION_0;
- return theToolObjects.empty() ? addCommon(thePart, theMainObjects, aVersion)
- : addCommon(thePart, theMainObjects, theToolObjects, aVersion);
+ std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_BooleanCommon::ID());
+ if (!keepSubResults)
+ aFeature->data()->setVersion("");
+ BooleanCommonPtr aCommon;
+ if (theToolObjects.empty())
+ aCommon.reset(new FeaturesAPI_BooleanCommon(aFeature, theMainObjects));
+ else
+ aCommon.reset(new FeaturesAPI_BooleanCommon(aFeature, theMainObjects, theToolObjects));
+ return aCommon;
}