2 * ParametersPlugin_EvalListener.h
4 * Created on: Apr 28, 2015
8 #ifndef SRC_PARAMETERSPLUGIN_EVALLISTENER_H_
9 #define SRC_PARAMETERSPLUGIN_EVALLISTENER_H_
11 #include <ParametersPlugin.h>
12 #include <Events_Loop.h>
14 class ModelAPI_Attribute;
15 class ModelAPI_Document;
16 class ModelAPI_ResultParameter;
17 class ParametersPlugin_Parameter;
18 class ParametersPlugin_PyInterp;
20 class ParametersPlugin_EvalListener : public Events_Listener
23 PARAMETERSPLUGIN_EXPORT ParametersPlugin_EvalListener();
24 PARAMETERSPLUGIN_EXPORT virtual ~ParametersPlugin_EvalListener();
26 PARAMETERSPLUGIN_EXPORT virtual void processEvent(const std::shared_ptr<Events_Message>& theMessage);
29 double evaluate(const std::string& theExpression, std::string& theError,
30 const std::shared_ptr<ModelAPI_Document>& theDocument);
32 void processEvaluationEvent(const std::shared_ptr<Events_Message>& theMessage);
33 void processObjectRenamedEvent(const std::shared_ptr<Events_Message>& theMessage);
34 void processReplaceParameterEvent(const std::shared_ptr<Events_Message>& theMessage);
36 std::string renameInPythonExpression(const std::string& theExpression,
37 const std::string& theOldName,
38 const std::string& theNewName);
39 void renameInParameter(std::shared_ptr<ParametersPlugin_Parameter> theParameter,
40 const std::string& theOldName,
41 const std::string& theNewName);
42 void renameInAttribute(std::shared_ptr<ModelAPI_Attribute> theAttribute,
43 const std::string& theOldName,
44 const std::string& theNewName);
45 void renameInDependants(std::shared_ptr<ModelAPI_ResultParameter> theResultParameter,
46 const std::string& theOldName,
47 const std::string& theNewName);
50 std::shared_ptr<ParametersPlugin_PyInterp> myInterp;
53 #endif /* SRC_PARAMETERSPLUGIN_PARAMETERSPLUGIN_EVALLISTENER_H_ */