Salome HOME
Meet the coding style (line length <= 100)
[modules/shaper.git] / src / ModelAPI / ModelAPI_Events.cpp
index 9284b18af686d2fd0833ee1dffd5d7402cf7b5b9..1224934af03dc1a729cc9db9b496cb37f583b679 100644 (file)
@@ -10,6 +10,8 @@
 #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)
@@ -166,8 +168,8 @@ bool ModelAPI_ParameterEvalMessage::isProcessed()
   return myIsProcessed;
 }
 
-const std::list<std::shared_ptr<ModelAPI_ResultParameter> >& 
-  ModelAPI_ParameterEvalMessage::params() const 
+const std::list<std::shared_ptr<ModelAPI_ResultParameter> >&
+  ModelAPI_ParameterEvalMessage::params() const
 {
   return myParamsList;
 }
@@ -328,3 +330,43 @@ const std::set<ObjectPtr>& ModelAPI_SolverFailedMessage::objects() const
   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;
+}