From 84b6d6a78890a33feca4470553e09ef861b5f10d Mon Sep 17 00:00:00 2001 From: nds Date: Mon, 31 Aug 2015 13:23:31 +0300 Subject: [PATCH] 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. --- src/ModuleBase/ModuleBase_ModelWidget.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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) -- 2.39.2