]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for Bug PAL12638:
authorenk <enk@opencascade.com>
Mon, 19 Jun 2006 09:28:18 +0000 (09:28 +0000)
committerenk <enk@opencascade.com>
Mon, 19 Jun 2006 09:28:18 +0000 (09:28 +0000)
SIGSEGV 'segmentation violation' detected.

src/VISUGUI/VisuGUI_CutPlanesDlg.cxx
src/VISUGUI/VisuGUI_Plot3DDlg.cxx
src/VISUGUI/VisuGUI_Prs3dTools.h
src/VISUGUI/VisuGUI_ScalarBarDlg.cxx

index 53647c489a0e94477937d81b2975f825a83d204c..78bfc6ac0543ff3fbde19ab324a8229cd358d838 100644 (file)
@@ -421,7 +421,9 @@ void VisuGUI_CutPlanesPane::deletePlanes()
 {
   if (myPreviewActor == 0) return;
   vtkRenderer* aRend       = myPreviewActor->GetRenderer();
-  if(aRend)
+  vtkRenderWindow* aWnd = aRend->GetRenderWindow();
+
+  if(aRend && aWnd)
     myPreviewActor->RemoveFromRender(aRend);
 //  Bug IPAL11962: preview is still in the viewer, if viewer not active.
 //   if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
index 04d78a4e3bd765b2a3778f760129c5b36055303c..2ad6cf220b91cf36bb9cc3b8897ab971af63434b 100644 (file)
@@ -362,7 +362,12 @@ void VisuGUI_Plot3DPane::onPrsType(int id)
 //=======================================================================
 void VisuGUI_Plot3DPane::updatePreview()
 {
-  if (myInitFromPrs || !myPrs || !myViewWindow)
+  if(myPreviewActor){
+    vtkRenderer* aRend       = myPreviewActor->GetRenderer();
+    vtkRenderWindow* aWnd = aRend->GetRenderWindow();
+    if (!aWnd) return;
+  }
+ if (myInitFromPrs || !myPrs || !myViewWindow)
     return;
   bool fitall = false;
   if (PreviewChkB->isChecked()) // place preview plane
@@ -489,14 +494,18 @@ int VisuGUI_Plot3DPane::storeToPrsObject(VISU::Plot3D_i* thePrs)
 //=======================================================================
 bool VisuGUI_Plot3DPane::check()
 {
-  if (myPreviewActor && myViewWindow) // erase preview
-  {
+  if(!myPreviewActor) return true;
+  
+  SVTK_ViewWindow* aView;
+  vtkRenderer* aRend    = myPreviewActor->GetRenderer();
+  vtkRenderWindow* aWnd = aRend->GetRenderWindow();
+  if(aRend && aWnd){
     myPreviewActor->SetVisibility(false);
     myViewWindow->RemoveActor(myPreviewActor);
     myPreviewActor->Delete();
     myPreviewActor = 0;
   }
-
+    
   return true;
 }
 
index 9050d5fdec95d8b4f42c47b41b125c283dbcbdba..62b46d5156dfd0095de629a048dcca274e0d6ead 100644 (file)
@@ -194,12 +194,13 @@ namespace VISU
              delete aDlg;
            } else {
              DeletePrs3d(theModule,aPrs3d,theIO);
+             QApplication::restoreOverrideCursor();
              delete aDlg;
              return false;
            }
        }
       }
-
+      aViewWindow = GetViewWindow<TViewer>(theModule);
       // Display created presentation.
       if (aViewWindow) {
        PublishInView(theModule, aPrs3d, aViewWindow, /*highlight = */true);
index affe39ed92ff9756f25b928cd25dddaf8f6c52e2..6131085e80305758583e33a342011d2ac57abea3 100644 (file)
@@ -746,7 +746,8 @@ void VisuGUI_ScalarBarPane::deleteScalarBar()
   
   if (myPreviewActor == 0) return;
   vtkRenderer* aRend       = myPreviewActor->GetRenderer();
-  if(aRend)
+  vtkRenderWindow* aWnd = aRend->GetRenderWindow();
+  if(aRend && aWnd)
     myPreviewActor->RemoveFromRender(aRend);
   myPreviewActor->GetScalarBar()->VisibilityOff();
   myPreviewActor->Delete();