From: vsv Date: Fri, 23 Aug 2019 12:08:44 +0000 (+0300) Subject: Issue #2983: Synchronize visibility state of objects X-Git-Tag: VEDF2019Lot4~28 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3b30e2faca6dfd9d37a49e67b40e6cacf571c934;p=modules%2Fshaper.git Issue #2983: Synchronize visibility state of objects --- diff --git a/src/SHAPERGUI/SHAPERGUI.cpp b/src/SHAPERGUI/SHAPERGUI.cpp index 2ff3a2887..5cc4874a1 100644 --- a/src/SHAPERGUI/SHAPERGUI.cpp +++ b/src/SHAPERGUI/SHAPERGUI.cpp @@ -40,6 +40,8 @@ #include #include +#include + #include #include #include @@ -447,8 +449,16 @@ void SHAPERGUI::onViewManagerRemoved(SUIT_ViewManager* theMgr) if (mySelector->viewer() == aViewer) { XGUI_Displayer* aDisp = myWorkshop->displayer(); QObjectPtrList aObjects = aDisp->displayedObjects(); - foreach(ObjectPtr aObj, aObjects) + ResultPtr aRes; + foreach(ObjectPtr aObj, aObjects) { aObj->setDisplayed(false); + aRes = std::dynamic_pointer_cast(aObj); + if (aRes.get()) { + while (aRes = ModelAPI_Tools::bodyOwner(aRes)) { + aRes->setDisplayed(false); + } + } + } Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY)); myProxyViewer->setSelector(0); delete mySelector;