]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for Bug12054
authorapo <apo@opencascade.com>
Thu, 30 Mar 2006 07:55:49 +0000 (07:55 +0000)
committerapo <apo@opencascade.com>
Thu, 30 Mar 2006 07:55:49 +0000 (07:55 +0000)
   Gauss Viewer can?t build a presentation or crash on animation (MKO)

src/VISUGUI/VisuGUI_TimeAnimation.cxx
src/VISU_I/VISU_TimeAnimation.cxx

index e22eca4216f49e640e611cc89869931d909686fc..0faf02f3bfa18ea58e18ee12baab64d30cd15f60 100644 (file)
@@ -738,6 +738,15 @@ void SetupDlg::onPreferencesDlg()
   if (aData.myPrs.empty())
     myAnimator->generatePresentations(myFieldLst->currentItem());
 
+  if(!aData.myNbFrames || !aData.myPrs[0]){
+    QApplication::restoreOverrideCursor();
+    SUIT_MessageBox::warn1(this,
+                           tr("ERROR"),
+                           VisuGUI_TimeAnimationDlg::tr("MSG_NO_ANIMATIONDATA"),
+                           tr("&OK"));
+    return;
+  }
+
   int aType = myComboId2TypeId[myTypeCombo->currentItem()];
   switch (aType) {
   case TSCALARMAP_ITEM: //Scalar Map
index fa5befe56612e2e7a1d87990af36ba8a806ffc4e..ce6025333ff8b6dbe346862a62200e78bc52bdc3 100644 (file)
@@ -42,6 +42,7 @@
 
 #include "SALOMEDSClient_AttributeComment.hxx"
 #include "SALOMEDSClient_AttributeName.hxx"
+#include "CASCatch.hxx"
 
 #include <qpixmap.h>
 #include <qimage.h>
@@ -194,13 +195,27 @@ namespace
       QString aFieldName = VISU::Storable::FindValue(aTimeMap,"myFieldName");
       int aTimeStampId = VISU::Storable::FindValue(aTimeMap,"myTimeStampId").toInt();
       
+      bool anIsCreated = false;
       TPrs3d* aPresent = new TPrs3d(theResult, false);
-      aPresent->Create(aMeshName.latin1(), anEntity,
-                      aFieldName.latin1(), aTimeStampId);
-      theData.myPrs[aFrameId++] = aPresent;
-
-      aMin = std::min(aPresent->GetMin(), aMin);
-      aMax = std::max(aPresent->GetMax(), aMax);
+      CASCatch_TRY{       
+       try{
+         if(aPresent->Create(aMeshName.latin1(),anEntity,aFieldName.latin1(),aTimeStampId)){
+           anIsCreated = true;
+           theData.myPrs[aFrameId++] = aPresent;
+           aMin = std::min(aPresent->GetMin(), aMin);
+           aMax = std::max(aPresent->GetMax(), aMax);
+         }
+       }catch(std::exception& exc){
+         INFOS("Follow exception was occured :\n"<<exc.what());
+       }catch(...){
+         INFOS("Unknown exception was occured!");
+       }
+      }CASCatch_CATCH(Standard_Failure) {
+       Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+       INFOS("Follow signal was occured :\n"<<aFail->GetMessageString());
+      }
+      if(!anIsCreated)
+       aPresent->_remove_ref();
     }
     theData.myNbFrames = aFrameId;