]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #554: Clear visualization of objects if viewer had been deleted
authorvsv <vitaly.smetannikov@opencascade.com>
Mon, 25 May 2015 15:00:12 +0000 (18:00 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Mon, 25 May 2015 15:00:12 +0000 (18:00 +0300)
src/NewGeom/NewGeom_Module.cpp

index 88d61de5bbb4f0f32c2a65d8bc39d4ebfba2445d..6ccc5b4bb2858ca1edc54fbf5d29923de13caf94 100644 (file)
@@ -205,9 +205,11 @@ bool NewGeom_Module::activateModule(SUIT_Study* theStudy)
         }
       }
       if (!aFound) {
-        aDisp->erase(aObj, false);
+        aObj->setDisplayed(false);
+        //aDisp->erase(aObj, false);
       }
     }
+    Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
   }
 
   return isDone;
@@ -269,7 +271,11 @@ void NewGeom_Module::onViewManagerRemoved(SUIT_ViewManager* theMgr)
     if (theMgr->getType() == OCCViewer_Viewer::Type()) {
       OCCViewer_Viewer* aViewer = static_cast<OCCViewer_Viewer*>(theMgr->getViewModel());
       if (mySelector->viewer() == aViewer) {
-        myWorkshop->displayer()->eraseAll(false);
+        XGUI_Displayer* aDisp = myWorkshop->displayer();
+        QObjectPtrList aObjects = aDisp->displayedObjects();
+        foreach(ObjectPtr aObj, aObjects)
+          aObj->setDisplayed(false);
+        Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
         myProxyViewer->setSelector(0);
         delete mySelector;
         mySelector = 0;