0026431: Can't cut a sphere from a cylinder
[occt.git] / src / HLRTopoBRep / HLRTopoBRep_DSFiller.cxx
index 9a60fb6..44beb38 100644 (file)
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#include <HLRTopoBRep_DSFiller.ixx>
 
-#include <TopoDS.hxx>
-#include <TopExp.hxx>
-#include <TopExp_Explorer.hxx>
-#include <math_Vector.hxx>
-#include <TColgp_Array1OfPnt.hxx>
-#include <TColgp_Array1OfPnt2d.hxx>
-#include <TColStd_Array1OfReal.hxx>
-#include <TColStd_Array1OfInteger.hxx>
-#include <Geom_Line.hxx>
-#include <Geom_Circle.hxx>
-#include <Geom_Surface.hxx>
-#include <Geom_BSplineCurve.hxx>
-#include <GeomProjLib.hxx>
-#include <Geom2d_Curve.hxx>
-#include <Geom2d_BSplineCurve.hxx>
 #include <AppDef_BSplineCompute.hxx>
 #include <AppDef_MultiLine.hxx>
 #include <AppDef_MultiPointConstraint.hxx>
 #include <AppParCurves_MultiBSpCurve.hxx>
-#include <HLRTopoBRep_FaceIsoLiner.hxx>
-#include <BRep_Tool.hxx>
 #include <BRep_Builder.hxx>
+#include <BRep_CurveRepresentation.hxx>
+#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
+#include <BRep_TEdge.hxx>
+#include <BRep_Tool.hxx>
 #include <BRepAdaptor_Curve.hxx>
 #include <BRepAdaptor_Curve2d.hxx>
 #include <BRepAdaptor_HCurve2d.hxx>
+#include <BRepApprox_Approx.hxx>
+#include <BRepApprox_ApproxLine.hxx>
+#include <BRepExtrema_ExtPC.hxx>
 #include <BRepTopAdaptor_HVertex.hxx>
-#include <BRepTopAdaptor_TopolTool.hxx>
 #include <BRepTopAdaptor_Tool.hxx>
-#include <Contap_TheLineOfContour.hxx>
+#include <BRepTopAdaptor_TopolTool.hxx>
+#include <Contap_Contour.hxx>
+#include <Contap_Line.hxx>
+#include <Contap_Point.hxx>
 #include <Extrema_LocateExtPC.hxx>
-#include <Standard_ProgramError.hxx>
+#include <Geom2d_BSplineCurve.hxx>
+#include <Geom2d_Curve.hxx>
+#include <Geom_BSplineCurve.hxx>
+#include <Geom_Circle.hxx>
+#include <Geom_Line.hxx>
+#include <Geom_Surface.hxx>
+#include <GeomProjLib.hxx>
+#include <HLRTopoBRep_Data.hxx>
+#include <HLRTopoBRep_DSFiller.hxx>
+#include <HLRTopoBRep_FaceIsoLiner.hxx>
+#include <math_Vector.hxx>
 #include <Precision.hxx>
-#include <BRepApprox_ApproxLine.hxx>
-#include <BRepApprox_Approx.hxx>
-#include <BRep_TEdge.hxx>
-#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
-#include <BRep_CurveRepresentation.hxx>
-#include <BRepExtrema_ExtPC.hxx>
+#include <Standard_ProgramError.hxx>
+#include <TColgp_Array1OfPnt.hxx>
+#include <TColgp_Array1OfPnt2d.hxx>
+#include <TColStd_Array1OfInteger.hxx>
+#include <TColStd_Array1OfReal.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Face.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Vertex.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
 
 #define INTERPOLATE 0
