From: nds Date: Mon, 31 Aug 2015 10:23:31 +0000 (+0300) Subject: Issue #854 Fillet angle modification redisplay the presentation twice X-Git-Tag: V_1.4.0_beta4~188 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=84b6d6a78890a33feca4470553e09ef861b5f10d;p=modules%2Fshaper.git Issue #854 Fillet angle modification redisplay the presentation twice EVENT_OBJECT_TO_REDISPLAY is not necessary because it is sent by model when it processes EVENT_OBJECT_UPDATED. In order to avoid the bug, the current decision is to do not redraw OCC viewer until the message is processed. --- diff --git a/src/ModuleBase/ModuleBase_ModelWidget.cpp b/src/ModuleBase/ModuleBase_ModelWidget.cpp index 63d8095fc..c47c42ca6 100644 --- a/src/ModuleBase/ModuleBase_ModelWidget.cpp +++ b/src/ModuleBase/ModuleBase_ModelWidget.cpp @@ -150,9 +150,20 @@ bool ModuleBase_ModelWidget::restoreValue() void ModuleBase_ModelWidget::updateObject(ObjectPtr theObj) { + // the viewer update should be blocked in order to avoid the temporary feature content + // when the solver processes the feature, the redisplay message can be flushed + // what caused the display in the viewer preliminary states of object + // e.g. fillet feature, angle value change + std::shared_ptr aMsg = std::shared_ptr( + new Events_Message(Events_Loop::eventByName(EVENT_UPDATE_VIEWER_BLOCKED))); + Events_Loop::loop()->send(aMsg); + Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED)); - static Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY); - ModelAPI_EventCreator::get()->sendUpdated(theObj, anEvent); + + // the viewer update should be unblocked + aMsg = std::shared_ptr( + new Events_Message(Events_Loop::eventByName(EVENT_UPDATE_VIEWER_UNBLOCKED))); + Events_Loop::loop()->send(aMsg); } void ModuleBase_ModelWidget::moveObject(ObjectPtr theObj)