From: akl Date: Fri, 14 Sep 2007 15:53:19 +0000 (+0000) Subject: NPAL16752 (SIGSEGV on cutpanes, cutlines, plot3D on cronoshexa.med file): X-Git-Tag: T_24092007~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0c7fb3827d582a1180975be5eb752d679fc0ff44;p=modules%2Fvisu.git NPAL16752 (SIGSEGV on cutpanes, cutlines, plot3D on cronoshexa.med file): Add catching of user's exceptions during 3d presentation creation. --- 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; }