From: jfa Date: Tue, 29 Aug 2006 08:03:48 +0000 (+0000) Subject: Usage of CASCatch with old OCCT versions. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b5b7552f85a1f8b65795cba3e1a227be4104f4ca;p=modules%2Fvisu.git Usage of CASCatch with old OCCT versions. --- diff --git a/src/CONVERTOR/VISU_MedConvertor.cxx b/src/CONVERTOR/VISU_MedConvertor.cxx index 7fa6c0c3..77c4351b 100644 --- a/src/CONVERTOR/VISU_MedConvertor.cxx +++ b/src/CONVERTOR/VISU_MedConvertor.cxx @@ -34,8 +34,17 @@ #include "MED_GaussUtils.hxx" #include "MED_Utilities.hxx" +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 +#define NO_CAS_CATCH +#endif + #include + +#ifdef NO_CAS_CATCH #include +#else +#include "CASCatch.hxx" +#endif #include @@ -1400,9 +1409,12 @@ VISU_MedConvertor INITMSG(MYDEBUG,"- iTimeStamp = "< 0x060100 OCC_CATCH_SIGNALS; +#else + CASCatch_TRY{ + try{ #endif #endif MED::PTimeStampInfo aTimeStampInfo = aMed->GetPTimeStampInfo(aFieldInfo, @@ -1473,6 +1485,7 @@ VISU_MedConvertor } } #ifndef _DEXCEPT_ +#ifdef NO_CAS_CATCH }catch(Standard_Failure){ Handle(Standard_Failure) aFail = Standard_Failure::Caught(); MSG(MYDEBUG,"Follow signal was occured in:\n"<GetMessageString()); @@ -1481,6 +1494,17 @@ VISU_MedConvertor }catch(...){ MSG(MYDEBUG,"Unknown exception !!!"); } +#else + }catch(std::exception& exc){ + MSG(MYDEBUG,"Follow exception was occured in:\n"<GetMessageString()); + } +#endif #endif } for(TInt iComp = 0; iComp <= aNbComp; iComp++){ diff --git a/src/VISU_I/VISU_Gen_i.cc b/src/VISU_I/VISU_Gen_i.cc index 0540ad5c..ae642d97 100644 --- a/src/VISU_I/VISU_Gen_i.cc +++ b/src/VISU_I/VISU_Gen_i.cc @@ -86,8 +86,17 @@ #include "Utils_ExceptHandlers.hxx" +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 +#define NO_CAS_CATCH +#endif + #include + +#ifdef NO_CAS_CATCH #include +#else +#include "CASCatch.hxx" +#endif using namespace std; @@ -242,22 +251,37 @@ namespace VISU CORBA::Double theIteration) { #ifndef _DEXCEPT_ +#ifdef NO_CAS_CATCH try{ -#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 OCC_CATCH_SIGNALS; +#else + CASCatch_TRY{ + try{ #endif #endif - if(theColoredPrs3d->Create(theMeshName,theEntity,theFieldName,int(theIteration))) - return true; + if(theColoredPrs3d->Create(theMeshName,theEntity,theFieldName,int(theIteration))) + return true; #ifndef _DEXCEPT_ - }catch(Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); +#ifdef NO_CAS_CATCH + }catch(Standard_Failure) { + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); + INFOS("Follow signal was occured :\n"<GetMessageString()); + }catch(std::exception& exc){ + INFOS("Follow exception was occured :\n"<GetMessageString()); - }catch(std::exception& exc){ - INFOS("Follow exception was occured :\n"< -#include - #include #include #include #include +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 +#define NO_CAS_CATCH +#endif + +#include + +#ifdef NO_CAS_CATCH +#include +#else +#include "CASCatch.hxx" +#endif + using namespace std; @@ -237,24 +246,39 @@ namespace bool anIsCreated = false; TPrs3d* aPresent = new TPrs3d(theResult, false); +#ifdef NO_CAS_CATCH try{ -#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 OCC_CATCH_SIGNALS; +#else + CASCatch_TRY{ + try{ #endif - 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(Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - INFOS("Follow signal was occured :\n"<GetMessageString()); - }catch(std::exception& exc){ - INFOS("Follow exception was occured :\n"<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); + } +#ifdef NO_CAS_CATCH + }catch(Standard_Failure) { + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); + INFOS("Follow signal was occured :\n"<GetMessageString()); + }catch(std::exception& exc){ + INFOS("Follow exception was occured :\n"<GetMessageString()); } +#endif if(!anIsCreated) aPresent->_remove_ref(); }