NPAL18078: dependance on CASCADE in Salome.

This commit is contained in:
jfa 2007-11-30 08:33:11 +00:00
parent fc387c8013
commit 666558e956
4 changed files with 11 additions and 86 deletions

View File

@ -38,7 +38,6 @@
#include "SMESH_Filter_i.hxx" #include "SMESH_Filter_i.hxx"
#include "SMESH_PythonDump.hxx" #include "SMESH_PythonDump.hxx"
#include "CASCatch.hxx"
#include "utilities.h" #include "utilities.h"
#include "Utils_ExceptHandlers.hxx" #include "Utils_ExceptHandlers.hxx"
#include "Utils_CorbaException.hxx" #include "Utils_CorbaException.hxx"
@ -61,8 +60,6 @@
#ifdef NO_CAS_CATCH #ifdef NO_CAS_CATCH
#include <Standard_ErrorHandler.hxx> #include <Standard_ErrorHandler.hxx>
#else
#include "CASCatch.hxx"
#endif #endif
#include <sstream> #include <sstream>
@ -1524,11 +1521,9 @@ SMESH_MeshEditor_i::extrusionSweep(const SMESH::long_array & theIDsOfElements,
{ {
initData(); initData();
#ifdef NO_CAS_CATCH
try { try {
#ifdef NO_CAS_CATCH
OCC_CATCH_SIGNALS; OCC_CATCH_SIGNALS;
#else
CASCatch_TRY {
#endif #endif
TIDSortedElemSet elements; TIDSortedElemSet elements;
arrayToSet(theIDsOfElements, GetMeshDS(), elements, theElementType); arrayToSet(theIDsOfElements, GetMeshDS(), elements, theElementType);
@ -1545,11 +1540,7 @@ SMESH_MeshEditor_i::extrusionSweep(const SMESH::long_array & theIDsOfElements,
return theMakeGroups ? getGroups(groupIds.get()) : 0; return theMakeGroups ? getGroups(groupIds.get()) : 0;
#ifdef NO_CAS_CATCH
} catch(Standard_Failure) { } catch(Standard_Failure) {
#else
} CASCatch_CATCH(Standard_Failure) {
#endif
Handle(Standard_Failure) aFail = Standard_Failure::Caught(); Handle(Standard_Failure) aFail = Standard_Failure::Caught();
INFOS( "SMESH_MeshEditor_i::ExtrusionSweep fails - "<< aFail->GetMessageString() ); INFOS( "SMESH_MeshEditor_i::ExtrusionSweep fails - "<< aFail->GetMessageString() );
} }

View File

@ -39,8 +39,6 @@
#ifdef NO_CAS_CATCH #ifdef NO_CAS_CATCH
#include <Standard_ErrorHandler.hxx> #include <Standard_ErrorHandler.hxx>
#else
#include "CASCatch.hxx"
#endif #endif
Function::Function( const int conv ) Function::Function( const int conv )
@ -56,18 +54,12 @@ bool Function::value( const double, double& f ) const
{ {
bool ok = true; bool ok = true;
if (myConv == 0) { if (myConv == 0) {
#ifdef NO_CAS_CATCH
try { try {
#ifdef NO_CAS_CATCH
OCC_CATCH_SIGNALS; OCC_CATCH_SIGNALS;
#else
CASCatch_TRY {
#endif #endif
f = pow( 10., f ); f = pow( 10., f );
#ifdef NO_CAS_CATCH
} catch(Standard_Failure) { } catch(Standard_Failure) {
#else
} CASCatch_CATCH(Standard_Failure) {
#endif
Handle(Standard_Failure) aFail = Standard_Failure::Caught(); Handle(Standard_Failure) aFail = Standard_Failure::Caught();
f = 0.0; f = 0.0;
ok = false; ok = false;
@ -194,19 +186,13 @@ FunctionExpr::FunctionExpr( const char* str, const int conv )
myValues( 1, 1 ) myValues( 1, 1 )
{ {
bool ok = true; bool ok = true;
#ifdef NO_CAS_CATCH
try { try {
#ifdef NO_CAS_CATCH
OCC_CATCH_SIGNALS; OCC_CATCH_SIGNALS;
#else
CASCatch_TRY {
#endif #endif
myExpr = ExprIntrp_GenExp::Create(); myExpr = ExprIntrp_GenExp::Create();
myExpr->Process( ( Standard_CString )str ); myExpr->Process( ( Standard_CString )str );
#ifdef NO_CAS_CATCH
} catch(Standard_Failure) { } catch(Standard_Failure) {
#else
} CASCatch_CATCH(Standard_Failure) {
#endif
Handle(Standard_Failure) aFail = Standard_Failure::Caught(); Handle(Standard_Failure) aFail = Standard_Failure::Caught();
ok = false; ok = false;
} }
@ -236,18 +222,12 @@ bool FunctionExpr::value( const double t, double& f ) const
( ( TColStd_Array1OfReal& )myValues ).ChangeValue( 1 ) = t; ( ( TColStd_Array1OfReal& )myValues ).ChangeValue( 1 ) = t;
bool ok = true; bool ok = true;
#ifdef NO_CAS_CATCH
try { try {
#ifdef NO_CAS_CATCH
OCC_CATCH_SIGNALS; OCC_CATCH_SIGNALS;
#else
CASCatch_TRY {
#endif #endif
f = myExpr->Expression()->Evaluate( myVars, myValues ); f = myExpr->Expression()->Evaluate( myVars, myValues );
#ifdef NO_CAS_CATCH
} catch(Standard_Failure) { } catch(Standard_Failure) {
#else
} CASCatch_CATCH(Standard_Failure) {
#endif
Handle(Standard_Failure) aFail = Standard_Failure::Caught(); Handle(Standard_Failure) aFail = Standard_Failure::Caught();
f = 0.0; f = 0.0;
ok = false; ok = false;
@ -260,21 +240,15 @@ bool FunctionExpr::value( const double t, double& f ) const
double FunctionExpr::integral( const double a, const double b ) const double FunctionExpr::integral( const double a, const double b ) const
{ {
double res = 0.0; double res = 0.0;
#ifdef NO_CAS_CATCH
try { try {
#ifdef NO_CAS_CATCH
OCC_CATCH_SIGNALS; OCC_CATCH_SIGNALS;
#else
CASCatch_TRY {
#endif #endif
math_GaussSingleIntegration _int math_GaussSingleIntegration _int
( *static_cast<math_Function*>( const_cast<FunctionExpr*> (this) ), a, b, 20 ); ( *static_cast<math_Function*>( const_cast<FunctionExpr*> (this) ), a, b, 20 );
if( _int.IsDone() ) if( _int.IsDone() )
res = _int.Value(); res = _int.Value();
#ifdef NO_CAS_CATCH
} catch(Standard_Failure) { } catch(Standard_Failure) {
#else
} CASCatch_CATCH(Standard_Failure) {
#endif
res = 0.0; res = 0.0;
MESSAGE( "Exception in integral calculating" ); MESSAGE( "Exception in integral calculating" );
} }

View File

@ -49,8 +49,6 @@
#ifdef NO_CAS_CATCH #ifdef NO_CAS_CATCH
#include <Standard_ErrorHandler.hxx> #include <Standard_ErrorHandler.hxx>
#else
#include "CASCatch.hxx"
#endif #endif
using namespace std; using namespace std;
@ -233,18 +231,12 @@ void StdMeshers_NumberOfSegments::SetTableFunction(const vector<double>& table)
double val = table[i*2+1]; double val = table[i*2+1];
if( _convMode==0 ) if( _convMode==0 )
{ {
#ifdef NO_CAS_CATCH
try { try {
#ifdef NO_CAS_CATCH
OCC_CATCH_SIGNALS; OCC_CATCH_SIGNALS;
#else
CASCatch_TRY {
#endif #endif
val = pow( 10.0, val ); val = pow( 10.0, val );
#ifdef NO_CAS_CATCH
} catch(Standard_Failure) { } catch(Standard_Failure) {
#else
} CASCatch_CATCH(Standard_Failure) {
#endif
Handle(Standard_Failure) aFail = Standard_Failure::Caught(); Handle(Standard_Failure) aFail = Standard_Failure::Caught();
throw SALOME_Exception( LOCALIZED( "invalid value")); throw SALOME_Exception( LOCALIZED( "invalid value"));
return; return;
@ -333,19 +325,13 @@ bool process( const TCollection_AsciiString& str, int convMode,
{ {
bool parsed_ok = true; bool parsed_ok = true;
Handle( ExprIntrp_GenExp ) myExpr; Handle( ExprIntrp_GenExp ) myExpr;
#ifdef NO_CAS_CATCH
try { try {
#ifdef NO_CAS_CATCH
OCC_CATCH_SIGNALS; OCC_CATCH_SIGNALS;
#else
CASCatch_TRY {
#endif #endif
myExpr = ExprIntrp_GenExp::Create(); myExpr = ExprIntrp_GenExp::Create();
myExpr->Process( str.ToCString() ); myExpr->Process( str.ToCString() );
#ifdef NO_CAS_CATCH
} catch(Standard_Failure) { } catch(Standard_Failure) {
#else
} CASCatch_CATCH(Standard_Failure) {
#endif
Handle(Standard_Failure) aFail = Standard_Failure::Caught(); Handle(Standard_Failure) aFail = Standard_Failure::Caught();
parsed_ok = false; parsed_ok = false;
} }

View File

@ -31,8 +31,6 @@
#ifdef NO_CAS_CATCH #ifdef NO_CAS_CATCH
#include <Standard_ErrorHandler.hxx> #include <Standard_ErrorHandler.hxx>
#else
#include "CASCatch.hxx"
#endif #endif
StdMeshersGUI_DistrPreview::StdMeshersGUI_DistrPreview( QWidget* p, StdMeshers::StdMeshers_NumberOfSegments_ptr h ) StdMeshersGUI_DistrPreview::StdMeshersGUI_DistrPreview( QWidget* p, StdMeshers::StdMeshers_NumberOfSegments_ptr h )
@ -251,18 +249,12 @@ void StdMeshersGUI_DistrPreview::update()
delete[] y; delete[] y;
x = y = 0; x = y = 0;
#ifdef NO_CAS_CATCH
try { try {
#ifdef NO_CAS_CATCH
OCC_CATCH_SIGNALS; OCC_CATCH_SIGNALS;
#else
CASCatch_TRY {
#endif #endif
replot(); replot();
#ifdef NO_CAS_CATCH
} catch(Standard_Failure) { } catch(Standard_Failure) {
#else
} CASCatch_CATCH(Standard_Failure) {
#endif
Handle(Standard_Failure) aFail = Standard_Failure::Caught(); Handle(Standard_Failure) aFail = Standard_Failure::Caught();
} }
} }
@ -302,19 +294,13 @@ bool isCorrectArg( const Handle( Expr_GeneralExpression )& expr )
bool StdMeshersGUI_DistrPreview::init( const QString& str ) bool StdMeshersGUI_DistrPreview::init( const QString& str )
{ {
bool parsed_ok = true; bool parsed_ok = true;
#ifdef NO_CAS_CATCH
try { try {
#ifdef NO_CAS_CATCH
OCC_CATCH_SIGNALS; OCC_CATCH_SIGNALS;
#else
CASCatch_TRY {
#endif #endif
myExpr = ExprIntrp_GenExp::Create(); myExpr = ExprIntrp_GenExp::Create();
myExpr->Process( ( Standard_CString ) str.latin1() ); myExpr->Process( ( Standard_CString ) str.latin1() );
#ifdef NO_CAS_CATCH
} catch(Standard_Failure) { } catch(Standard_Failure) {
#else
} CASCatch_CATCH(Standard_Failure) {
#endif
Handle(Standard_Failure) aFail = Standard_Failure::Caught(); Handle(Standard_Failure) aFail = Standard_Failure::Caught();
parsed_ok = false; parsed_ok = false;
} }
@ -350,18 +336,12 @@ double StdMeshersGUI_DistrPreview::calc( bool& ok )
double res = 0.0; double res = 0.0;
ok = true; ok = true;
#ifdef NO_CAS_CATCH
try { try {
#ifdef NO_CAS_CATCH
OCC_CATCH_SIGNALS; OCC_CATCH_SIGNALS;
#else
CASCatch_TRY {
#endif #endif
res = myExpr->Expression()->Evaluate( myVars, myValues ); res = myExpr->Expression()->Evaluate( myVars, myValues );
#ifdef NO_CAS_CATCH
} catch(Standard_Failure) { } catch(Standard_Failure) {
#else
} CASCatch_CATCH(Standard_Failure) {
#endif
Handle(Standard_Failure) aFail = Standard_Failure::Caught(); Handle(Standard_Failure) aFail = Standard_Failure::Caught();
ok = false; ok = false;
res = 0.0; res = 0.0;
@ -382,22 +362,16 @@ bool StdMeshersGUI_DistrPreview::convert( double& v ) const
{ {
case EXPONENT: case EXPONENT:
{ {
#ifdef NO_CAS_CATCH
try { try {
#ifdef NO_CAS_CATCH
OCC_CATCH_SIGNALS; OCC_CATCH_SIGNALS;
#else
CASCatch_TRY {
#endif #endif
// in StdMeshers_NumberOfSegments.cc // in StdMeshers_NumberOfSegments.cc
// const double PRECISION = 1e-7; // const double PRECISION = 1e-7;
// //
if(v < -7) v = -7.0; if(v < -7) v = -7.0;
v = pow( 10.0, v ); v = pow( 10.0, v );
#ifdef NO_CAS_CATCH
} catch(Standard_Failure) { } catch(Standard_Failure) {
#else
} CASCatch_CATCH(Standard_Failure) {
#endif
Handle(Standard_Failure) aFail = Standard_Failure::Caught(); Handle(Standard_Failure) aFail = Standard_Failure::Caught();
v = 0.0; v = 0.0;
ok = false; ok = false;