0032450: Modeling Algorithms - change BRepLib_CheckCurveOnSurface & GeomLib_CheckCurv...
[occt.git] / src / IntTools / IntTools_Tools.cxx
index a50033b..bf7b91e 100644 (file)
@@ -21,6 +21,7 @@
 #include <BRepAdaptor_Surface.hxx>
 #include <Geom2d_Curve.hxx>
 #include <Geom2d_TrimmedCurve.hxx>
+#include <Geom2dAdaptor_Curve.hxx>
 #include <Geom_BoundedCurve.hxx>
 #include <Geom_Curve.hxx>
 #include <Geom_Geometry.hxx>
@@ -797,8 +798,16 @@ Standard_Boolean IntTools_Tools::ComputeTolerance
 {
   GeomLib_CheckCurveOnSurface aCS;
   //
-  aCS.Init(theCurve3D, theSurf, theFirst, theLast, theTolRange);
-  aCS.Perform (theCurve2D, theToRunParallel);
+  const Handle(Adaptor3d_Curve) aGeomAdaptorCurve = new GeomAdaptor_Curve(theCurve3D, theFirst, theLast);
+
+  Handle(Adaptor2d_Curve2d) aGeom2dAdaptorCurve = new Geom2dAdaptor_Curve(theCurve2D, theFirst, theLast);
+  Handle(GeomAdaptor_Surface) aGeomAdaptorSurface = new GeomAdaptor_Surface(theSurf);
+
+  Handle(Adaptor3d_CurveOnSurface) anAdaptor3dCurveOnSurface =
+    new Adaptor3d_CurveOnSurface(aGeom2dAdaptorCurve, aGeomAdaptorSurface);
+
+  aCS.Init(aGeomAdaptorCurve, theTolRange);
+  aCS.Perform(anAdaptor3dCurveOnSurface, theToRunParallel);
   if (!aCS.IsDone()) {
     return Standard_False;
   }