]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Crash on TimeStamps.med / pression - IsoSurfaces
authorapo <apo@opencascade.com>
Wed, 23 May 2007 10:49:36 +0000 (10:49 +0000)
committerapo <apo@opencascade.com>
Wed, 23 May 2007 10:49:36 +0000 (10:49 +0000)
src/VISU_I/VISU_ColoredPrs3dCache_i.cc

index d68bebc1a2501196cd7452209ea1e7e1785d0c97..2485fe3ba50e3befa4430895abf64bbac2c92b10 100644 (file)
@@ -619,41 +619,40 @@ VISU::ColoredPrs3dCache_i
                       VISU::View3D_ptr theView3D)
 {
   if(MYDEBUG) cout << "VISU::ColoredPrs3dCache_i::UpdateLastVisitedPrs" << endl;
-  TPrs3dPtr aLastVisitedPrs3d = GetLastVisitedPrs(theHolder);
-  TLastVisitedPrsList& aLastVisitedPrsList = GetLastVisitedPrsList(theHolder);
   TPrs3dPtr aPrs3d;
-  bool anIsCheckPossible = GetMemoryMode() == VISU::ColoredPrs3dCache::LIMITED;
-  std::string aHolderEntry = theHolder->GetEntry();
-  VISU::VISUType aPrsType = theHolder->GetPrsType();
-  CORBA::Float aRequiredMemory = 0.0;
-  if(aPrs3d = FindPrsByInput(aLastVisitedPrsList, theInput)){
-    aLastVisitedPrsList.push_front(aPrs3d);
-    if(MYDEBUG) cout << "FindPrsByInput " << aPrs3d << endl;
-  }else if(anIsCheckPossible && IsPossible(aPrsType, theInput, aRequiredMemory, aHolderEntry)){
-    if( aRequiredMemory > 1.0 / VTK_LARGE_FLOAT )
-      ClearMemory(aRequiredMemory, aHolderEntry);
-    aPrs3d = CreatePrs(aPrsType, theInput, theHolder);
-    if(MYDEBUG) cout << "Created " << aPrs3d << endl;
-  }else{
-    aPrs3d = aLastVisitedPrsList.back();
-    aPrs3d->SetResultObject(theInput.myResult);
-    aPrs3d->SetMeshName(theInput.myMeshName);
-    aPrs3d->SetEntity(theInput.myEntity);
-    aPrs3d->SetFieldName(theInput.myFieldName);
-    aPrs3d->SetTimeStampNumber(theInput.myTimeStampNumber);
-    aLastVisitedPrsList.pop_back();
-    aLastVisitedPrsList.push_front(aPrs3d);
-    if(MYDEBUG) cout << "Move only " << aPrs3d << endl;
-  }
-  //if(MYDEBUG) PrintCache();
-
-  try {
+  try{
+    TPrs3dPtr aLastVisitedPrs3d = GetLastVisitedPrs(theHolder);
+    TLastVisitedPrsList& aLastVisitedPrsList = GetLastVisitedPrsList(theHolder);
+    bool anIsCheckPossible = GetMemoryMode() == VISU::ColoredPrs3dCache::LIMITED;
+    std::string aHolderEntry = theHolder->GetEntry();
+    VISU::VISUType aPrsType = theHolder->GetPrsType();
+    CORBA::Float aRequiredMemory = 0.0;
+    if(aPrs3d = FindPrsByInput(aLastVisitedPrsList, theInput)){
+      aLastVisitedPrsList.push_front(aPrs3d);
+      if(MYDEBUG) cout << "FindPrsByInput " << aPrs3d << endl;
+    }else if(anIsCheckPossible && IsPossible(aPrsType, theInput, aRequiredMemory, aHolderEntry)){
+      if( aRequiredMemory > 1.0 / VTK_LARGE_FLOAT )
+       ClearMemory(aRequiredMemory, aHolderEntry);
+      aPrs3d = CreatePrs(aPrsType, theInput, theHolder);
+      if(MYDEBUG) cout << "Created " << aPrs3d << endl;
+    }else{
+      aPrs3d = aLastVisitedPrsList.back();
+      aPrs3d->SetResultObject(theInput.myResult);
+      aPrs3d->SetMeshName(theInput.myMeshName);
+      aPrs3d->SetEntity(theInput.myEntity);
+      aPrs3d->SetFieldName(theInput.myFieldName);
+      aPrs3d->SetTimeStampNumber(theInput.myTimeStampNumber);
+      aLastVisitedPrsList.pop_back();
+      aLastVisitedPrsList.push_front(aPrs3d);
+      if(MYDEBUG) cout << "Move only " << aPrs3d << endl;
+    }
+    //if(MYDEBUG) PrintCache();
+    
     aPrs3d->SameAs(thePrs);
-  } catch (...) {
-    return false;
-  }
-  aPrs3d->UpdateActors();
-  if(!CORBA::is_nil(theView3D)){
+    aPrs3d->UpdateActors();
+    if(CORBA::is_nil(theView3D))
+      return false;
+
     PortableServer::ServantBase_var aServant = GetServant(theView3D);
     if(VISU::View3D_i* aView3d = dynamic_cast<VISU::View3D_i*>(aServant.in())){
       if(SUIT_ViewWindow* aView = aView3d->GetViewWindow()){
@@ -700,6 +699,10 @@ VISU::ColoredPrs3dCache_i
        }
       }
     }
+  }catch(std::exception& exc){
+    INFOS("Follow exception was occured :\n"<<exc.what());
+  }catch(...){
+    INFOS("Unknown exception was occured!");
   }
 
   return false;