]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2983: Synchronize visibility state of objects
authorvsv <vsv@opencascade.com>
Fri, 23 Aug 2019 12:08:44 +0000 (15:08 +0300)
committervsv <vsv@opencascade.com>
Fri, 23 Aug 2019 12:08:44 +0000 (15:08 +0300)
src/SHAPERGUI/SHAPERGUI.cpp

index 2ff3a28874415bd6772648bd2e833123fcd47a71..5cc4874a14a60268c139d9376e280b386394a069 100644 (file)
@@ -40,6 +40,8 @@
 #include <ModuleBase_ActionInfo.h>
 #include <ModuleBase_IModule.h>
 
+#include <ModelAPI_Tools.h>
+
 #include <LightApp_Application.h>
 #include <LightApp_SelectionMgr.h>
 #include <LightApp_OCCSelector.h>
@@ -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<ModelAPI_Result>(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;