Salome HOME
SMH: Version ported on new OCT6.1.1
[modules/smesh.git] / src / StdMeshersGUI / StdMeshersGUI_DistrPreview.cxx
index e1a410cbaaa36e60cb73d82112ab522f4e641c4e..c1da2017a5ebaa1820f6a22461802825a19c105b 100644 (file)
 //
 
 #include "StdMeshersGUI_DistrPreview.h"
-#include "CASCatch.hxx"
 
 #include <Expr_NamedUnknown.hxx>
 #include <Expr_GeneralExpression.hxx>
 
+#include <Standard_Failure.hxx>
+#include <Standard_ErrorHandler.hxx>
+
 StdMeshersGUI_DistrPreview::StdMeshersGUI_DistrPreview( QWidget* p, StdMeshers::StdMeshers_NumberOfSegments_ptr h )
 : QwtPlot( p ),
   myPoints( 50 ),
@@ -240,11 +242,11 @@ void StdMeshersGUI_DistrPreview::update()
   delete[] y;
   x = y = 0;
 
-  CASCatch_TRY
-  {   
+  try {   
+    OCC_CATCH_SIGNALS;
     replot();
   }
-  CASCatch_CATCH(Standard_Failure)
+  catch(Standard_Failure)
   {
     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
   }
@@ -285,12 +287,12 @@ bool isCorrectArg( const Handle( Expr_GeneralExpression )& expr )
 bool StdMeshersGUI_DistrPreview::init( const QString& str )
 {
   bool parsed_ok = true;
-  CASCatch_TRY
-  {
+  try {
+    OCC_CATCH_SIGNALS;
     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 +329,11 @@ double StdMeshersGUI_DistrPreview::calc( bool& ok )
   double res = 0.0;
 
   ok = true;
-  CASCatch_TRY {   
+  try {   
+    OCC_CATCH_SIGNALS;
     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,15 +354,15 @@ bool StdMeshersGUI_DistrPreview::convert( double& v ) const
   {
   case EXPONENT:
     {
-      CASCatch_TRY
-      { 
+      try { 
+        OCC_CATCH_SIGNALS;
        // 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;