#include <ModelAPI.h>
#include <ModelAPI_Events.h>
+#include <GeomAPI_Pnt2d.h>
+
ModelAPI_ObjectUpdatedMessage::ModelAPI_ObjectUpdatedMessage(const Events_ID theID,
const void* theSender)
: Events_MessageGroup(theID, theSender)
}
ModelAPI_OrderUpdatedMessage::ModelAPI_OrderUpdatedMessage(const Events_ID theID,
- const void* theSender)
+ const void* theSender)
: Events_Message(theID, theSender)
{
}
-ModelAPI_DocumentCreatedMessage::ModelAPI_DocumentCreatedMessage(const Events_ID theID,
- const void* theSender)
+ModelAPI_DocumentCreatedMessage::ModelAPI_DocumentCreatedMessage(
+ const Events_ID theID, const void* theSender)
: Events_Message(theID, theSender)
-{
-
-}
+{}
ModelAPI_DocumentCreatedMessage::~ModelAPI_DocumentCreatedMessage()
-{
-
-}
+{}
DocumentPtr ModelAPI_DocumentCreatedMessage::document() const
{
myDocument = theDocument;
}
-ModelAPI_AttributeEvalMessage::ModelAPI_AttributeEvalMessage(const Events_ID theID,
- const void* theSender)
+ModelAPI_AttributeEvalMessage::ModelAPI_AttributeEvalMessage(
+ const Events_ID theID, const void* theSender)
: Events_Message(theID, theSender)
+{}
+
+ModelAPI_AttributeEvalMessage::~ModelAPI_AttributeEvalMessage()
+{}
+
+AttributePtr ModelAPI_AttributeEvalMessage::attribute() const
{
+ return myAttribute;
+}
+void ModelAPI_AttributeEvalMessage::setAttribute(AttributePtr theAttribute)
+{
+ myAttribute = theAttribute;
}
-ModelAPI_AttributeEvalMessage::~ModelAPI_AttributeEvalMessage()
+ModelAPI_ParameterEvalMessage::ModelAPI_ParameterEvalMessage(
+ const Events_ID theID, const void* theSender)
+ : Events_Message(theID, theSender), myIsProcessed(false)
+{}
+
+ModelAPI_ParameterEvalMessage::~ModelAPI_ParameterEvalMessage()
+{}
+
+FeaturePtr ModelAPI_ParameterEvalMessage::parameter() const
{
+ return myParam;
+}
+void ModelAPI_ParameterEvalMessage::setParameter(FeaturePtr theParam)
+{
+ myParam = theParam;
}
-AttributePtr ModelAPI_AttributeEvalMessage::attribute() const
+void ModelAPI_ParameterEvalMessage::setResults(
+ const std::list<std::shared_ptr<ModelAPI_ResultParameter> >& theParamsList,
+ const double theResult, const std::string& theError)
{
- return myAttribute;
+ myParamsList = theParamsList;
+ myResult = theResult;
+ myError = theError;
+ myIsProcessed = true;
+}
+
+bool ModelAPI_ParameterEvalMessage::isProcessed()
+{
+ return myIsProcessed;
+}
+
+const std::list<std::shared_ptr<ModelAPI_ResultParameter> >&
+ ModelAPI_ParameterEvalMessage::params() const
+{
+ return myParamsList;
+}
+
+const double& ModelAPI_ParameterEvalMessage::result() const
+{
+ return myResult;
+}
+
+const std::string& ModelAPI_ParameterEvalMessage::error() const
+{
+ return myError;
+}
+
+ModelAPI_ComputePositionsMessage::ModelAPI_ComputePositionsMessage(
+ const Events_ID theID, const void* theSender)
+ : Events_Message(theID, theSender)
+{}
+
+ModelAPI_ComputePositionsMessage::~ModelAPI_ComputePositionsMessage()
+{}
+
+const std::string& ModelAPI_ComputePositionsMessage::expression() const
+{
+ return myExpression;
+}
+
+const std::string& ModelAPI_ComputePositionsMessage::parameter() const
+{
+ return myParamName;
+}
+
+void ModelAPI_ComputePositionsMessage::set(
+ const std::string& theExpression, const std::string& theParameter)
+{
+ myExpression = theExpression;
+ myParamName = theParameter;
}
-void ModelAPI_AttributeEvalMessage::setAttribute(AttributePtr theDocument)
+void ModelAPI_ComputePositionsMessage::setPositions(
+ const std::list<std::pair<int, int> >& thePositions)
{
- myAttribute = theDocument;
+ myPositions = thePositions;
}
+const std::list<std::pair<int, int> >& ModelAPI_ComputePositionsMessage::positions() const
+{
+ return myPositions;
+}
+
+
ModelAPI_ObjectRenamedMessage::ModelAPI_ObjectRenamedMessage(const Events_ID theID,
const void* theSender)
: Events_Message(theID, theSender)
// ===== ModelAPI_SolverFailedMessage =====
-ModelAPI_SolverFailedMessage::ModelAPI_SolverFailedMessage(const Events_ID theID, const void* theSender)
+ModelAPI_SolverFailedMessage::ModelAPI_SolverFailedMessage(const Events_ID theID,
+ const void* theSender)
: Events_Message(theID, theSender),
myDOF(-1)
{
return myObjects;
}
+
+// ===== ModelAPI_ObjectMovedMessage =====
+ModelAPI_ObjectMovedMessage::ModelAPI_ObjectMovedMessage(const void* theSender)
+ : Events_Message(Events_Loop::eventByName(EVENT_OBJECT_MOVED), theSender)
+{
+}
+
+void ModelAPI_ObjectMovedMessage::setMovedObject(const ObjectPtr& theMovedObject)
+{
+ myMovedObject = theMovedObject;
+ myMovedAttribute = AttributePtr();
+}
+
+void ModelAPI_ObjectMovedMessage::setMovedAttribute(const AttributePtr& theMovedAttribute)
+{
+ myMovedAttribute = theMovedAttribute;
+ myMovedObject = ObjectPtr();
+}
+
+void ModelAPI_ObjectMovedMessage::setOriginalPosition(double theX, double theY)
+{
+ myOriginalPosition = std::shared_ptr<GeomAPI_Pnt2d>(new GeomAPI_Pnt2d(theX, theY));
+}
+
+void ModelAPI_ObjectMovedMessage::setOriginalPosition(
+ const std::shared_ptr<GeomAPI_Pnt2d>& thePoint)
+{
+ myOriginalPosition = thePoint;
+}
+
+void ModelAPI_ObjectMovedMessage::setCurrentPosition(double theX, double theY)
+{
+ myCurrentPosition = std::shared_ptr<GeomAPI_Pnt2d>(new GeomAPI_Pnt2d(theX, theY));
+}
+
+void ModelAPI_ObjectMovedMessage::setCurrentPosition(
+ const std::shared_ptr<GeomAPI_Pnt2d>& thePoint)
+{
+ myCurrentPosition = thePoint;
+}