]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/GeomData/GeomData_Dir.cpp
Salome HOME
Sending events on attributes data changed
[modules/shaper.git] / src / GeomData / GeomData_Dir.cpp
index 22dac3fe4df1cb7c186986feeb655bfda658bd1a..5090a06267f562b7ccc9bb141e6c9b829bf7f05e 100644 (file)
@@ -5,14 +5,21 @@
 #include "GeomData_Dir.h"
 #include "GeomAPI_Dir.h"
 #include <gp_Dir.hxx>
+#include "Model_Events.h"
+#include <Events_Loop.h>
 
 using namespace std;
 
 void GeomData_Dir::setValue(const double theX, const double theY, const double theZ)
 {
-  myCoords->SetValue(0, theX);
-  myCoords->SetValue(1, theY);
-  myCoords->SetValue(2, theZ);
+  if (myCoords->Value(0) != theX || myCoords->Value(1) != theY || myCoords->Value(2) != theZ) {
+    myCoords->SetValue(0, theX);
+    myCoords->SetValue(1, theY);
+    myCoords->SetValue(2, theZ);
+    static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_UPDATED);
+    Model_FeatureUpdatedMessage aMsg(feature(), anEvent);
+    Events_Loop::loop()->send(aMsg);
+  }
 }
 
 double GeomData_Dir::x() const