From 717a620a7ed0b80b3f4e291be2707c30b337589b Mon Sep 17 00:00:00 2001 From: apo Date: Fri, 3 Mar 2006 12:37:41 +0000 Subject: [PATCH] Fix for Bug IPAL11670 CRASH after trying to import "polygones.med" and "recall_bord.med". --- src/CONVERTOR/Makefile.in | 12 ++- src/CONVERTOR/VISU_MedConvertor.cxx | 134 ++++++++++++++-------------- src/VISU_I/VISU_Gen_i.cc | 22 +++-- 3 files changed, 93 insertions(+), 75 deletions(-) diff --git a/src/CONVERTOR/Makefile.in b/src/CONVERTOR/Makefile.in index 36847c34..b3bf4147 100644 --- a/src/CONVERTOR/Makefile.in +++ b/src/CONVERTOR/Makefile.in @@ -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 diff --git a/src/CONVERTOR/VISU_MedConvertor.cxx b/src/CONVERTOR/VISU_MedConvertor.cxx index 12178e79..80b6976b 100644 --- a/src/CONVERTOR/VISU_MedConvertor.cxx +++ b/src/CONVERTOR/VISU_MedConvertor.cxx @@ -34,8 +34,7 @@ #include "MED_GaussUtils.hxx" #include "MED_Utilities.hxx" -#include -#include +#include "CASCatch_CatchSignals.hxx" #include @@ -1195,80 +1194,85 @@ VISU_MedConvertor INITMSG(MYDEBUG,"- iTimeStamp = "<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 = "<GetMessageString()); } #endif } diff --git a/src/VISU_I/VISU_Gen_i.cc b/src/VISU_I/VISU_Gen_i.cc index f4cdedbe..4a850c12 100644 --- a/src/VISU_I/VISU_Gen_i.cc +++ b/src/VISU_I/VISU_Gen_i.cc @@ -85,6 +85,7 @@ #include #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"<GetMessageString()); + } return false; } -- 2.39.2