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 ParametersPlugin_Parameter;
17 class ParametersPlugin_PyInterp;
19 class ParametersPlugin_EvalListener : public Events_Listener
22 PARAMETERSPLUGIN_EXPORT ParametersPlugin_EvalListener();
23 PARAMETERSPLUGIN_EXPORT virtual ~ParametersPlugin_EvalListener();
25 PARAMETERSPLUGIN_EXPORT virtual void processEvent(const std::shared_ptr<Events_Message>& theMessage);
28 double evaluate(const std::string& theExpression, std::string& theError,
29 const std::shared_ptr<ModelAPI_Document>& theDocument);
31 void processEvaluationEvent(const std::shared_ptr<Events_Message>& theMessage);
32 void processObjectRenamedEvent(const std::shared_ptr<Events_Message>& theMessage);
34 std::string renameInPythonExpression(const std::string& theExpression,
35 const std::string& theOldName,
36 const std::string& theNewName);
37 void renameInParameter(std::shared_ptr<ParametersPlugin_Parameter> theParameter,
38 const std::string& theOldName,
39 const std::string& theNewName);
40 void renameInAttribute(std::shared_ptr<ModelAPI_Attribute> theAttribute,
41 const std::string& theOldName,
42 const std::string& theNewName);
45 std::shared_ptr<ParametersPlugin_PyInterp> myInterp;
48 #endif /* SRC_PARAMETERSPLUGIN_PARAMETERSPLUGIN_EVALLISTENER_H_ */