]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/GeomData/GeomData_Point2D.cpp
Salome HOME
Sending events on attributes data changed
[modules/shaper.git] / src / GeomData / GeomData_Point2D.cpp
index 3e576226bfb1c07a61153c4232ab24524a653ab3..bbf3e55fb578d27d567beb57409ce69f80ff9457 100644 (file)
@@ -3,13 +3,20 @@
 // Author:      Mikhail PONIKAROV
 
 #include "GeomData_Point2D.h"
+#include "Model_Events.h"
+#include <Events_Loop.h>
 
 using namespace std;
 
 void GeomData_Point2D::setValue(const double theX, const double theY)
 {
-  myCoords->SetValue(0, theX);
-  myCoords->SetValue(1, theY);
+  if (myCoords->Value(0) != theX || myCoords->Value(1) != theY) {
+    myCoords->SetValue(0, theX);
+    myCoords->SetValue(1, theY);
+    static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_UPDATED);
+    Model_FeatureUpdatedMessage aMsg(feature(), anEvent);
+    Events_Loop::loop()->send(aMsg);
+  }
 }
 
 double GeomData_Point2D::x() const