From 68348d55f163db4bf58eabab1eed48b6126a4d5e Mon Sep 17 00:00:00 2001 From: vsv Date: Thu, 5 Sep 2019 15:52:12 +0300 Subject: [PATCH] Issue #2983: Synchronize visibility state on activation of SHAPER module --- src/SHAPERGUI/SHAPERGUI.cpp | 2 +- src/XGUI/XGUI_Workshop.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/SHAPERGUI/SHAPERGUI.cpp b/src/SHAPERGUI/SHAPERGUI.cpp index 5cc4874a1..5b69d3593 100644 --- a/src/SHAPERGUI/SHAPERGUI.cpp +++ b/src/SHAPERGUI/SHAPERGUI.cpp @@ -285,7 +285,7 @@ bool SHAPERGUI::activateModule(SUIT_Study* theStudy) ViewManagerList OCCViewManagers; application()->viewManagers(OCCViewer_Viewer::Type(), OCCViewManagers); if (OCCViewManagers.size() > 0) { - mySelector = createSelector(OCCViewManagers.first()); + onViewManagerAdded(OCCViewManagers.first()); } } // it should be performed after the selector creation in order to have AISContext diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 319b9fa48..3fadef034 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -2793,8 +2793,12 @@ void XGUI_Workshop::synchronizeResultTree(const ResultBodyPtr& theRes, bool theU if (aRes.get()) synchronizeResultTree(aRes, theUpdateViewer); } - else - myDisplayer->display(theRes, theUpdateViewer); + else { + if (theRes->isDisplayed()) + myDisplayer->display(theRes, theUpdateViewer); + else + myDisplayer->erase(theRes, theUpdateViewer); + } } #endif -- 2.39.2