X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FStdMeshersGUI%2FStdMeshersGUI_DistrPreview.cxx;h=15847d15ad4f528daa47633b0f47382a3b177397;hp=e1a410cbaaa36e60cb73d82112ab522f4e641c4e;hb=b1e72cfac7a6d0d0f603e7e868b75c50b335ddd2;hpb=c63ee099ad2b149bd70136839c973e8910137bc5 diff --git a/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx b/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx index e1a410cba..15847d15a 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx @@ -18,12 +18,23 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +using namespace std; + #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 +#endif + StdMeshersGUI_DistrPreview::StdMeshersGUI_DistrPreview( QWidget* p, StdMeshers::StdMeshers_NumberOfSegments_ptr h ) : QwtPlot( p ), myPoints( 50 ), @@ -240,12 +251,12 @@ void StdMeshersGUI_DistrPreview::update() delete[] y; x = y = 0; - CASCatch_TRY - { + try { +#ifdef NO_CAS_CATCH + OCC_CATCH_SIGNALS; +#endif replot(); - } - CASCatch_CATCH(Standard_Failure) - { + } catch(Standard_Failure) { Handle(Standard_Failure) aFail = Standard_Failure::Caught(); } } @@ -285,13 +296,13 @@ bool isCorrectArg( const Handle( Expr_GeneralExpression )& expr ) bool StdMeshersGUI_DistrPreview::init( const QString& str ) { bool parsed_ok = true; - CASCatch_TRY - { + try { +#ifdef NO_CAS_CATCH + OCC_CATCH_SIGNALS; +#endif myExpr = ExprIntrp_GenExp::Create(); myExpr->Process( ( Standard_CString ) str.latin1() ); - } - CASCatch_CATCH(Standard_Failure) - { + } catch(Standard_Failure) { Handle(Standard_Failure) aFail = Standard_Failure::Caught(); parsed_ok = false; } @@ -327,10 +338,12 @@ double StdMeshersGUI_DistrPreview::calc( bool& ok ) double res = 0.0; ok = true; - CASCatch_TRY { + try { +#ifdef NO_CAS_CATCH + OCC_CATCH_SIGNALS; +#endif res = myExpr->Expression()->Evaluate( myVars, myValues ); - } - CASCatch_CATCH(Standard_Failure) { + } catch(Standard_Failure) { Handle(Standard_Failure) aFail = Standard_Failure::Caught(); ok = false; res = 0.0; @@ -351,16 +364,16 @@ bool StdMeshersGUI_DistrPreview::convert( double& v ) const { case EXPONENT: { - CASCatch_TRY - { + try { +#ifdef NO_CAS_CATCH + OCC_CATCH_SIGNALS; +#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) - { + } catch(Standard_Failure) { Handle(Standard_Failure) aFail = Standard_Failure::Caught(); v = 0.0; ok = false;