0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39
[occt.git] / src / ShapeConstruct / ShapeConstruct_Curve.cxx
index 38bee6f..9180f63 100644 (file)
@@ -2,8 +2,8 @@
 //
 // This file is part of Open CASCADE Technology software library.
 //
-// This library is free software; you can redistribute it and / or modify it
-// under the terms of the GNU Lesser General Public version 2.1 as published
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
 // by the Free Software Foundation, with special exception defined in the file
 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
 // distribution for complete text of the license and disclaimer of any warranty.
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#include <ShapeConstruct_Curve.ixx>
-
-#include <Standard_ErrorHandler.hxx>
-#include <Standard_Failure.hxx>
-
-#include <gp_Vec.hxx>
-#include <gp_Dir.hxx>
-#include <gp_Lin.hxx>
 
+#include <Approx_Curve2d.hxx>
+#include <Approx_Curve3d.hxx>
 #include <ElCLib.hxx>
-#include <Precision.hxx>
-
-#include <Geom_BSplineCurve.hxx>
-#include <Geom_BezierCurve.hxx>
-#include <Geom_TrimmedCurve.hxx>
-#include <Geom_Line.hxx>
-
-#include <Geom2d_BSplineCurve.hxx>
 #include <Geom2d_BezierCurve.hxx>
-#include <Geom2d_TrimmedCurve.hxx>
+#include <Geom2d_BSplineCurve.hxx>
+#include <Geom2d_Curve.hxx>
 #include <Geom2d_Line.hxx>
-
-#include <GeomConvert.hxx>
-#include <GeomAdaptor_HCurve.hxx>
-#include <Approx_Curve3d.hxx>
-
-#include <Geom2dConvert.hxx>
+#include <Geom2d_TrimmedCurve.hxx>
 #include <Geom2dAdaptor_HCurve.hxx>
-#include <Approx_Curve2d.hxx>
+#include <Geom2dConvert.hxx>
+#include <Geom_BezierCurve.hxx>
+#include <Geom_BSplineCurve.hxx>
+#include <Geom_Curve.hxx>
+#include <Geom_Line.hxx>
+#include <Geom_TrimmedCurve.hxx>
+#include <GeomAdaptor_HCurve.hxx>
+#include <GeomConvert.hxx>
+#include <gp_Dir.hxx>
+#include <gp_Lin.hxx>
+#include <gp_Pnt.hxx>
+#include <gp_Pnt2d.hxx>
+#include <gp_Vec.hxx>
+#include <Precision.hxx>
+#include <ShapeConstruct_Curve.hxx>
+#include <Standard_ErrorHandler.hxx>
+#include <Standard_Failure.hxx>
 
 //sln 29.12.2001 OCC90 : Method FixKnots was added
-
 //=======================================================================
 //function : AdjustCurve
 //purpose  : 
 //=======================================================================
-
 Standard_Boolean ShapeConstruct_Curve::AdjustCurve(const Handle(Geom_Curve)& C3D,const gp_Pnt& P1,const gp_Pnt& P2,const Standard_Boolean take1,const Standard_Boolean take2) const
 {
   if (!take1 && !take2) return Standard_True;
@@ -157,11 +153,12 @@ Handle(Geom_BSplineCurve) ShapeConstruct_Curve::ConvertToBSpline (const Handle(G
       OCC_CATCH_SIGNALS
       bspl = GeomConvert::CurveToBSplineCurve(tc);
     }
-    catch ( Standard_Failure ) {
-#ifdef DEB 
-      cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in GeomConvert: ";
-      Standard_Failure::Caught()->Print(cout); cout << endl;
+    catch ( Standard_Failure const& anException) {
+#ifdef OCCT_DEBUG
+      std::cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in GeomConvert: ";
+      anException.Print(std::cout); std::cout << std::endl;
 #endif
+      (void)anException;
     }
   }
 
@@ -178,11 +175,12 @@ Handle(Geom_BSplineCurve) ShapeConstruct_Curve::ConvertToBSpline (const Handle(G
       bspl->Segment ( fbsp, lbsp );
       return bspl;
     }
-    catch ( Standard_Failure ) {
-#ifdef DEB 
-      cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in Segment: ";
-      Standard_Failure::Caught()->Print(cout); cout << endl;
+    catch ( Standard_Failure const& anException) {
+#ifdef OCCT_DEBUG
+      std::cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in Segment: ";
+      anException.Print(std::cout); std::cout << std::endl;
 #endif
+      (void)anException;
     }
   }
 
@@ -196,11 +194,12 @@ Handle(Geom_BSplineCurve) ShapeConstruct_Curve::ConvertToBSpline (const Handle(G
     if ( Conv.IsDone() || Conv.HasResult() ) 
       bspl = Conv.Curve();
   }
-  catch ( Standard_Failure ) {
-#ifdef DEB 
-    cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in Approx_Curve3d: ";
-    Standard_Failure::Caught()->Print(cout); cout << endl;
+  catch (Standard_Failure const& anException) {
+#ifdef OCCT_DEBUG
+    std::cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in Approx_Curve3d: ";
+    anException.Print(std::cout); std::cout << std::endl;
 #endif
+    (void)anException;
   }
   return bspl;
 }
@@ -227,11 +226,12 @@ Handle(Geom2d_BSplineCurve) ShapeConstruct_Curve::ConvertToBSpline (const Handle
       OCC_CATCH_SIGNALS
       bspl = Geom2dConvert::CurveToBSplineCurve(tc);
     }
-    catch ( Standard_Failure ) {
-#ifdef DEB 
-      cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in Geom2dConvert: ";
-      Standard_Failure::Caught()->Print(cout); cout << endl;
+    catch ( Standard_Failure const& anException) {
+#ifdef OCCT_DEBUG
+      std::cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in Geom2dConvert: ";
+      anException.Print(std::cout); std::cout << std::endl;
 #endif
+      (void)anException;
     }
   }
 
@@ -248,11 +248,12 @@ Handle(Geom2d_BSplineCurve) ShapeConstruct_Curve::ConvertToBSpline (const Handle
       bspl->Segment ( fbsp, lbsp );
       return bspl;
     }
-    catch ( Standard_Failure ) {
-#ifdef DEB 
-      cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in Segment: ";
-      Standard_Failure::Caught()->Print(cout); cout << endl;
+    catch ( Standard_Failure const& anException) {
+#ifdef OCCT_DEBUG
+      std::cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in Segment: ";
+      anException.Print(std::cout); std::cout << std::endl;
 #endif
+      (void)anException;
     }
   }
 
@@ -267,11 +268,12 @@ Handle(Geom2d_BSplineCurve) ShapeConstruct_Curve::ConvertToBSpline (const Handle
     if ( Conv.IsDone() || Conv.HasResult() ) 
       bspl = Conv.Curve();
   }
-  catch ( Standard_Failure ) {
-#ifdef DEB 
-    cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in Approx_Curve3d: ";
-    Standard_Failure::Caught()->Print(cout); cout << endl;
+  catch ( Standard_Failure const& anException) {
+#ifdef OCCT_DEBUG
+    std::cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in Approx_Curve3d: ";
+    anException.Print(std::cout); std::cout << std::endl;
 #endif
+    (void)anException;
   }
   return bspl;
 }