+class ModelAPI_ImportParametersMessage : public Events_Message
+{
+ std::string myFilename; ///< filename where where parameters are stored
+ std::string myError; ///< error of processing, empty if there is no error
+
+public:
+ /// Static. Returns EventID of the message.
+ MODELAPI_EXPORT static Events_ID& eventId()
+ {
+ static const char* MY_PARAMETER_EVALUATION_EVENT_ID("ImportParametersMessage");
+ static Events_ID anId = Events_Loop::eventByName(MY_PARAMETER_EVALUATION_EVENT_ID);
+ return anId;
+ }
+
+ /// Useful method that creates and sends the event.
+ /// Returns the message, processed, with the resulting fields filled.
+ MODELAPI_EXPORT static std::shared_ptr<ModelAPI_ImportParametersMessage>
+ send(std::string theParameter, const void* theSender)
+ {
+ std::shared_ptr<ModelAPI_ImportParametersMessage> aMessage =
+ std::shared_ptr<ModelAPI_ImportParametersMessage>(
+ new ModelAPI_ImportParametersMessage(eventId(), theSender));
+ aMessage->setFilename(theParameter);
+ Events_Loop::loop()->send(aMessage);
+ return aMessage;
+ }
+
+ /// Creates an empty message
+ MODELAPI_EXPORT ModelAPI_ImportParametersMessage(const Events_ID theID,
+ const void* theSender = 0);
+ /// The virtual destructor
+ MODELAPI_EXPORT virtual ~ModelAPI_ImportParametersMessage();
+
+ /// Returns a filename stored in the message
+ MODELAPI_EXPORT std::string filename() const;
+ /// Sets a filename to the message
+ MODELAPI_EXPORT void setFilename(std::string theFilename);
+};
+
+class ModelAPI_BuildEvalMessage : public Events_Message
+{
+ FeaturePtr myParam; ///< parameters that should be evaluated
+ bool myIsProcessed; ///< true if results were set
+ std::string myError; ///< error of processing, empty if there is no error
+ /// result of processing, list of parameters in expression found
+ std::list<std::shared_ptr<ModelAPI_ResultParameter> > myParamsList;
+
+ public:
+ /// Static. Returns EventID of the message.
+ MODELAPI_EXPORT static Events_ID& eventId()
+ {
+ static const char * MY_BUILD_EVALUATION_EVENT_ID("BuildEvaluationRequest");
+ static Events_ID anId = Events_Loop::eventByName(MY_BUILD_EVALUATION_EVENT_ID);
+ return anId;
+ }
+
+ /// Useful method that creates and sends the event.
+ /// Returns the message, processed, with the resulting fields filled.
+ MODELAPI_EXPORT static std::shared_ptr<ModelAPI_BuildEvalMessage>
+ send(FeaturePtr theParameter, const void* theSender)
+ {
+ std::shared_ptr<ModelAPI_BuildEvalMessage> aMessage =
+ std::shared_ptr<ModelAPI_BuildEvalMessage>(
+ new ModelAPI_BuildEvalMessage(eventId(), theSender));
+ aMessage->setParameter(theParameter);
+ Events_Loop::loop()->send(aMessage);
+ return aMessage;
+ }
+
+ /// Creates an empty message
+ MODELAPI_EXPORT ModelAPI_BuildEvalMessage(const Events_ID theID, const void* theSender = 0);
+ /// The virtual destructor
+ MODELAPI_EXPORT virtual ~ModelAPI_BuildEvalMessage();
+
+ /// Returns a parameter stored in the message
+ MODELAPI_EXPORT FeaturePtr parameter() const;
+ /// Sets a parameter to the message
+ MODELAPI_EXPORT void setParameter(FeaturePtr theParam);
+ /// Sets the results of processing
+ MODELAPI_EXPORT void setResults(
+ const std::list<std::shared_ptr<ModelAPI_ResultParameter> >& theParamsList,
+ const std::string& theError);
+ /// Returns the results of processing: list of parameters found in the expression
+ MODELAPI_EXPORT const std::list<std::shared_ptr<ModelAPI_ResultParameter> >& params() const;
+ /// Returns true if the expression is processed
+ MODELAPI_EXPORT bool isProcessed();
+
+ /// Returns the interpreter error (empty if no error)
+ MODELAPI_EXPORT const std::string& error() const;
+};