]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for Bug IPAL11670
authorapo <apo@opencascade.com>
Fri, 3 Mar 2006 12:37:41 +0000 (12:37 +0000)
committerapo <apo@opencascade.com>
Fri, 3 Mar 2006 12:37:41 +0000 (12:37 +0000)
   CRASH after trying to import "polygones.med" and "recall_bord.med".

src/CONVERTOR/Makefile.in
src/CONVERTOR/VISU_MedConvertor.cxx
src/VISU_I/VISU_Gen_i.cc

index 36847c3406014ec5ac14ac039d1a961ab8d38408..b3bf4147137e221337642361636ea97c7e894ee5 100644 (file)
@@ -57,13 +57,21 @@ LIB_SRC = \
 BIN = VISUConvertor
 BIN_SRC = 
 
-CPPFLAGS+= -ftemplate-depth-32 $(VTK_INCLUDES) $(HDF5_INCLUDES) $(QT_INCLUDES) \
+CPPFLAGS+= -ftemplate-depth-32 \
+       $(VTK_INCLUDES) \
+       $(HDF5_INCLUDES) \
+       $(QT_INCLUDES) \
+       $(OCC_INCLUDES) \
+       $(OCC_CXXFLAGS) \
        -I${KERNEL_ROOT_DIR}/include/salome \
        -I${MED_ROOT_DIR}/include/salome \
        -I${GUI_ROOT_DIR}/include/salome \
        $(BOOST_CPPFLAGS)
 
-LDFLAGS+= $(VTK_LIBS) $(QT_LIBS) \
+LDFLAGS+= $(VTK_LIBS) \
+       $(QT_LIBS) \
+       $(CAS_KERNEL) \
+       $(CAS_MATH) \
        $(BOOST_LIBS) -lboost_thread${BOOST_LIBSUFFIX} \
        -L${MED_ROOT_DIR}/lib/salome -lMEDWrapper \
        -L${GUI_ROOT_DIR}/lib/salome -lVTKViewer
index 12178e79cce7cec61dc3b7a2818ddef4d85fef5e..80b6976b4b8b7eebe4002991fdf7a130b082968f 100644 (file)
@@ -34,8 +34,7 @@
 #include "MED_GaussUtils.hxx"
 #include "MED_Utilities.hxx"
 
-#include <boost/thread/thread.hpp>
-#include <boost/bind.hpp>
+#include "CASCatch_CatchSignals.hxx"
 
 #include <vtkCellType.h>
 
@@ -1195,80 +1194,85 @@ VISU_MedConvertor
            INITMSG(MYDEBUG,"- iTimeStamp = "<<iTimeStamp<<endl);
            
 #ifndef _DEXCEPT_
