From 12cf1a48c82bb60cd397b768d103a82488ee5eb8 Mon Sep 17 00:00:00 2001 From: jfa Date: Mon, 28 Aug 2006 15:03:11 +0000 Subject: [PATCH] Consider OCCT version --- src/SMESH/SMESH_subMesh.cxx | 2 ++ src/SMESH_I/SMESH_MeshEditor_i.cxx | 2 ++ src/StdMeshers/StdMeshers_Distribution.cxx | 8 ++++++++ src/StdMeshers/StdMeshers_NumberOfSegments.cxx | 4 ++++ src/StdMeshers/StdMeshers_Regular_1D.cxx | 2 ++ src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx | 8 ++++++++ 6 files changed, 26 insertions(+) diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index c41b91806..6413b8031 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -1265,7 +1265,9 @@ bool SMESH_subMesh::ComputeStateEngine(int event) RemoveSubMeshElementsAndNodes(); { try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 OCC_CATCH_SIGNALS; +#endif if (!algo->NeedDescretBoundary() && !algo->OnlyUnaryInput()) ret = ApplyToCollection( algo, GetCollection( gen, algo ) ); else diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index 5f5f67fb2..4e588ec8c 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -1055,7 +1055,9 @@ void SMESH_MeshEditor_i::ExtrusionSweep(const SMESH::long_array & theIDsOfElemen myLastCreatedNodes = new SMESH::long_array(); try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 OCC_CATCH_SIGNALS; +#endif SMESHDS_Mesh* aMesh = GetMeshDS(); map elements; diff --git a/src/StdMeshers/StdMeshers_Distribution.cxx b/src/StdMeshers/StdMeshers_Distribution.cxx index 2e79dbb1a..3855ce148 100644 --- a/src/StdMeshers/StdMeshers_Distribution.cxx +++ b/src/StdMeshers/StdMeshers_Distribution.cxx @@ -49,7 +49,9 @@ bool Function::value( const double, double& f ) const if( myConv==0 ) { try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 OCC_CATCH_SIGNALS; +#endif f = pow( 10, f ); } catch(Standard_Failure) @@ -173,7 +175,9 @@ FunctionExpr::FunctionExpr( const char* str, const int conv ) { bool ok = true; try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 OCC_CATCH_SIGNALS; +#endif myExpr = ExprIntrp_GenExp::Create(); myExpr->Process( ( Standard_CString )str ); } @@ -209,7 +213,9 @@ bool FunctionExpr::value( const double t, double& f ) const ( ( TColStd_Array1OfReal& )myValues ).ChangeValue( 1 ) = t; bool ok = true; try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 OCC_CATCH_SIGNALS; +#endif f = myExpr->Expression()->Evaluate( myVars, myValues ); } catch(Standard_Failure) { @@ -226,7 +232,9 @@ double FunctionExpr::integral( const double a, const double b ) const { double res = 0.0; try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 OCC_CATCH_SIGNALS; +#endif math_GaussSingleIntegration _int( ( math_Function& )*this, a, b, 20 ); if( _int.IsDone() ) res = _int.Value(); diff --git a/src/StdMeshers/StdMeshers_NumberOfSegments.cxx b/src/StdMeshers/StdMeshers_NumberOfSegments.cxx index 2cb4957ab..64ea2a674 100644 --- a/src/StdMeshers/StdMeshers_NumberOfSegments.cxx +++ b/src/StdMeshers/StdMeshers_NumberOfSegments.cxx @@ -220,7 +220,9 @@ void StdMeshers_NumberOfSegments::SetTableFunction(const std::vector& ta if( _convMode==0 ) { try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 OCC_CATCH_SIGNALS; +#endif val = pow( 10.0, val ); } catch(Standard_Failure) @@ -314,7 +316,9 @@ bool process( const TCollection_AsciiString& str, int convMode, bool parsed_ok = true; Handle( ExprIntrp_GenExp ) myExpr; try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 OCC_CATCH_SIGNALS; +#endif myExpr = ExprIntrp_GenExp::Create(); myExpr->Process( str.ToCString() ); } diff --git a/src/StdMeshers/StdMeshers_Regular_1D.cxx b/src/StdMeshers/StdMeshers_Regular_1D.cxx index 4033af584..d933aebbf 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.cxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.cxx @@ -575,7 +575,9 @@ bool StdMeshers_Regular_1D::Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aSh if ( !_mainEdge.IsNull() ) reversed = aMesh.IsReversedInChain( EE, _mainEdge ); try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 OCC_CATCH_SIGNALS; +#endif if ( ! computeInternalParameters( E, params, reversed )) { //cout << "computeInternalParameters() failed" < 0x060100 OCC_CATCH_SIGNALS; +#endif replot(); } catch(Standard_Failure) @@ -288,7 +290,9 @@ bool StdMeshersGUI_DistrPreview::init( const QString& str ) { bool parsed_ok = true; try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 OCC_CATCH_SIGNALS; +#endif myExpr = ExprIntrp_GenExp::Create(); myExpr->Process( ( Standard_CString ) str.latin1() ); } @@ -330,7 +334,9 @@ double StdMeshersGUI_DistrPreview::calc( bool& ok ) ok = true; try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 OCC_CATCH_SIGNALS; +#endif res = myExpr->Expression()->Evaluate( myVars, myValues ); } catch(Standard_Failure) { @@ -355,7 +361,9 @@ bool StdMeshersGUI_DistrPreview::convert( double& v ) const case EXPONENT: { try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 OCC_CATCH_SIGNALS; +#endif // in StdMeshers_NumberOfSegments.cc // const double PRECISION = 1e-7; // -- 2.39.2