#include <ParametersPlugin.h>
#include <Events_Loop.h>
+class ModelAPI_Attribute;
+class ModelAPI_Document;
+class ParametersPlugin_Parameter;
class ParametersPlugin_PyInterp;
-class PARAMETERSPLUGIN_EXPORT ParametersPlugin_EvalListener : public Events_Listener
+class ParametersPlugin_EvalListener : public Events_Listener
{
public:
- ParametersPlugin_EvalListener();
- virtual ~ParametersPlugin_EvalListener();
+ PARAMETERSPLUGIN_EXPORT ParametersPlugin_EvalListener();
+ PARAMETERSPLUGIN_EXPORT virtual ~ParametersPlugin_EvalListener();
- virtual void processEvent(const std::shared_ptr<Events_Message>& theMessage);
+ PARAMETERSPLUGIN_EXPORT virtual void processEvent(const std::shared_ptr<Events_Message>& theMessage);
protected:
- double evaluate(const std::string& theExpression,
- std::string& theError) ;
+ double evaluate(const std::string& theExpression, std::string& theError,
+ const std::shared_ptr<ModelAPI_Document>& theDocument);
+
+ void processEvaluationEvent(const std::shared_ptr<Events_Message>& theMessage);
+ void processObjectRenamedEvent(const std::shared_ptr<Events_Message>& theMessage);
+
+ std::string renameInPythonExpression(const std::string& theExpression,
+ const std::string& theOldName,
+ const std::string& theNewName);
+ void renameInParameter(std::shared_ptr<ParametersPlugin_Parameter> theParameter,
+ const std::string& theOldName,
+ const std::string& theNewName);
+ void renameInAttribute(std::shared_ptr<ModelAPI_Attribute> theAttribute,
+ const std::string& theOldName,
+ const std::string& theNewName);
private:
std::shared_ptr<ParametersPlugin_PyInterp> myInterp;