X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesAPI%2FFeaturesAPI_BooleanSmash.cpp;h=1d496e396c63fcf83aad32509647a903023e304f;hb=fc72d43b677baa05ae7fd317346fd8b723b799ed;hp=f32c0a2fe6148b01626340894c38fa0c8adc5be1;hpb=d1b709d70679576ea02a36b81d62a238dad4bf2a;p=modules%2Fshaper.git diff --git a/src/FeaturesAPI/FeaturesAPI_BooleanSmash.cpp b/src/FeaturesAPI/FeaturesAPI_BooleanSmash.cpp index f32c0a2fe..1d496e396 100644 --- a/src/FeaturesAPI/FeaturesAPI_BooleanSmash.cpp +++ b/src/FeaturesAPI/FeaturesAPI_BooleanSmash.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2022 CEA/DEN, EDF R&D +// Copyright (C) 2014-2023 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 @@ -44,12 +44,17 @@ FeaturesAPI_BooleanSmash::FeaturesAPI_BooleanSmash( : ModelHighAPI_Interface(theFeature) { if(initialize()) { - bool aUseFuzzy = (theFuzzy.value() > 0); - ModelHighAPI_Double aFuzzy = (aUseFuzzy ? theFuzzy : ModelHighAPI_Double(DEFAULT_FUZZY)); - fillAttribute(theMainObjects, mymainObjects); - fillAttribute(theToolObjects, mytoolObjects); - fillAttribute(aUseFuzzy, myuseFuzzy); - fillAttribute(aFuzzy, myfuzzyParam); + fillAttribute(theMainObjects, VAR_NAME(mainObjects)); + fillAttribute(theToolObjects, VAR_NAME(toolObjects)); + fillAttribute(theFuzzy, VAR_NAME(fuzzyParam)); + + // Get the evaluated fuzzy parameter from the attribute!! + bool aUseFuzzy = (fuzzyParam()->value() > 0); + fillAttribute(aUseFuzzy, VAR_NAME(useFuzzy)); + if (!aUseFuzzy) { + ModelHighAPI_Double aFuzzy(DEFAULT_FUZZY); + fillAttribute(aFuzzy, VAR_NAME(fuzzyParam)); + } execute(false); } @@ -65,7 +70,7 @@ FeaturesAPI_BooleanSmash::~FeaturesAPI_BooleanSmash() void FeaturesAPI_BooleanSmash::setMainObjects( const std::list& theMainObjects) { - fillAttribute(theMainObjects, mymainObjects); + fillAttribute(theMainObjects, VAR_NAME(mainObjects)); execute(); } @@ -74,7 +79,7 @@ void FeaturesAPI_BooleanSmash::setMainObjects( void FeaturesAPI_BooleanSmash::setToolObjects( const std::list& theToolObjects) { - fillAttribute(theToolObjects, mytoolObjects); + fillAttribute(theToolObjects, VAR_NAME(toolObjects)); execute(); } @@ -82,7 +87,7 @@ void FeaturesAPI_BooleanSmash::setToolObjects( //================================================================================================== void FeaturesAPI_BooleanSmash::setUseFuzzy(bool theUseFuzzy) { - fillAttribute(theUseFuzzy, myuseFuzzy); + fillAttribute(theUseFuzzy, VAR_NAME(useFuzzy)); execute(); } @@ -90,7 +95,7 @@ void FeaturesAPI_BooleanSmash::setUseFuzzy(bool theUseFuzzy) //================================================================================================== void FeaturesAPI_BooleanSmash::setFuzzyValue(const ModelHighAPI_Double& theFuzzy) { - fillAttribute(theFuzzy, myfuzzyParam); + fillAttribute(theFuzzy, VAR_NAME(fuzzyParam)); execute(); } @@ -125,11 +130,11 @@ void FeaturesAPI_BooleanSmash::dump(ModelHighAPI_Dumper& theDumper) const BooleanSmashPtr addSmash(const std::shared_ptr& thePart, const std::list& theMainObjects, const std::list& theToolObjects, - const ModelHighAPI_Double& fuzzyParam, + const ModelHighAPI_Double& theFuzzy, const bool keepSubResults) { std::shared_ptr aFeature = thePart->addFeature(FeaturesAPI_BooleanSmash::ID()); if (!keepSubResults) aFeature->data()->setVersion(""); - return BooleanSmashPtr(new FeaturesAPI_BooleanSmash(aFeature, theMainObjects, theToolObjects, fuzzyParam)); + return BooleanSmashPtr(new FeaturesAPI_BooleanSmash(aFeature, theMainObjects, theToolObjects, theFuzzy)); }