From 7ddeb6ccecf39bd3e871ac4408288022c75d6a00 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 12 Apr 2007 09:40:05 +0000 Subject: [PATCH] PAL13330( When mesh generation does not success, trace where ) check if ViewWindow is not deleted along with a study --- src/SMESHGUI/SMESHGUI_ComputeDlg.cxx | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx index 8c1c0299c..09b2fae92 100644 --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx @@ -44,6 +44,7 @@ #include "SALOMEDSClient_SObject.hxx" #include "SALOME_ListIO.hxx" #include "SVTK_ViewWindow.h" +#include "SVTK_ViewModel.h" #include "SalomeApp_Tools.h" #include "SalomeApp_Application.h" #include "SUIT_ResourceMgr.h" @@ -124,12 +125,14 @@ namespace SMESH { // ----------------------------------------------------------------------- void DeleteActors() { - TActorIterator actorIt = actorIterator(); - while ( actorIt.more() ) - if (VTKViewer_Actor* anActor = actorIt.next()) { - myViewWindow->RemoveActor( anActor ); - //anActor->Delete(); - } + if ( hasViewWindow() ) { + TActorIterator actorIt = actorIterator(); + while ( actorIt.more() ) + if (VTKViewer_Actor* anActor = actorIt.next()) { + myViewWindow->RemoveActor( anActor ); + //anActor->Delete(); + } + } myIndexToShape.Clear(); myActors.clear(); myShownActors.clear(); @@ -271,6 +274,16 @@ namespace SMESH { double deflection = Max( aXmax-aXmin , Max ( aYmax-aYmin , aZmax-aZmin)) * 0.01 *4; BRepMesh_IncrementalMesh MESH(shape,deflection); } + // ----------------------------------------------------------------------- + bool hasViewWindow() const + { + if ( !myViewWindow ) return false; + + if ( SalomeApp_Application* anApp = SMESHGUI::GetSMESHGUI()->getApp() ) + return FindVtkViewWindow( anApp->getViewManager(SVTK_Viewer::Type(), false ), + myViewWindow ); + return false; + } }; // ========================================================================================= -- 2.39.2