X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FStdMeshersGUI%2FStdMeshersGUI_DistrPreview.cxx;h=482aeb6be4bd01a31736297b15d0e8833383bb25;hp=e1a410cbaaa36e60cb73d82112ab522f4e641c4e;hb=31282d88869470e2076e06357535c486971a8248;hpb=0ef2b313da77bf984725fb6ae9af82c73dbd077c diff --git a/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx b/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx index e1a410cba..482aeb6be 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx @@ -19,11 +19,22 @@ // #include "StdMeshersGUI_DistrPreview.h" -#include "CASCatch.hxx" #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 + StdMeshersGUI_DistrPreview::StdMeshersGUI_DistrPreview( QWidget* p, StdMeshers::StdMeshers_NumberOfSegments_ptr h ) : QwtPlot( p ), myPoints( 50 ), @@ -240,12 +251,18 @@ void StdMeshersGUI_DistrPreview::update() delete[] y; x = y = 0; - CASCatch_TRY - { +#ifdef NO_CAS_CATCH + try { + OCC_CATCH_SIGNALS; +#else + CASCatch_TRY { +#endif replot(); - } - CASCatch_CATCH(Standard_Failure) - { +#ifdef NO_CAS_CATCH + } catch(Standard_Failure) { +#else + } CASCatch_CATCH(Standard_Failure) { +#endif Handle(Standard_Failure) aFail = Standard_Failure::Caught(); } } @@ -285,13 +302,19 @@ bool isCorrectArg( const Handle( Expr_GeneralExpression )& expr ) bool StdMeshersGUI_DistrPreview::init( const QString& str ) { bool parsed_ok = true; - CASCatch_TRY - { +#ifdef NO_CAS_CATCH + try { + OCC_CATCH_SIGNALS; +#else + CASCatch_TRY { +#endif myExpr = ExprIntrp_GenExp::Create(); myExpr->Process( ( Standard_CString ) str.latin1() ); - } - CASCatch_CATCH(Standard_Failure) - { +#ifdef NO_CAS_CATCH + } catch(Standard_Failure) { +#else + } CASCatch_CATCH(Standard_Failure) { +#endif Handle(Standard_Failure) aFail = Standard_Failure::Caught(); parsed_ok = false; } @@ -327,10 +350,18 @@ double StdMeshersGUI_DistrPreview::calc( bool& ok ) double res = 0.0; ok = true; - CASCatch_TRY { +#ifdef NO_CAS_CATCH + try { + OCC_CATCH_SIGNALS; +#else + CASCatch_TRY { +#endif res = myExpr->Expression()->Evaluate( myVars, myValues ); - } - CASCatch_CATCH(Standard_Failure) { +#ifdef NO_CAS_CATCH + } catch(Standard_Failure) { +#else + } CASCatch_CATCH(Standard_Failure) { +#endif Handle(Standard_Failure) aFail = Standard_Failure::Caught(); ok = false; res = 0.0; @@ -351,16 +382,22 @@ bool StdMeshersGUI_DistrPreview::convert( double& v ) const { case EXPONENT: { - CASCatch_TRY - { +#ifdef NO_CAS_CATCH + try { + OCC_CATCH_SIGNALS; +#else + CASCatch_TRY { +#endif // in StdMeshers_NumberOfSegments.cc // const double PRECISION = 1e-7; // if(v < -7) v = -7.0; v = pow( 10.0, v ); - } - CASCatch_CATCH(Standard_Failure) - { +#ifdef NO_CAS_CATCH + } catch(Standard_Failure) { +#else + } CASCatch_CATCH(Standard_Failure) { +#endif Handle(Standard_Failure) aFail = Standard_Failure::Caught(); v = 0.0; ok = false;