]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/Model/Model_AttributeDocRef.cpp
Salome HOME
Sending events on attributes data changed
[modules/shaper.git] / src / Model / Model_AttributeDocRef.cpp
index 9df9c22190611371b1cd80357fc9de7b3de3fa14..82492e2d6dcac4b2850f46a12f67012823677d4e 100644 (file)
@@ -4,12 +4,21 @@
 
 #include "Model_AttributeDocRef.h"
 #include "Model_Application.h"
+#include "Model_Events.h"
+#include <Events_Loop.h>
 
 using namespace std;
 
 void Model_AttributeDocRef::setValue(boost::shared_ptr<ModelAPI_Document> theDoc)
 {
-  myComment->Set(TCollection_ExtendedString(theDoc->id().c_str()));
+  TCollection_ExtendedString aNewID(theDoc->id().c_str());
+  if (myComment->Get() != aNewID) {
+    myComment->Set(TCollection_ExtendedString(theDoc->id().c_str()));
+
+    static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_UPDATED);
+    Model_FeatureUpdatedMessage aMsg(feature(), anEvent);
+    Events_Loop::loop()->send(aMsg);
+  }
 }
 
 boost::shared_ptr<ModelAPI_Document> Model_AttributeDocRef::value()