From 0f0f782e6842e80120cdd0f4add2bb55720163e1 Mon Sep 17 00:00:00 2001 From: mpv Date: Wed, 2 Jul 2014 11:27:01 +0400 Subject: [PATCH] Added the redisplay event --- src/Model/Model_Update.cpp | 5 +++++ src/ModelAPI/ModelAPI_Events.h | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index e1f52a9bb..6c8bd6431 100644 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -42,6 +42,9 @@ void Model_Update::processEvent(const Events_Message* theMessage) } } myUpdated.clear(); + // flush + static Events_ID EVENT_DISP = Events_Loop::loop()->eventByName(EVENT_FEATURE_TO_REDISPLAY); + Events_Loop::loop()->flush(EVENT_DISP); } bool Model_Update::updateFeature(boost::shared_ptr theFeature) @@ -77,6 +80,8 @@ bool Model_Update::updateFeature(boost::shared_ptr theFeature) bool anExecute = aMustbeUpdated || myInitial.find(theFeature) != myInitial.end(); if (anExecute) { theFeature->execute(); + static Events_ID EVENT_DISP = Events_Loop::loop()->eventByName(EVENT_FEATURE_TO_REDISPLAY); + ModelAPI_EventCreator::get()->sendUpdated(theFeature, EVENT_DISP); } myUpdated[theFeature] = anExecute; return anExecute; diff --git a/src/ModelAPI/ModelAPI_Events.h b/src/ModelAPI/ModelAPI_Events.h index 5ab3df1dc..c65d717e8 100644 --- a/src/ModelAPI/ModelAPI_Events.h +++ b/src/ModelAPI/ModelAPI_Events.h @@ -15,14 +15,16 @@ class ModelAPI_Document; -/// Event ID that feature is created (comes with Model_FeatureUpdatedMessage) +/// Event ID that feature is created (comes with ModelAPI_FeatureUpdatedMessage) static const char * EVENT_FEATURE_CREATED = "FeatureCreated"; /// Event ID that data of feature is updated (comes with Model_FeatureUpdatedMessage) static const char * EVENT_FEATURE_UPDATED = "FeatureUpdated"; /// Event ID that data of feature is deleted (comes with Model_FeatureDeletedMessage) static const char * EVENT_FEATURE_DELETED = "FeatureDeleted"; -/// Event ID that data of feature is updated (comes with Model_FeaturesMovedMessage) +/// Event ID that data of feature is updated (comes with ModelAPI_FeatureUpdatedMessage) static const char * EVENT_FEATURE_MOVED = "FeaturesMoved"; +/// Event ID that visualization must be redisplayed (comes with ModelAPI_FeatureUpdatedMessage) +static const char * EVENT_FEATURE_TO_REDISPLAY = "FeaturesToRedisplay"; /// Message that feature was changed (used for Object Browser update): moved, updated and deleted class ModelAPI_FeatureUpdatedMessage : public Events_MessageGroup { -- 2.39.2