]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
NPAL16752 (SIGSEGV on cutpanes, cutlines, plot3D on cronoshexa.med file):
authorakl <akl@opencascade.com>
Fri, 14 Sep 2007 15:53:19 +0000 (15:53 +0000)
committerakl <akl@opencascade.com>
Fri, 14 Sep 2007 15:53:19 +0000 (15:53 +0000)
Add catching of user's exceptions during 3d presentation creation.

src/VISUGUI/VisuGUI_Prs3dTools.h

index 7557683f6024b313ac664bb633029bb7e1f0f849..fd1fa76b3cf4d49bf9771f2a1f7385d0dd21297c 100644 (file)
@@ -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<TPrs3d_i>
-       (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<TPrs3d_i>
+         (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;
   }