]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Bug IPAL11962:
authorenk <enk@opencascade.com>
Fri, 28 Apr 2006 05:45:24 +0000 (05:45 +0000)
committerenk <enk@opencascade.com>
Fri, 28 Apr 2006 05:45:24 +0000 (05:45 +0000)
Fix for - the preview is still in the viewer.

src/VISUGUI/VisuGUI_CutLinesDlg.cxx

index c1834f3f23469b4f814ed99af8260552602ca1bb..0cf1557fd06d9a35e6d8cfd60f21a702b1f005c4 100644 (file)
@@ -365,10 +365,20 @@ void VisuGUI_CutLinesDlg::createPlanes()
 void VisuGUI_CutLinesDlg::deletePlanes()
 {
   if (myPreviewActor == 0) return;
-  if (SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>()){
-    aView->RemoveActor(myPreviewActor);
-    aView->RemoveActor(myPreviewActorGlyphs);
-  }
+  SVTK_ViewWindow* aView;
+  vtkRenderer* aRend       = myPreviewActor->GetRenderer();
+  vtkRenderer* aRendGlyphs = myPreviewActorGlyphs->GetRenderer();
+  if(aRend)
+    myPreviewActor->RemoveFromRender(aRend);
+  if(aRendGlyphs)
+    myPreviewActorGlyphs->RemoveFromRender(aRendGlyphs);
+
+//   Bug IPAL11962: preview is still in the viewer, if viewer not active.
+//   if (aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>()){
+//     aView->RemoveActor(myPreviewActor);
+//     aView->RemoveActor(myPreviewActorGlyphs);
+//   } 
+
   myPreviewActor->Delete();
   myPreviewActorGlyphs->Delete();
   myPreviewActor = 0;