From 274698b4d80c9f8ffde448abf3bdcb0659fcdc36 Mon Sep 17 00:00:00 2001 From: jfa Date: Mon, 4 Sep 2006 11:35:20 +0000 Subject: [PATCH] Join modifications from branch BR_For_OCT_611: migration to OCCT6.1.1 with new exception handling and improved threads support. --- src/CONVERTOR/VISU_MedConvertor.cxx | 40 +++++++++++++++---- src/VISU_I/VISU_Gen_i.cc | 37 ++++++++++++++--- src/VISU_I/VISU_TimeAnimation.cxx | 61 +++++++++++++++++++++-------- 3 files changed, 109 insertions(+), 29 deletions(-) diff --git a/src/CONVERTOR/VISU_MedConvertor.cxx b/src/CONVERTOR/VISU_MedConvertor.cxx index f6e5127c..77c4351b 100644 --- a/src/CONVERTOR/VISU_MedConvertor.cxx +++ b/src/CONVERTOR/VISU_MedConvertor.cxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // File : VISU_MedConvertor.cxx @@ -34,7 +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 @@ -1399,8 +1409,13 @@ VISU_MedConvertor INITMSG(MYDEBUG,"- iTimeStamp = "<GetPTimeStampInfo(aFieldInfo, aMEntity, @@ -1470,15 +1485,26 @@ 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()); }catch(std::exception& exc){ MSG(MYDEBUG,"Follow exception was occured in:\n"<GetMessageString()); - } +#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 d973f0ee..ebac78cb 100644 --- a/src/VISU_I/VISU_Gen_i.cc +++ b/src/VISU_I/VISU_Gen_i.cc @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // File : VISU_Gen_i.cc @@ -86,7 +86,18 @@ #include #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; @@ -240,23 +251,39 @@ namespace VISU const char* theFieldName, CORBA::Double theIteration) { - CASCatch_TRY{ #ifndef _DEXCEPT_ +#ifdef NO_CAS_CATCH + try{ + OCC_CATCH_SIGNALS; +#else + CASCatch_TRY{ try{ +#endif #endif if(theColoredPrs3d->Create(theMeshName,theEntity,theFieldName,int(theIteration))) return true; #ifndef _DEXCEPT_ +#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 +#endif return false; } diff --git a/src/VISU_I/VISU_TimeAnimation.cxx b/src/VISU_I/VISU_TimeAnimation.cxx index b337e3ad..5faacca8 100644 --- a/src/VISU_I/VISU_TimeAnimation.cxx +++ b/src/VISU_I/VISU_TimeAnimation.cxx @@ -57,13 +57,24 @@ #include "SALOMEDSClient_AttributeComment.hxx" #include "SALOMEDSClient_AttributeName.hxx" -#include "CASCatch.hxx" #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; @@ -235,23 +246,39 @@ namespace bool anIsCreated = false; TPrs3d* aPresent = new TPrs3d(theResult, false); - 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"<GetMessageString()); +#ifdef NO_CAS_CATCH + try{ + 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); + } +#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(); } -- 2.39.2