-// 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
#include <ModelAPI_Attribute.h>
#include <ModelAPI_AttributeBoolean.h>
+#include <ModelAPI_AttributeDouble.h>
#include <ModelAPI_AttributeSelectionList.h>
#include <ModelAPI_AttributeString.h>
const std::list<AttributePtr>& theArguments)
: myName(theName)
{
- for (std::list<AttributePtr>::const_iterator anArgIt = theArguments.begin();
- anArgIt != theArguments.end(); ++anArgIt) {
- AttributeBooleanPtr aBoolAttr =
+ std::list<AttributePtr>::const_iterator anArgIt = theArguments.begin();
+ // first attribute is usually for reversing the filter
+ AttributeBooleanPtr aBoolAttr =
std::dynamic_pointer_cast<ModelAPI_AttributeBoolean>(*anArgIt);
- if (aBoolAttr) {
- myReversed = aBoolAttr->value();
- continue;
- }
+ if (aBoolAttr) {
+ myReversed = aBoolAttr->value();
+ ++anArgIt;
+ }
+ for (; anArgIt != theArguments.end(); ++anArgIt) {
AttributeSelectionListPtr aSelList =
std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(*anArgIt);
if (aSelList) {
continue;
}
+ AttributeDoublePtr aDouble = std::dynamic_pointer_cast<ModelAPI_AttributeDouble>(*anArgIt);
+ if (aDouble) {
+ myFilterArguments.push_back(FiltersAPI_Argument(aDouble->value()));
+ continue;
+ }
+
AttributeBooleanPtr aBoolean = std::dynamic_pointer_cast<ModelAPI_AttributeBoolean>(*anArgIt);
if (aBoolean) {
myFilterArguments.push_back(FiltersAPI_Argument(aBoolean->value()));