From: spo Date: Wed, 18 Nov 2015 08:29:27 +0000 (+0300) Subject: Issue #1084: parameter cyclic dependence X-Git-Tag: V_2.0.0~13^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=34a3bcfe3a83f8b809593e55a614a941500bd0ea;p=modules%2Fshaper.git Issue #1084: parameter cyclic dependence --- diff --git a/src/ParametersPlugin/ParametersPlugin_Parameter.cpp b/src/ParametersPlugin/ParametersPlugin_Parameter.cpp index b6596f6e0..961182a71 100644 --- a/src/ParametersPlugin/ParametersPlugin_Parameter.cpp +++ b/src/ParametersPlugin/ParametersPlugin_Parameter.cpp @@ -102,11 +102,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 + // Parameter with the same name should be searched in the parent document. + // For the PartSet assume that the parameter is absent. + // Currently there is no way to get parent document, so we get PartSet for all. DocumentPtr aDocument = document(); - if (data()->name() == aVariableName) + if (data()->name() == aVariableName) { + if (aDocument = ModelAPI_Session::get()->moduleDocument()) + continue; aDocument = ModelAPI_Session::get()->moduleDocument(); + } double aValue; ResultParameterPtr aParamRes;