X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFiltersAPI%2FFiltersAPI_Argument.cpp;h=48d6656a01356dd2b078142fda9e0f11490f430e;hb=fc72d43b677baa05ae7fd317346fd8b723b799ed;hp=d4c77ab2f2af56872dd18dd36152e641e81c4ff7;hpb=30b704bbf16a3e6bfda63b6f1df05da40b6a939b;p=modules%2Fshaper.git diff --git a/src/FiltersAPI/FiltersAPI_Argument.cpp b/src/FiltersAPI/FiltersAPI_Argument.cpp index d4c77ab2f..48d6656a0 100644 --- a/src/FiltersAPI/FiltersAPI_Argument.cpp +++ b/src/FiltersAPI/FiltersAPI_Argument.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2019 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 @@ -23,6 +23,21 @@ FiltersAPI_Argument::FiltersAPI_Argument() { } +FiltersAPI_Argument::FiltersAPI_Argument(const bool theValue) + : myBoolean(theValue) +{ +} + +FiltersAPI_Argument::FiltersAPI_Argument(const ModelHighAPI_Double theValue) + : myDouble(theValue) +{ +} + +FiltersAPI_Argument::FiltersAPI_Argument(const double& theValue) +{ + myDouble = theValue; +} + FiltersAPI_Argument::FiltersAPI_Argument(const std::string& theValue) : myValue(theValue) { @@ -44,8 +59,19 @@ FiltersAPI_Argument::~FiltersAPI_Argument() void FiltersAPI_Argument::dump(ModelHighAPI_Dumper& theDumper) const { - if (mySelectionAttr) - theDumper << mySelectionAttr; - else if (mySelection.variantType() == ModelHighAPI_Selection::VT_Empty) - theDumper << "\"" << myValue << "\""; + if (mySelectionAttr) { + // write empty selection attribute, because parametrization is not supported yet + theDumper << "model.selection()"; // mySelectionAttr; + } + else if (mySelection.variantType() == ModelHighAPI_Selection::VT_Empty) { + if (myDouble.value() > std::numeric_limits::lowest() ) { + theDumper << myDouble.value(); + } + else if (myValue.empty()) { + theDumper << myBoolean; + } + else{ + theDumper << "\"" << myValue << "\""; + } + } }