From: spo Date: Tue, 17 Nov 2015 12:03:32 +0000 (+0300) Subject: Issue #1084: parameter cyclic dependence X-Git-Tag: V_2.0.0~29 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2fe95688a9e2d14d66c48b5b200c1677b558a141;p=modules%2Fshaper.git Issue #1084: parameter cyclic dependence --- diff --git a/src/ParametersPlugin/ParametersPlugin_Parameter.cpp b/src/ParametersPlugin/ParametersPlugin_Parameter.cpp index 712533bbc..c51ae80de 100644 --- a/src/ParametersPlugin/ParametersPlugin_Parameter.cpp +++ b/src/ParametersPlugin/ParametersPlugin_Parameter.cpp @@ -104,9 +104,15 @@ double ParametersPlugin_Parameter::evaluate(const std::string& theExpression, st for ( ; it != anExprParams.end(); it++) { std::string& aVariableName = *it; + // parameter with the same name should be searched in the parent document + // currently there is no way to get parent document, so we get PartSet doc + DocumentPtr aDocument = document(); + if (data()->name() == aVariableName) + aDocument = ModelAPI_Session::get()->moduleDocument(); + double aValue; ResultParameterPtr aParamRes; - if (!ModelAPI_Tools::findVariable(aVariableName, aValue, aParamRes, document())) continue; + if (!ModelAPI_Tools::findVariable(aVariableName, aValue, aParamRes, aDocument)) continue; aParamsList.push_back(aParamRes); std::ostringstream sstream;