]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Model is updated: event is generated by the document on feature creation
authormpv <mikhail.ponikarov@opencascade.com>
Fri, 4 Apr 2014 10:55:07 +0000 (14:55 +0400)
committermpv <mikhail.ponikarov@opencascade.com>
Fri, 4 Apr 2014 10:55:07 +0000 (14:55 +0400)
src/Model/Model_Document.cxx
src/ModelAPI/ModelAPI_Document.h

index 3aea0ff6ecbba55a254edcc0bab07a5c64e65c7b..d435a01277fec031419267bc3c0c494bb74928ad 100644 (file)
@@ -8,6 +8,7 @@
 #include <Model_Application.h>
 #include <Model_PluginManager.h>
 #include <Model_Iterator.h>
+#include <Event_Loop.h>
 
 #include <TDataStd_Integer.hxx>
 #include <TDataStd_Comment.hxx>
@@ -163,6 +164,12 @@ void Model_Document::addFeature(
   setUniqueName(theFeature, theGroupID);
   theFeature->initAttributes();
   TDataStd_Comment::Set(anObjLab, theFeature->getKind().c_str());
+
+  // event: model is updated
+  static Event_ID anEvent = Event_Loop::eventByName(EVENT_MODEL_UPDATED);
+  Event_Message anUpdateMsg(anEvent, this);
+  Event_Loop::loop()->send(anUpdateMsg);
+
 }
 
 std::shared_ptr<ModelAPI_Feature> Model_Document::feature(TDF_Label& theLabel)
index e40e9f5b592dd45fe091fe378ad721a45cd160c6..b06dd889997d872e9ebdaaa491e68860bae476a7 100644 (file)
@@ -20,6 +20,10 @@ static const std::string CONSTRUCTIONS_GROUP = "Construction";
 /// Group of parts
 static const std::string PARTS_GROUP = "Parts";
 
+/// Event ID that model is updated
+static const char* EVENT_MODEL_UPDATED = "ModelUpdated";
+
+
 /**\class Model_Document
  * \ingroup DataModel
  * \brief Document for internal data structure of any object storage. Corresponds to the SALOME study.