-// Copyright (C) 2014-2022 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
- bool aUseFuzzy = (theFuzzy.value() > 0);
- ModelHighAPI_Double aFuzzy = (aUseFuzzy ? theFuzzy : ModelHighAPI_Double(DEFAULT_FUZZY));
- fillAttribute(FeaturesPlugin_BooleanCommon::CREATION_METHOD_SIMPLE(), mycreationMethod);
- fillAttribute(theMainObjects, mymainObjects);
- fillAttribute(aUseFuzzy, myuseFuzzy);
- fillAttribute(aFuzzy, myfuzzyValue);
+ fillAttribute(FeaturesPlugin_BooleanCommon::CREATION_METHOD_SIMPLE(), VAR_NAME(creationMethod));
+ fillAttribute(theMainObjects, VAR_NAME(mainObjects));
+ 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);
}
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
- bool aUseFuzzy = (theFuzzy.value() > 0);
- ModelHighAPI_Double aFuzzy = (aUseFuzzy ? theFuzzy : ModelHighAPI_Double(DEFAULT_FUZZY));
- fillAttribute(FeaturesPlugin_BooleanCommon::CREATION_METHOD_ADVANCED(), mycreationMethod);
- fillAttribute(theMainObjects, mymainObjects);
- fillAttribute(theToolObjects, mytoolObjects);
- fillAttribute(aUseFuzzy, myuseFuzzy);
- fillAttribute(aFuzzy, myfuzzyValue);
+ fillAttribute(FeaturesPlugin_BooleanCommon::CREATION_METHOD_ADVANCED(), VAR_NAME(creationMethod));
+ 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);
}
void FeaturesAPI_BooleanCommon::setMainObjects(
const std::list<ModelHighAPI_Selection>& theMainObjects)
{
- fillAttribute(theMainObjects, mymainObjects);
+ fillAttribute(theMainObjects, VAR_NAME(mainObjects));
execute();
}
void FeaturesAPI_BooleanCommon::setToolObjects(
const std::list<ModelHighAPI_Selection>& theToolObjects)
{
- fillAttribute(FeaturesPlugin_BooleanCommon::CREATION_METHOD_ADVANCED(), mycreationMethod);
- fillAttribute(theToolObjects, mytoolObjects);
+ fillAttribute(FeaturesPlugin_BooleanCommon::CREATION_METHOD_ADVANCED(), VAR_NAME(creationMethod));
+ fillAttribute(theToolObjects, VAR_NAME(toolObjects));
execute();
}
//==================================================================================================
void FeaturesAPI_BooleanCommon::setUseFuzzy(bool theUseFuzzy)
{
- fillAttribute(theUseFuzzy, myuseFuzzy);
+ fillAttribute(theUseFuzzy, VAR_NAME(useFuzzy));
execute();
}
//==================================================================================================
void FeaturesAPI_BooleanCommon::setFuzzyValue(const ModelHighAPI_Double& theFuzzy)
{
- fillAttribute(theFuzzy, myfuzzyValue);
+ fillAttribute(theFuzzy, VAR_NAME(fuzzyParam));
execute();
}
void FeaturesAPI_BooleanCommon::setAdvancedMode(const bool theMode)
{
if (theMode) {
- fillAttribute(FeaturesPlugin_BooleanCommon::CREATION_METHOD_ADVANCED(), mycreationMethod);
+ fillAttribute(FeaturesPlugin_BooleanCommon::CREATION_METHOD_ADVANCED(), VAR_NAME(creationMethod));
} else {
- fillAttribute(FeaturesPlugin_BooleanCommon::CREATION_METHOD_SIMPLE(), mycreationMethod);
+ fillAttribute(FeaturesPlugin_BooleanCommon::CREATION_METHOD_SIMPLE(), VAR_NAME(creationMethod));
}
execute();
BooleanCommonPtr addCommon(const std::shared_ptr<ModelAPI_Document>& thePart,
const std::list<ModelHighAPI_Selection>& theMainObjects,
const std::list<ModelHighAPI_Selection>& theToolObjects,
- const ModelHighAPI_Double& fuzzyParam,
+ const ModelHighAPI_Double& theFuzzy,
const bool keepSubResults)
{
std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_BooleanCommon::ID());
aFeature->data()->setVersion("");
BooleanCommonPtr aCommon;
if (theToolObjects.empty())
- aCommon.reset(new FeaturesAPI_BooleanCommon(aFeature, theMainObjects, fuzzyParam));
+ aCommon.reset(new FeaturesAPI_BooleanCommon(aFeature, theMainObjects, theFuzzy));
else
- aCommon.reset(new FeaturesAPI_BooleanCommon(aFeature, theMainObjects, theToolObjects, fuzzyParam));
+ aCommon.reset(new FeaturesAPI_BooleanCommon(aFeature, theMainObjects, theToolObjects, theFuzzy));
return aCommon;
}