]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for bug 10417: Sweep doesn't work
authorjfa <jfa@opencascade.com>
Mon, 31 Oct 2005 16:11:39 +0000 (16:11 +0000)
committerjfa <jfa@opencascade.com>
Mon, 31 Oct 2005 16:11:39 +0000 (16:11 +0000)
src/VISUGUI/VisuGUI.cxx

index cacfe29052dfd50a15baa45070ac373468f4c138..cf12d6058afbbb582af0c7cfeb86f37bb6e83b82 100644 (file)
@@ -2420,20 +2420,20 @@ void VisuGUI::Sweep() {
   }
 
   QApplication::setOverrideCursor( Qt::waitCursor );
-  try{
-    for (int j=0 ; j<aCycles; j++) {
-      for (int i=0 ; i<=aSteps; i++) {
+  for (int j = 0; j < aCycles; j++) {
+    for (int i = 0; i <= aSteps; i++) {
+      try {
        float aPercents = float(i)/aSteps;
        aPrsObject->SetMapScale(aPercents);
        aPrsObject->UpdateActor(aActor);
        vf->getRW()->getRenderWindow()->Render();
        usleep(aTemp);
+      } catch (std::exception& exc) {
+        INFOS("Follow exception was occured :\n" << exc.what());
+      } catch (...) {
+        INFOS("Unknown exception was occured!");
       }
     }
-  }catch(std::exception& exc){
-    INFOS("Follow exception was occured :\n"<<exc.what());
-  }catch(...){
-    INFOS("Unknown exception was occured!");
   }
   QApplication::restoreOverrideCursor();
 }
@@ -4030,9 +4030,16 @@ VISU_Actor* VisuGUI::UpdateViewer(VISU::Prs3d_i* thePrs, bool theDispOnly){
       if(aPrs == NULL) continue;
       if (thePrs == aPrs) {
        aResActor = anVISUActor->GetParent();
-       thePrs->UpdateActor(aResActor);
-       aResActor->VisibilityOn();
-        
+        try {
+          thePrs->UpdateActor(aResActor);
+          aResActor->VisibilityOn();
+        } catch (std::runtime_error& ex) {
+          aResActor->VisibilityOff();
+          INFOS(ex.what());
+          QAD_MessageBox::warn1(QAD_Application::getDesktop(), tr("VISU_WARNING"),
+                                tr("ERR_CANT_CREATE_ACTOR") + ": " + tr(ex.what()),
+                                tr("VISU_BUT_OK"));
+        }
       } else if (theDispOnly) {
        anVISUActor->GetParent()->VisibilityOff();
       } else {