X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_Tools.cpp;h=3a16235768086f153cbd7a827527520778865a89;hb=506840f28e9ee8b4c520230193bcb28835757f59;hp=1073922eef634e345372e1020a95115d70df8550;hpb=6f5b63de242e0c3e14ea13cd8eb478b67728b0bd;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_Tools.cpp b/src/ModelAPI/ModelAPI_Tools.cpp index 1073922ee..3a1623576 100644 --- a/src/ModelAPI/ModelAPI_Tools.cpp +++ b/src/ModelAPI/ModelAPI_Tools.cpp @@ -36,7 +36,7 @@ std::shared_ptr shape(const ResultPtr& theResult) return theResult->shape(); } -bool findVariable(const std::string& theName, double& outValue) +bool findVariable(const std::string& theName, double& outValue, ResultParameterPtr& theParam) { SessionPtr aSession = ModelAPI_Session::get(); std::list aDocList; @@ -48,10 +48,10 @@ bool findVariable(const std::string& theName, double& outValue) } for(std::list::const_iterator it = aDocList.begin(); it != aDocList.end(); ++it) { ObjectPtr aParamObj = (*it)->objectByName(ModelAPI_ResultParameter::group(), theName); - ResultParameterPtr aParam = std::dynamic_pointer_cast(aParamObj); - if(!aParam.get()) + theParam = std::dynamic_pointer_cast(aParamObj); + if(!theParam.get()) continue; - AttributeDoublePtr aValueAttribute = aParam->data()->real(ModelAPI_ResultParameter::VALUE()); + AttributeDoublePtr aValueAttribute = theParam->data()->real(ModelAPI_ResultParameter::VALUE()); outValue = aValueAttribute->value(); return true; }