]> 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 15:49:30 +0000 (15:49 +0000)
committerjfa <jfa@opencascade.com>
Mon, 31 Oct 2005 15:49:30 +0000 (15:49 +0000)
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI_Tools.cxx

index 52de37fb81941da51bd7e2fadc2ec77caafe3c0c..90791a23ff8d690dd2b2707d45e22ba1092c374c 100644 (file)
@@ -1577,20 +1577,20 @@ OnSweep()
 
   // 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);
         vw->getRenderWindow()->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();
 }
index 72f28a92a471ace5a0a134e96b0c6a940cc9e536..d18611d1b45e74a678cc538770fb4a76f94c4f61 100644 (file)
@@ -717,9 +717,16 @@ namespace VISU
         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());
+            SUIT_MessageBox::warn1(GetDesktop(theModule), QObject::tr("WRN_VISU"),
+                                   QObject::tr("ERR_CANT_CREATE_ACTOR") + ": " + QObject::tr(ex.what()),
+                                   QObject::tr("BUT_OK"));
+          }
         } else if (theDispOnly) {
           anVISUActor->GetParent()->VisibilityOff();
         } else {