-           try{
+           CASCatch_TRY{ 
+             try{
 #endif
-             MED::PTimeStampInfo aTimeStampInfo = aMed->GetPTimeStampInfo(aFieldInfo,
-                                                                          aMEntity,
-                                                                          aGeom2Size,
-                                                                          iTimeStamp);
-             
-             MED::PTimeStampVal aTimeStampVal = aMed->GetPTimeStampVal(aTimeStampInfo,
-                                                                       aMKey2Profile,
-                                                                       aKey2Gauss);
-             
-             const MED::TGeom2Gauss& aGeom2Gauss = aTimeStampInfo->GetGeom2Gauss();
-             
-             const MED::TTimeStampVal& aTimeStampValRef = aTimeStampVal;
-             
-             const MED::TGeom2Value& aGeom2Value = aTimeStampValRef.myGeom2Value;
-             MED::TGeom2Value::const_iterator anIter = aGeom2Value.begin();
-             for(; anIter != aGeom2Value.end(); anIter++){
-               const MED::TMeshValue& aMMeshValue = anIter->second;
-               MED::EGeometrieElement aMGeom = anIter->first;
+               MED::PTimeStampInfo aTimeStampInfo = aMed->GetPTimeStampInfo(aFieldInfo,
+                                                                            aMEntity,
+                                                                            aGeom2Size,
+                                                                            iTimeStamp);
                
-               TInt aNbElem = aMMeshValue.myNbElem;
-               TInt aNbGauss = aMMeshValue.myNbGauss;
+               MED::PTimeStampVal aTimeStampVal = aMed->GetPTimeStampVal(aTimeStampInfo,
+                                                                         aMKey2Profile,
+                                                                         aKey2Gauss);
                
-               MED::TGeom2Gauss::const_iterator aGaussIter = aGeom2Gauss.find(aMGeom);
-               if(aGaussIter == aGeom2Gauss.end())
-                 aNbGauss = 1;
+               const MED::TGeom2Gauss& aGeom2Gauss = aTimeStampInfo->GetGeom2Gauss();
                
-               INITMSG(MYDEBUG,
-                       "- aMGeom = "<<aMGeom<<
-                       "; aNbElem = "<<aNbElem<<
-                       "; aNbGauss = "<<aNbGauss<<
-                       endl);
+               const MED::TTimeStampVal& aTimeStampValRef = aTimeStampVal;
                
-               // To calculate min/max per components
-               for(TInt iElem = 0; iElem < aNbElem; iElem++){
-                 MED::TCValueSliceArr aMValueSliceArr = aMMeshValue.GetCompValueSliceArr(iElem);
-                 for(TInt iComp = 0; iComp < aNbComp; iComp++){
-                   const MED::TCValueSlice& aMValueSlice = aMValueSliceArr[iComp];
-                   TMinMax& aMinMax = aMinMaxArr[iComp+1];
-                   float& aMin = aMinMax.first;
-                   float& aMax = aMinMax.second;
-                   for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
-                     const float& aVal = aMValueSlice[iGauss];
-                     aMin = min(aMin,aVal);
-                     aMax = max(aMax,aVal);
+               const MED::TGeom2Value& aGeom2Value = aTimeStampValRef.myGeom2Value;
+               MED::TGeom2Value::const_iterator anIter = aGeom2Value.begin();
+               for(; anIter != aGeom2Value.end(); anIter++){
+                 const MED::TMeshValue& aMMeshValue = anIter->second;
+                 MED::EGeometrieElement aMGeom = anIter->first;
+                 
+                 TInt aNbElem = aMMeshValue.myNbElem;
+                 TInt aNbGauss = aMMeshValue.myNbGauss;
+                 
+                 MED::TGeom2Gauss::const_iterator aGaussIter = aGeom2Gauss.find(aMGeom);
+                 if(aGaussIter == aGeom2Gauss.end())
+                   aNbGauss = 1;
+                 
+                 INITMSG(MYDEBUG,
+                         "- aMGeom = "<<aMGeom<<
+                         "; aNbElem = "<<aNbElem<<
+                         "; aNbGauss = "<<aNbGauss<<
+                         endl);
+                 
+                 // To calculate min/max per components
+                 for(TInt iElem = 0; iElem < aNbElem; iElem++){
+                   MED::TCValueSliceArr aMValueSliceArr = aMMeshValue.GetCompValueSliceArr(iElem);
+                   for(TInt iComp = 0; iComp < aNbComp; iComp++){
+                     const MED::TCValueSlice& aMValueSlice = aMValueSliceArr[iComp];
+                     TMinMax& aMinMax = aMinMaxArr[iComp+1];
+                     float& aMin = aMinMax.first;
+                     float& aMax = aMinMax.second;
+                     for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
+                       const float& aVal = aMValueSlice[iGauss];
+                       aMin = min(aMin,aVal);
+                       aMax = max(aMax,aVal);
+                     }
                    }
                  }
-               }
-               
-               // To calculate min/max per vector modulus
-               TMinMax& aMinMax = aMinMaxArr[0];
-               float& aMin = aMinMax.first;
-               float& aMax = aMinMax.second;
-               for(TInt iElem = 0; iElem < aNbElem; iElem++){
-                 MED::TCValueSliceArr aMValueSliceArr = aMMeshValue.GetGaussValueSliceArr(iElem);
-                 for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
-                   const MED::TCValueSlice& aMValueSlice = aMValueSliceArr[iGauss];
-                   float aValue = 0.0;
-                   for(TInt iComp = 0; iComp < aNbComp2; iComp++){
-                     float aVal = aMValueSlice[iComp];
-                     aValue += aVal*aVal;
+                 
+                 // To calculate min/max per vector modulus
+                 TMinMax& aMinMax = aMinMaxArr[0];
+                 float& aMin = aMinMax.first;
+                 float& aMax = aMinMax.second;
+                 for(TInt iElem = 0; iElem < aNbElem; iElem++){
+                   MED::TCValueSliceArr aMValueSliceArr = aMMeshValue.GetGaussValueSliceArr(iElem);
+                   for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
+                     const MED::TCValueSlice& aMValueSlice = aMValueSliceArr[iGauss];
+                     float aValue = 0.0;
+                     for(TInt iComp = 0; iComp < aNbComp2; iComp++){
+                       float aVal = aMValueSlice[iComp];
+                       aValue += aVal*aVal;
+                     }
+                     aValue = sqrt(aValue);
+                     aMin = min(aMin,aValue);
+                     aMax = max(aMax,aValue);
                    }
-                   aValue = sqrt(aValue);
-                   aMin = min(aMin,aValue);
-                   aMax = max(aMax,aValue);
                  }
                }
-             }
 #ifndef _DEXCEPT_
-           }catch(std::exception& exc){
-             MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
-           }catch(...){
-             MSG(MYDEBUG,"Unknown exception !!!");
+             }catch(std::exception& exc){
+               MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
+             }catch(...){
+               MSG(MYDEBUG,"Unknown exception !!!");
+             }
+           }CASCatch_CATCH(Standard_Failure){
+             Handle(Standard_Failure) aFail = Standard_Failure::Caught();          
+             MSG(MYDEBUG,"Follow signal was occured in:\n"<<aFail->GetMessageString());
            }
 #endif
          }
index f4cdedbe7cf2b573e60295d9bb477a32f4326b04..4a850c12414b6b549c0cc51d0658205df45c2189 100644 (file)
@@ -85,6 +85,7 @@
 #include <strstream>
 
 #include "Utils_ExceptHandlers.hxx"
+#include "CASCatch_CatchSignals.hxx"
 
 using namespace std;
 
@@ -238,18 +239,23 @@ namespace VISU
                    const char* theFieldName, 
                    CORBA::Double theIteration)
   {
+    CASCatch_TRY{       
 #ifndef _DEXCEPT_
-    try{
+      try{
 #endif
-      if(theColoredPrs3d->Create(theMeshName,theEntity,theFieldName,int(theIteration)))
-       return true;
+       if(theColoredPrs3d->Create(theMeshName,theEntity,theFieldName,int(theIteration)))
+         return true;
 #ifndef _DEXCEPT_
-    }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!");
+      }
 #endif
+    }CASCatch_CATCH(Standard_Failure) {
+      Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+      INFOS("Follow signal was occured :\n"<<aFail->GetMessageString());
+    }
     return false;
   }