From: vsv Date: Thu, 28 May 2015 14:13:42 +0000 (+0300) Subject: Flash Delete event on remove of construction X-Git-Tag: V_1.2.0~27 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e036187cf228e59c09a37910bc2479074f8e6f42;p=modules%2Fshaper.git Flash Delete event on remove of construction --- diff --git a/src/ModelAPI/ModelAPI_Feature.cpp b/src/ModelAPI/ModelAPI_Feature.cpp index e6c784426..4627bb503 100644 --- a/src/ModelAPI/ModelAPI_Feature.cpp +++ b/src/ModelAPI/ModelAPI_Feature.cpp @@ -90,7 +90,6 @@ void ModelAPI_Feature::eraseResultFromList(const std::shared_ptrdata()->erase(); myResults.erase(aResIter); - static Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_DELETED); static Events_Loop* aLoop = Events_Loop::loop(); static Events_ID EVENT_DISP = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY); static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get(); @@ -106,8 +105,11 @@ void ModelAPI_Feature::removeResults(const int theSinceIndex, const bool theFlus std::list >::iterator aResIter = myResults.begin(); for(int anIndex = 0; anIndex < theSinceIndex && aResIter != myResults.end(); anIndex++) aResIter++; + + std::string aGroup; std::list >::iterator aNextIter = aResIter; while( aNextIter != myResults.end()) { + aGroup = (*aNextIter)->groupName(); // remove previously erased results: to enable later if needed only actual (of history change) if (theSinceIndex == 0 && (*aNextIter)->isDisabled()) { aNextIter = myResults.erase(aNextIter); @@ -116,11 +118,13 @@ void ModelAPI_Feature::removeResults(const int theSinceIndex, const bool theFlus aNextIter++; } } - if (theFlush) { + if (!aGroup.empty() && theFlush) { // flush visualisation changes static Events_Loop* aLoop = Events_Loop::loop(); static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY); aLoop->flush(aRedispEvent); + static Events_ID aDelEvent = aLoop->eventByName(EVENT_OBJECT_DELETED); + aLoop->flush(aDelEvent); } }