@@ -197,7 +204,7 @@ void  HLRTopoBRep_DSFiller::InsertFace (const Standard_Integer /*FI*/,
   Standard_Integer CurLine;
   for (CurLine = 1; CurLine <= NbLines; CurLine++)
   {
-    const Contap_TheLineOfContour& Line = FO.Line(CurLine);
+    const Contap_Line& Line = FO.Line(CurLine);
     const Standard_Integer NbPoints = Line.NbVertex();
     Standard_Integer CurPoint;
     if (Line.TypeContour() == Contap_Restriction)
@@ -209,7 +216,7 @@ void  HLRTopoBRep_DSFiller::InsertFace (const Standard_Integer /*FI*/,
       // insert the Internal points.
 
       for (CurPoint = 1; CurPoint <= NbPoints; CurPoint++) {
-        Contap_ThePointOfContour P = Line.Vertex(CurPoint);
+        Contap_Point P = Line.Vertex(CurPoint);
         if (P.IsInternal()) {
           if (P.Value().IsEqual(BRep_Tool::Pnt(VF),BRep_Tool::Tolerance(VF))) {
             if (P.Value().IsEqual(BRep_Tool::Pnt(VL),BRep_Tool::Tolerance(VL))) {
@@ -223,7 +230,7 @@ void  HLRTopoBRep_DSFiller::InsertFace (const Standard_Integer /*FI*/,
     {
       for (CurPoint = 1; CurPoint <= NbPoints; CurPoint++) {
 
-        const Contap_ThePointOfContour PF = Line.Vertex(CurPoint);
+        const Contap_Point PF = Line.Vertex(CurPoint);
         if (PF.IsInternal() && CurPoint != 1)
           VF = VL;
         else
@@ -231,7 +238,7 @@ void  HLRTopoBRep_DSFiller::InsertFace (const Standard_Integer /*FI*/,
         const Standard_Real parF = PF.ParameterOnLine();
 
         if (CurPoint < NbPoints) {
-          const Contap_ThePointOfContour PL = Line.Vertex(CurPoint+1);
+          const Contap_Point PL = Line.Vertex(CurPoint+1);
           VL = MakeVertex(PL,tol,DS);
           const Standard_Real parL = PL.ParameterOnLine();
 
@@ -284,7 +291,7 @@ void  HLRTopoBRep_DSFiller::InsertFace (const Standard_Integer /*FI*/,
 /*
                else if(ipL-ipF < 6) { 
                  // compute the tangents
-                 Contap_TheSurfFunctionOfContour& SFunc =
+                 Contap_SurfFunction& SFunc =
                    FO.SurfaceFunction();
                  
                  Standard_Boolean isTg1,isTg2;
@@ -443,7 +450,7 @@ void  HLRTopoBRep_DSFiller::InsertFace (const Standard_Integer /*FI*/,
                  
                   //-- cout<<"\nHLRTopoBRep_DSFiller : nbp="<<nbp<<"  Tol3d="<<TOL3d<<"   Tol2d="<<TOL2d<<endl;
 
-                  Approx.SetParameters(TOL3d,TOL2d,dmin,dmax,niter,tg);
+                  Approx.SetParameters(TOL3d, TOL2d, dmin, dmax, niter, 30, tg);
                   Approx.Perform(AppLine,Standard_True,Standard_True,Standard_False,1,nbp);
                   if (!Approx.IsDone()) {
                     C = AppC;
@@ -488,7 +495,6 @@ void  HLRTopoBRep_DSFiller::InsertFace (const Standard_Integer /*FI*/,
               B.Range(E,first,last);
 
               if (!C2d.IsNull()) {
-                BRep_Builder B;
                 B.UpdateEdge(E,C2d,F,BRep_Tool::Tolerance(F));
               }
              
@@ -553,7 +559,7 @@ void  HLRTopoBRep_DSFiller::InsertFace (const Standard_Integer /*FI*/,
 //=======================================================================
 
 TopoDS_Vertex
-HLRTopoBRep_DSFiller::MakeVertex (const Contap_ThePointOfContour& P,
+HLRTopoBRep_DSFiller::MakeVertex (const Contap_Point& P,
                                  const Standard_Real tol,
                                  HLRTopoBRep_Data& DS)
 {
@@ -611,7 +617,7 @@ HLRTopoBRep_DSFiller::MakeVertex (const Contap_ThePointOfContour& P,
 //=======================================================================
 
 void
-HLRTopoBRep_DSFiller::InsertVertex (const Contap_ThePointOfContour& P,
+HLRTopoBRep_DSFiller::InsertVertex (const Contap_Point& P,
                                    const Standard_Real tol,
                                    const TopoDS_Edge& E,
                                    HLRTopoBRep_Data& DS)