//
#include "StdMeshersGUI_DistrPreview.h"
-#include "CASCatch.hxx"
#include <Expr_NamedUnknown.hxx>
#include <Expr_GeneralExpression.hxx>
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#define NO_CAS_CATCH
+#endif
+
+#include <Standard_Failure.hxx>
+
+#ifdef NO_CAS_CATCH
+#include <Standard_ErrorHandler.hxx>
+#else
+#include "CASCatch.hxx"
+#endif
+
StdMeshersGUI_DistrPreview::StdMeshersGUI_DistrPreview( QWidget* p, StdMeshers::StdMeshers_NumberOfSegments_ptr h )
: QwtPlot( p ),
myPoints( 50 ),
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();
}
}
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;
}
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;
{
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;