X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FStdMeshers%2FStdMeshers_Distribution.cxx;h=1223fc009e716220152d1c577951231b3729f23d;hp=93858296b6bce1a77ea6492b0a75843bc5ae4d6b;hb=4ff5bd61540272713e48de1eee75625028c32155;hpb=50eb85fb3d790dcf6607bb1eb63a9fd68bcaadba diff --git a/src/StdMeshers/StdMeshers_Distribution.cxx b/src/StdMeshers/StdMeshers_Distribution.cxx index 93858296b..1223fc009 100644 --- a/src/StdMeshers/StdMeshers_Distribution.cxx +++ b/src/StdMeshers/StdMeshers_Distribution.cxx @@ -27,10 +27,8 @@ // $Header$ #include "StdMeshers_Distribution.hxx" -#include -#include -#include -#include +#include "CASCatch.hxx" + #include #include @@ -45,9 +43,6 @@ Function::~Function() bool Function::value( const double, double& f ) const { - CASCatch_CatchSignals aCatchSignals; - aCatchSignals.Activate(); - bool ok = true; if( myConv==0 ) { @@ -55,10 +50,9 @@ bool Function::value( const double, double& f ) const { f = pow( 10, f ); } - CASCatch_CATCH(CASCatch_Failure) + CASCatch_CATCH(Standard_Failure) { - aCatchSignals.Deactivate(); - Handle(CASCatch_Failure) aFail = CASCatch_Failure::Caught(); + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); f = 0.0; ok = false; } @@ -174,22 +168,17 @@ FunctionExpr::FunctionExpr( const char* str, const int conv ) myVars( 1, 1 ), myValues( 1, 1 ) { - CASCatch_CatchSignals aCatchSignals; - aCatchSignals.Activate(); - bool ok = true; CASCatch_TRY { myExpr = ExprIntrp_GenExp::Create(); myExpr->Process( ( Standard_CString )str ); } - CASCatch_CATCH(CASCatch_Failure) + CASCatch_CATCH(Standard_Failure) { - aCatchSignals.Deactivate(); - Handle(CASCatch_Failure) aFail = CASCatch_Failure::Caught(); + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); ok = false; } - aCatchSignals.Deactivate(); if( !ok || !myExpr->IsDone() ) myExpr.Nullify(); @@ -214,23 +203,17 @@ bool FunctionExpr::value( const double t, double& f ) const if( myExpr.IsNull() ) return false; - OSD::SetSignal( true ); - CASCatch_CatchSignals aCatchSignals; - aCatchSignals.Activate(); - ( ( TColStd_Array1OfReal& )myValues ).ChangeValue( 1 ) = t; bool ok = true; CASCatch_TRY { f = myExpr->Expression()->Evaluate( myVars, myValues ); } - CASCatch_CATCH(CASCatch_Failure) { - aCatchSignals.Deactivate(); - Handle(CASCatch_Failure) aFail = CASCatch_Failure::Caught(); + CASCatch_CATCH(Standard_Failure) { + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); f = 0.0; ok = false; } - aCatchSignals.Deactivate(); ok = Function::value( t, f ) && ok; return ok; } @@ -244,7 +227,7 @@ double FunctionExpr::integral( const double a, const double b ) const if( _int.IsDone() ) res = _int.Value(); } - CASCatch_CATCH(CASCatch_Failure) + CASCatch_CATCH(Standard_Failure) { res = 0.0; MESSAGE( "Exception in integral calculating" );