Salome HOME
To improve exception handling
authorapo <apo@opencascade.com>
Thu, 28 Jul 2005 13:40:46 +0000 (13:40 +0000)
committerapo <apo@opencascade.com>
Thu, 28 Jul 2005 13:40:46 +0000 (13:40 +0000)
src/VISUGUI/VISU_msg_en.po
src/VISUGUI/VisuGUI_Tools.cxx
src/VISU_I/VISU_ScalarMap_i.cc

index 1f32ea2609ba998a8b82ef96f704e3a8079cc992..627949eae0f4d0c8359b9bd52dd5ca2e9b8366a2 100644 (file)
@@ -351,7 +351,7 @@ msgstr "Arrange Actors"
 msgid "VisuGUI::ERR_ERROR_IN_THE_FILE"
 msgstr "Error in the file"
 
-msgid "VisuGUI::ERR_CANT_CREATE_ACTOR"
+msgid "ERR_CANT_CREATE_ACTOR"
 msgstr "Can't create actor for this presentation"
 
 msgid "VisuGUI::ERR_ACTIVATE_VIEW3D"
index daa945005f0dd9545af44921e38371bf84f8443d..7e85c5958db19da78bc9abf06cf1b803fcc1a04e 100644 (file)
@@ -415,7 +415,6 @@ namespace VISU
       }
     }
     thePrs->RemoveFromStudy();
-    //theModule->updateObjBrowser(); //update Object browser
   }
 
   void
@@ -615,8 +614,14 @@ namespace VISU
       return aActor;
     if(SVTK_ViewWindow* aView = GetViewWindow(theModule)){
       QApplication::setOverrideCursor( Qt::waitCursor );
-      if(aActor = thePrs->CreateActor()){
-        aView->AddActor(aActor);
+      try{
+       if(aActor = thePrs->CreateActor())
+         aView->AddActor(aActor);
+      }catch(std::exception& exc){
+       SUIT_MessageBox::warn1(GetDesktop(theModule),
+                              QObject::tr("WRN_VISU"),
+                              QObject::tr("ERR_CANT_CREATE_ACTOR"),
+                              QObject::tr("BUT_OK"));
       }
       QApplication::restoreOverrideCursor();
     }
@@ -957,7 +962,6 @@ namespace VISU
               }
             }
           }
-          //theModule->updateObjBrowser();
           PlotContainer( theModule, pContainer, VISU::eDisplay );
         }
       }
index 6964bef767a45a6de10672f5407fc3d6c5217617..7f8fcf5cbadb4c297bf4b59e150c4715602ca0b0 100644 (file)
@@ -478,9 +478,9 @@ VISU_Actor* VISU::ScalarMap_i::CreateActor(const Handle(SALOME_InteractiveObject
     anActor->SetBarVisibility(true);
     anActor->SetRepresentation(2);
     UpdateActor(anActor);
-  }catch(...) {
+  }catch(...){
     anActor->Delete();
-    throw std::runtime_error("CreateActor error");
+    throw;
   }
   return anActor;
 }