+ } else if (theMessage->eventID() == ModelAPI_BuildEvalMessage::eventId()) {
+ std::shared_ptr<ModelAPI_BuildEvalMessage> aMsg =
+ std::dynamic_pointer_cast<ModelAPI_BuildEvalMessage>(theMessage);
+ FeaturePtr aParam = aMsg->parameter();
+
+ AttributeStringPtr anVariableAttr = aParam->string(BuildPlugin_Interpolation::VARIABLE_ID());
+ std::wstring anVar = anVariableAttr->isUValue() ?
+ Locale::Convert::toWString(anVariableAttr->valueU()) :
+ Locale::Convert::toWString(anVariableAttr->value());
+ AttributeTablesPtr anValueAttr = aParam->tables(BuildPlugin_Interpolation::VALUE_ID());
+ std::string anError;
+
+ std::list<std::shared_ptr<ModelAPI_ResultParameter> > aParamsList;
+
+ AttributeStringPtr anExprAttr;
+ ModelAPI_AttributeTables::Value aVal;
+ bool anIsFirstTime = true;
+ anExprAttr = aParam->string(BuildPlugin_Interpolation::XT_ID());
+ std::wstring anExpX = anExprAttr->isUValue() ?
+ Locale::Convert::toWString(anExprAttr->valueU()) :
+ Locale::Convert::toWString(anExprAttr->value());
+ anExpX.erase(std::remove(anExpX.begin(), anExpX.end(), ' '), anExpX.end());
+ anExprAttr = aParam->string(BuildPlugin_Interpolation::YT_ID());
+ std::wstring anExpY = anExprAttr->isUValue() ?
+ Locale::Convert::toWString(anExprAttr->valueU()) :
+ Locale::Convert::toWString(anExprAttr->value());
+ anExpY.erase(std::remove(anExpY.begin(), anExpY.end(), ' '), anExpY.end());
+ anExprAttr = aParam->string(BuildPlugin_Interpolation::ZT_ID());
+ std::wstring anExpZ = anExprAttr->isUValue() ?
+ Locale::Convert::toWString(anExprAttr->valueU()) :
+ Locale::Convert::toWString(anExprAttr->value());
+ anExpZ.erase(std::remove(anExpZ.begin(),anExpZ.end(), ' '), anExpZ.end());
+
+ for (int step =0; step < anValueAttr->rows(); step++) {
+ aVal.myDouble = evaluate(anVar,
+ anValueAttr->value(step,0).myDouble,
+ aParam,
+ anExpX,
+ anError,
+ aParamsList,
+ anIsFirstTime);
+ if (!anError.empty()) break;
+ anValueAttr->setValue(aVal,step,1);
+ aVal.myDouble = evaluate(anVar,
+ anValueAttr->value(step,0).myDouble,
+ aParam,
+ anExpY,
+ anError,
+ aParamsList,
+ anIsFirstTime);
+ if (!anError.empty()) break;
+ anValueAttr->setValue(aVal,step,2);
+ aVal.myDouble = evaluate(anVar,
+ anValueAttr->value(step,0).myDouble,
+ aParam,
+ anExpZ,
+ anError,
+ aParamsList,
+ anIsFirstTime);
+ if (!anError.empty()) break;
+ anValueAttr->setValue(aVal,step,3);
+ if (anIsFirstTime)
+ anIsFirstTime = false;
+ }
+ aMsg->setResults(aParamsList, anError);
+ }
+ else if (theMessage->eventID() == ModelAPI_ImportParametersMessage::eventId())
+ {
+ std::shared_ptr<ModelAPI_ImportParametersMessage> aMsg =
+ std::dynamic_pointer_cast<ModelAPI_ImportParametersMessage>(theMessage);
+ std::string anImportScript("from salome.shaper import model;");
+ std::string aDocScript("doc = model.activeDocument();");
+ std::string anParamImpScript("model.importParameters(doc, \"");
+ std::string aPath = aMsg->filename();
+ myInterp->runString(anImportScript + aDocScript + anParamImpScript + aPath + "\")");