From 0c7fb3827d582a1180975be5eb752d679fc0ff44 Mon Sep 17 00:00:00 2001 From: akl Date: Fri, 14 Sep 2007 15:53:19 +0000 Subject: [PATCH] NPAL16752 (SIGSEGV on cutpanes, cutlines, plot3D on cronoshexa.med file): Add catching of user's exceptions during 3d presentation creation. --- src/VISUGUI/VisuGUI_Prs3dTools.h | 38 ++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/src/VISUGUI/VisuGUI_Prs3dTools.h b/src/VISUGUI/VisuGUI_Prs3dTools.h index 7557683f..fd1fa76b 100644 --- a/src/VISUGUI/VisuGUI_Prs3dTools.h +++ b/src/VISUGUI/VisuGUI_Prs3dTools.h @@ -120,20 +120,34 @@ namespace VISU const char* theFieldName, int theTimeId) { - VISU::Result_var aResult; - if (CheckResult(theModule,theTimeStamp,aResult)){ - QApplication::setOverrideCursor(Qt::waitCursor); - TPrs3d_i* aPrs3d = - GetVisuGen(theModule)->template CreatePrs3d - (aResult,theMeshName,theEntity,theFieldName,theTimeId); - QApplication::restoreOverrideCursor(); - if(aPrs3d) + try{ + VISU::Result_var aResult; + if (CheckResult(theModule,theTimeStamp,aResult)) { + QApplication::setOverrideCursor(Qt::waitCursor); + TPrs3d_i* aPrs3d = + GetVisuGen(theModule)->template CreatePrs3d + (aResult,theMeshName,theEntity,theFieldName,theTimeId); + QApplication::restoreOverrideCursor(); return aPrs3d; + } + SUIT_MessageBox::warn1(GetDesktop(theModule), + QObject::tr("WRN_VISU"), + QObject::tr("ERR_CANT_BUILD_PRESENTATION"), + QObject::tr("BUT_OK") ); + return NULL; + }catch(SALOME::SALOME_Exception &S_ex) { + QApplication::restoreOverrideCursor(); + SUIT_MessageBox::warn1(GetDesktop(theModule), + QObject::tr("WRN_VISU"), + QString(S_ex.details.text), + QObject::tr("BUT_OK") ); + }catch(...) { + QApplication::restoreOverrideCursor(); + SUIT_MessageBox::warn1(GetDesktop(theModule), + QObject::tr("WRN_VISU"), + QObject::tr("ERR_CANT_BUILD_PRESENTATION"), + QObject::tr("BUT_OK") ); } - SUIT_MessageBox::warn1(GetDesktop(theModule), - QObject::tr("WRN_VISU"), - QObject::tr("ERR_CANT_BUILD_PRESENTATION"), - QObject::tr("BUT_OK") ); return NULL; } -- 2.39.2