+
+// ===== 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));
+#ifdef DEBUG_OBJECT_MOVED_MESSAGE
+ std::cout << "setOriginalPosition: " << myOriginalPosition->x() << ", "
+ << myOriginalPosition->y() << std::endl;
+#endif
+}
+
+void ModelAPI_ObjectMovedMessage::setOriginalPosition(
+ const std::shared_ptr<GeomAPI_Pnt2d>& thePoint)
+{
+ myOriginalPosition = thePoint;
+#ifdef DEBUG_OBJECT_MOVED_MESSAGE
+ std::cout << "setOriginalPosition: " << myOriginalPosition->x() << ", "
+ << myOriginalPosition->y() << std::endl;
+#endif
+}
+
+void ModelAPI_ObjectMovedMessage::setCurrentPosition(double theX, double theY)
+{
+ myCurrentPosition = std::shared_ptr<GeomAPI_Pnt2d>(new GeomAPI_Pnt2d(theX, theY));
+#ifdef DEBUG_OBJECT_MOVED_MESSAGE
+ std::cout << "setCurrentPosition: " << myCurrentPosition->x() << ", " << myCurrentPosition->y()
+ << ", myCurrentPosition - myOriginalPosition: "
+ << myCurrentPosition->x() - myOriginalPosition->x() << ", "
+ << myCurrentPosition->y() - myOriginalPosition->y() << std::endl;
+#endif
+}
+
+void ModelAPI_ObjectMovedMessage::setCurrentPosition(
+ const std::shared_ptr<GeomAPI_Pnt2d>& thePoint)
+{
+ myCurrentPosition = thePoint;
+#ifdef DEBUG_OBJECT_MOVED_MESSAGE
+ std::cout << "setCurrentPosition: " << myCurrentPosition->x() << ", " << myCurrentPosition->y()
+ << ", myCurrentPosition - myOriginalPosition: "
+ << myCurrentPosition->x() - myOriginalPosition->x() << ", "
+ << myCurrentPosition->y() - myOriginalPosition->y() << std::endl;
+#endif
+}