From: mpv Date: Fri, 4 Apr 2014 10:55:07 +0000 (+0400) Subject: Model is updated: event is generated by the document on feature creation X-Git-Tag: V_0.1~31^2~5^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6309c58e87b2b0a2f190c133650be6c83269fb51;p=modules%2Fshaper.git Model is updated: event is generated by the document on feature creation --- diff --git a/src/Model/Model_Document.cxx b/src/Model/Model_Document.cxx index 3aea0ff6e..d435a0127 100644 --- a/src/Model/Model_Document.cxx +++ b/src/Model/Model_Document.cxx @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -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 Model_Document::feature(TDF_Label& theLabel) diff --git a/src/ModelAPI/ModelAPI_Document.h b/src/ModelAPI/ModelAPI_Document.h index e40e9f5b5..b06dd8899 100644 --- a/src/ModelAPI/ModelAPI_Document.h +++ b/src/ModelAPI/ModelAPI_Document.h @@ -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.