Salome HOME
Join modifications from branch BR_For_OCT_611: migration to OCCT6.1.1 with new except... V3_2_2pre
authorjfa <jfa@opencascade.com>
Mon, 4 Sep 2006 11:39:20 +0000 (11:39 +0000)
committerjfa <jfa@opencascade.com>
Mon, 4 Sep 2006 11:39:20 +0000 (11:39 +0000)
src/SMESH/SMESH_subMesh.cxx
src/SMESH_I/SMESH_MeshEditor_i.cxx
src/StdMeshers/StdMeshers_Distribution.cxx
src/StdMeshers/StdMeshers_NumberOfSegments.cxx
src/StdMeshers/StdMeshers_Regular_1D.cxx
src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx

index c968ac91a4f1ed1d06e33bdf05197a4a3c274b66..6413b8031826769596f8d8c2a5ac8f9ca9dd8853 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -1265,6 +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
index 5227a966814a6402f36fd1a38fc10e9f017403a2..55fc2330dc48efb2f66ea72cad6967ad88b223e6 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -37,7 +37,6 @@
 #include "SMESH_Gen_i.hxx"
 #include "SMESH_Filter_i.hxx"
 #include "SMESH_PythonDump.hxx"
-#include "CASCatch.hxx"
 
 #include "utilities.h"
 
 #include <gp_Ax2.hxx>
 #include <gp_Vec.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
+
 #include <sstream>
 
 typedef map<const SMDS_MeshElement*,
