From 86583cd5648c0db788809624bebc41a8a6a4b333 Mon Sep 17 00:00:00 2001 From: nds Date: Fri, 15 Dec 2017 14:47:20 +0300 Subject: [PATCH] Issue #2362 Show dimensional and geometrical constraints is not activated --- src/XGUI/XGUI_Displayer.cpp | 11 +++++++++++ src/XGUI/XGUI_Workshop.cpp | 9 +++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index 7028e4a35..cb1ea4bcd 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -99,6 +99,8 @@ const int MOUSE_SENSITIVITY_IN_PIXEL = 10; #define CLEAR_OUTDATED_SELECTION_BEFORE_REDISPLAY +//#define DEBUG_VIEWER_BLOCKED_COUNT + //************************************************************** void displayedObjects(const Handle(AIS_InteractiveContext)& theAIS, AIS_ListOfInteractive& theList) { @@ -614,6 +616,10 @@ bool XGUI_Displayer::enableUpdateViewer(const bool isEnabled) else myViewerBlockedRecursiveCount++; +#ifdef DEBUG_VIEWER_BLOCKED_COUNT + std::cout << "myViewerBlockedRecursiveCount = " << myViewerBlockedRecursiveCount << std::endl; +#endif + if (myNeedUpdate && isUpdateEnabled()) { updateViewer(); myNeedUpdate = false; @@ -631,6 +637,11 @@ bool XGUI_Displayer::isUpdateEnabled() const void XGUI_Displayer::updateViewer() const { Handle(AIS_InteractiveContext) aContext = AISContext(); + +#ifdef DEBUG_VIEWER_BLOCKED_COUNT + std::cout << "updateViewer: " << (myViewerBlockedRecursiveCount == 0 ? " done" : " later") << std::endl; +#endif + if (!aContext.IsNull() && isUpdateEnabled()) { //myWorkshop->viewer()->Zfitall(); aContext->UpdateCurrentViewer(); diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 6cb816382..796c70af2 100755 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -1050,7 +1050,10 @@ void XGUI_Workshop::processUndoRedo(const ModuleBase_ActionType theActionType, i if (aOpMgr->canStopOperation(aOpMgr->currentOperation())) aOpMgr->abortOperation(aOpMgr->currentOperation()); else + { + myDisplayer->enableUpdateViewer(isUpdateEnabled); return; + } } objectBrowser()->treeView()->setCurrentIndex(QModelIndex()); std::list anActionList = theActionType == ActionUndo ? aMgr->undoList() @@ -1070,10 +1073,8 @@ void XGUI_Workshop::processUndoRedo(const ModuleBase_ActionType theActionType, i updateCommandStatus(); // unblock the viewer update functionality and make update on purpose - if (theActionType == ActionRedo) { - myDisplayer->enableUpdateViewer(isUpdateEnabled); - myDisplayer->updateViewer(); - } + myDisplayer->enableUpdateViewer(isUpdateEnabled); + myDisplayer->updateViewer(); } //****************************************************** -- 2.39.2