0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39
[occt.git] / src / CPnts / CPnts_AbscissaPoint.cxx
index c50baa0..b40750e 100644 (file)
 //  by succsessive iteration find the point and its associated parameter
 //  call to FunctionRoot
 
-#include <CPnts_AbscissaPoint.ixx>
-
-#include <math_GaussSingleIntegration.hxx>
-#include <math_FunctionRoot.hxx>
-#include <StdFail_NotDone.hxx>
-#include <Standard_ConstructionError.hxx>
-
-#include <gp_Vec.hxx>
-#include <gp_Vec2d.hxx>
-#include <Geom_BezierCurve.hxx>
-#include <Geom_BSplineCurve.hxx>
+#include <Adaptor2d_Curve2d.hxx>
+#include <Adaptor3d_Curve.hxx>
+#include <CPnts_AbscissaPoint.hxx>
 #include <Geom2d_BezierCurve.hxx>
 #include <Geom2d_BSplineCurve.hxx>
+#include <Geom_BezierCurve.hxx>
+#include <Geom_BSplineCurve.hxx>
+#include <gp_Vec.hxx>
+#include <gp_Vec2d.hxx>
+#include <math_FunctionRoot.hxx>
+#include <math_GaussSingleIntegration.hxx>
 #include <Precision.hxx>
+#include <Standard_ConstructionError.hxx>
+#include <StdFail_NotDone.hxx>
 
 // auxiliary functions to compute the length of the derivative
-
 static Standard_Real f3d(const Standard_Real X, const Standard_Address C)
 {
-  gp_Vec V = ((Adaptor3d_Curve*)C)->DN(X,1);
+  gp_Pnt P;
+  gp_Vec V;
+  ((Adaptor3d_Curve*)C)->D1(X,P,V);
   return V.Magnitude();
 }
 
 static Standard_Real f2d(const Standard_Real X, const Standard_Address C)
 {
-  gp_Vec2d V = ((Adaptor2d_Curve2d*)C)->DN(X,1);
+  gp_Pnt2d P;
+  gp_Vec2d V;
+  ((Adaptor2d_Curve2d*)C)->D1(X,P,V);
   return V.Magnitude();
 }
 
@@ -156,7 +159,7 @@ Standard_Real CPnts_AbscissaPoint::Length(const Adaptor3d_Curve& C,
 //  FG.Init(f3d,(Standard_Address)&C);
   math_GaussSingleIntegration TheLength(FG, U1, U2, order(C));
   if (!TheLength.IsDone()) {
-    Standard_ConstructionError::Raise();
+    throw Standard_ConstructionError();
   }
   return Abs(TheLength.Value());
 }
@@ -177,7 +180,7 @@ Standard_Real CPnts_AbscissaPoint::Length(const Adaptor2d_Curve2d& C,
 //  FG.Init(f2d,(Standard_Address)&C);
   math_GaussSingleIntegration TheLength(FG, U1, U2, order(C));
   if (!TheLength.IsDone()) {
-    Standard_ConstructionError::Raise();
+    throw Standard_ConstructionError();
   }
   return Abs(TheLength.Value());
 }
@@ -199,7 +202,7 @@ Standard_Real CPnts_AbscissaPoint::Length(const Adaptor3d_Curve& C,
 //  FG.Init(f3d,(Standard_Address)&C);
   math_GaussSingleIntegration TheLength(FG, U1, U2, order(C), Tol);
   if (!TheLength.IsDone()) {
-    Standard_ConstructionError::Raise();
+    throw Standard_ConstructionError();
   }
   return Abs(TheLength.Value());
 }
@@ -221,7 +224,7 @@ Standard_Real CPnts_AbscissaPoint::Length(const Adaptor2d_Curve2d& C,
 //  FG.Init(f2d,(Standard_Address)&C);
   math_GaussSingleIntegration TheLength(FG, U1, U2, order(C), Tol);
   if (!TheLength.IsDone()) {
-    Standard_ConstructionError::Raise();
+    throw Standard_ConstructionError();
   }
   return Abs(TheLength.Value());
 }