@@ -1052,15 +1063,20 @@ void SMESH_MeshEditor_i::ExtrusionSweep(const SMESH::long_array & theIDsOfElemen
   myLastCreatedElems = new SMESH::long_array();
   myLastCreatedNodes = new SMESH::long_array();
 
-  CASCatch_TRY {   
+#ifdef NO_CAS_CATCH
+  try {   
+    OCC_CATCH_SIGNALS;
+#else
+  CASCatch_TRY {
+#endif
     SMESHDS_Mesh* aMesh = GetMeshDS();
-    
+
     map<int,const SMDS_MeshElement*> elements;
     ToMap(theIDsOfElements, aMesh, elements);
 
     const SMESH::PointStruct * P = &theStepVector.PS;
     gp_Vec stepVec( P->x, P->y, P->z );
-    
+
     TElemOfElemListMap aHystory;
     ::SMESH_MeshEditor anEditor( _myMesh );
     anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps, aHystory);
@@ -1070,10 +1086,13 @@ void SMESH_MeshEditor_i::ExtrusionSweep(const SMESH::long_array & theIDsOfElemen
     // Update Python script
     TPythonDump() << "stepVector = " << theStepVector;
     TPythonDump() << this << ".ExtrusionSweep( "
-                 << theIDsOfElements << ", stepVector, " << theNbOfSteps << " )";
+                  << theIDsOfElements << ", stepVector, " << theNbOfSteps << " )";
 
-  }
-  CASCatch_CATCH(Standard_Failure) {
+#ifdef NO_CAS_CATCH
+  } catch(Standard_Failure) {
+#else
+  } CASCatch_CATCH(Standard_Failure) {
+#endif
     Handle(Standard_Failure) aFail = Standard_Failure::Caught();          
     INFOS( "SMESH_MeshEditor_i::ExtrusionSweep fails - "<< aFail->GetMessageString() );
   }
index 815b708f63a0210b391b97be247f3d63e6c63f62..989fcf3ced6cd7b4ed6db6c4cfdf0c4e5caebef1 100644 (file)
 //  $Header$
 
 #include "StdMeshers_Distribution.hxx"
-#include "CASCatch.hxx"
 
 #include <math_GaussSingleIntegration.hxx>
 #include <utilities.h>
 
+#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
+
 Function::Function( const int conv )
 : myConv( conv )
 {
@@ -44,14 +55,19 @@ Function::~Function()
 bool Function::value( const double, double& f ) const
 {
   bool ok = true;
-  if( myConv==0 )
-  {
-    CASCatch_TRY
-    {
+  if (myConv == 0) {
+#ifdef NO_CAS_CATCH
+    try {
+      OCC_CATCH_SIGNALS;
+#else
+    CASCatch_TRY {
+#endif
       f = pow( 10, f );
-    }
-    CASCatch_CATCH(Standard_Failure)
-    {
+#ifdef NO_CAS_CATCH
+    } catch(Standard_Failure) {
+#else
+    } CASCatch_CATCH(Standard_Failure) {
+#endif
       Handle(Standard_Failure) aFail = Standard_Failure::Caught();
       f = 0.0;
       ok = false;
@@ -170,13 +186,19 @@ FunctionExpr::FunctionExpr( const char* str, const int conv )
   myValues( 1, 1 )
 {
   bool 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 );
-  }
-  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;
   }
@@ -206,10 +228,18 @@ bool FunctionExpr::value( const double t, double& f ) const
 
   ( ( TColStd_Array1OfReal& )myValues ).ChangeValue( 1 ) = t;
   bool ok = true;
+#ifdef NO_CAS_CATCH
+  try {
+    OCC_CATCH_SIGNALS;
+#else
   CASCatch_TRY {
+#endif
     f = 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();
     f = 0.0;
     ok = false;
@@ -222,15 +252,21 @@ bool FunctionExpr::value( const double t, double& f ) const
 double FunctionExpr::integral( const double a, const double b ) const
 {
   double res = 0.0;
+#ifdef NO_CAS_CATCH
+  try {
+    OCC_CATCH_SIGNALS;
+#else
   CASCatch_TRY {
-    // skl for IPAL13079 (bug on Mandriva) - other cast
-    //math_GaussSingleIntegration _int( ( math_Function& )*this, a, b, 20 );
-    math_GaussSingleIntegration _int( *static_cast<math_Function*>( const_cast<FunctionExpr*> (this) ), a, b, 20 );
+#endif
+    math_GaussSingleIntegration _int
+      ( *static_cast<math_Function*>( const_cast<FunctionExpr*> (this) ), a, b, 20 );
     if( _int.IsDone() )
       res = _int.Value();
-  }
-  CASCatch_CATCH(Standard_Failure)
-  {
+#ifdef NO_CAS_CATCH
+  } catch(Standard_Failure) {
+#else
+  } CASCatch_CATCH(Standard_Failure) {
+#endif
     res = 0.0;
     MESSAGE( "Exception in integral calculating" );
   }
index 76cd67965ccfda360d1dfd8f9ab4c64f322a2e8a..f4819f92c0fd0ec66996ad502700954cdc1c6ba9 100644 (file)
@@ -33,8 +33,6 @@
 #include "SMESHDS_SubMesh.hxx"
 #include "SMESH_Mesh.hxx"
 
-#include "CASCatch.hxx"
-
 #include <ExprIntrp_GenExp.hxx>
 #include <Expr_Array1OfNamedUnknown.hxx>
 #include <Expr_NamedUnknown.hxx>
 #include <TopExp.hxx>
 #include <TopTools_IndexedMapOfShape.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
+
 using namespace std;
 
 const double PRECISION = 1e-7;
@@ -218,12 +228,18 @@ void StdMeshers_NumberOfSegments::SetTableFunction(const std::vector<double>& ta
     double val = table[i*2+1];
     if( _convMode==0 )
     {
-      CASCatch_TRY
-      {
+#ifdef NO_CAS_CATCH
+      try {
+        OCC_CATCH_SIGNALS;
+#else
+      CASCatch_TRY {
+#endif
        val = pow( 10.0, val );
-      }
-      CASCatch_CATCH(Standard_Failure)
-      {
+#ifdef NO_CAS_CATCH
+      } catch(Standard_Failure) {
+#else
+      } CASCatch_CATCH(Standard_Failure) {
+#endif
        Handle(Standard_Failure) aFail = Standard_Failure::Caught();
        throw SALOME_Exception( LOCALIZED( "invalid value"));
        return;
@@ -312,13 +328,19 @@ bool process( const TCollection_AsciiString& str, int convMode,
 {
   bool parsed_ok = true;
   Handle( ExprIntrp_GenExp ) myExpr;
-  CASCatch_TRY
-  {
+#ifdef NO_CAS_CATCH
+  try {
+    OCC_CATCH_SIGNALS;
+#else
+  CASCatch_TRY {
+#endif
     myExpr = ExprIntrp_GenExp::Create();
     myExpr->Process( str.ToCString() );
-  }
-  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;
   }
index f13f1cbce7006c94025f0a9a0f38868b06117c60..d933aebbfd6e1c967fe7bc5c9a6c1af29b5445cc 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -31,10 +31,6 @@ using namespace std;
 
 #include "StdMeshers_Regular_1D.hxx"
 #include "StdMeshers_Distribution.hxx"
-#include "SMESH_Gen.hxx"
-#include "SMESH_Mesh.hxx"
-#include "SMESH_HypoFilter.hxx"
-#include "SMESH_subMesh.hxx"
 
 #include "StdMeshers_LocalLength.hxx"
 #include "StdMeshers_NumberOfSegments.hxx"
@@ -43,6 +39,11 @@ using namespace std;
 #include "StdMeshers_Deflection1D.hxx"
 #include "StdMeshers_AutomaticLength.hxx"
 
+#include "SMESH_Gen.hxx"
+#include "SMESH_Mesh.hxx"
+#include "SMESH_HypoFilter.hxx"
+#include "SMESH_subMesh.hxx"
+
 #include "SMDS_MeshElement.hxx"
 #include "SMDS_MeshNode.hxx"
 #include "SMDS_EdgePosition.hxx"
@@ -58,15 +59,17 @@ using namespace std;
 #include <GCPnts_AbscissaPoint.hxx>
 #include <GCPnts_UniformAbscissa.hxx>
 #include <GCPnts_UniformDeflection.hxx>
-#include <Standard_ErrorHandler.hxx>
 #include <Precision.hxx>
 #include <Expr_GeneralExpression.hxx>
 #include <Expr_NamedUnknown.hxx>
 #include <Expr_Array1OfNamedUnknown.hxx>
-#include <TColStd_Array1OfReal.hxx>
 #include <ExprIntrp_GenExp.hxx>
+#include <TColStd_Array1OfReal.hxx>
 #include <OSD.hxx>
 
+#include <Standard_ErrorHandler.hxx>
+#include <Standard_Failure.hxx>
+
 #include <string>
 #include <math.h>
 
@@ -572,6 +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" <<endl;
         return false;
index e1a410cbaaa36e60cb73d82112ab522f4e641c4e..482aeb6be4bd01a31736297b15d0e8833383bb25 100644 (file)
 //
 
 #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 ),
@@ -240,12 +251,18 @@ void StdMeshersGUI_DistrPreview::update()
   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();
   }
 }
@@ -285,13 +302,19 @@ bool isCorrectArg( const Handle( Expr_GeneralExpression )& expr )
 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;
   }
@@ -327,10 +350,18 @@ double StdMeshersGUI_DistrPreview::calc( bool& ok )
   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;
@@ -351,16 +382,22 @@ bool StdMeshersGUI_DistrPreview::convert( double& v ) const
   {
   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;