0027719: HLRBrep_Algo incorrect output
[occt.git] / src / Contap / Contap_Contour.cxx
index 74f2124..34c457d 100644 (file)
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#include <Contap_Contour.ixx>
-
-#include <ElCLib.hxx>
-#include <ElSLib.hxx>
-
-#include <math_FunctionSetRoot.hxx>
-
-#include <IntSurf.hxx>
-#include <IntSurf_InteriorPoint.hxx>
-#include <IntSurf_SequenceOfPathPoint.hxx>
-
-#include <TopTrans_CurveTransition.hxx>
-
-#include <TColStd_Array1OfInteger.hxx>
-
-#include <BndLib_AddSurface.hxx>
-#include <Bnd_Box.hxx>
 
+#include <Adaptor3d_HSurface.hxx>
 #include <Adaptor3d_HSurfaceTool.hxx>
-
+#include <Adaptor3d_TopolTool.hxx>
+#include <Bnd_Box.hxx>
+#include <BndLib_AddSurface.hxx>
 #include <Contap_ContAna.hxx>
+#include <Contap_Contour.hxx>
 #include <Contap_HContTool.hxx>
 #include <Contap_HCurve2dTool.hxx>
+#include <Contap_Line.hxx>
+#include <Contap_SurfFunction.hxx>
 #include <Contap_SurfProps.hxx>
 #include <Contap_TheIWalking.hxx>
-#include <Contap_TheSegmentOfTheSearch.hxx>
 #include <Contap_ThePathPointOfTheSearch.hxx>
+#include <Contap_TheSegmentOfTheSearch.hxx>
+#include <ElCLib.hxx>
+#include <ElSLib.hxx>
+#include <gp_Pnt.hxx>
+#include <gp_Vec.hxx>
+#include <IntSurf.hxx>
+#include <IntSurf_InteriorPoint.hxx>
+#include <IntSurf_SequenceOfPathPoint.hxx>
+#include <math_FunctionSetRoot.hxx>
+#include <Standard_ConstructionError.hxx>
+#include <Standard_OutOfRange.hxx>
+#include <StdFail_NotDone.hxx>
+#include <TColStd_Array1OfInteger.hxx>
+#include <TopTrans_CurveTransition.hxx>
 
 #define Tolpetit 1.e-10  // pour dist au carre
 
@@ -466,7 +468,6 @@ static void KeepInsidePoints(const Contap_TheSearchInside& solins,
 
 {
   Standard_Integer Nba = solrst.NbSegments();
-  if (Nba <= 0) return;
   Standard_Integer Nbp,indp,inda;
   Standard_Real U,V,paramproj;
   gp_Pnt2d toproj,Ptproj;
@@ -1015,7 +1016,7 @@ void ComputeInternalPointsOnRstr
     return;
   }
 
-  const Handle_Adaptor2d_HCurve2d& thearc = Line.Arc();
+  const Handle(Adaptor2d_HCurve2d)& thearc = Line.Arc();
 
   const Handle(Adaptor3d_HSurface)& Surf = SFunc.Surface();
   Contap_TFunction TypeFunc(SFunc.FunctionType());
@@ -1462,9 +1463,9 @@ void Contap_Contour::Perform
     //IFV begin
     if(solrst.NbSegments() <= 0) {
       if(mySFunc.FunctionType() == Contap_ContourStd) {
-        const Handle(Adaptor3d_HSurface)& Surf = mySFunc.Surface();
-        if(Adaptor3d_HSurfaceTool::GetType(Surf) == GeomAbs_Torus) {
-          gp_Torus aTor = Adaptor3d_HSurfaceTool::Torus(Surf);
+        const Handle(Adaptor3d_HSurface)& SurfToCheck = mySFunc.Surface();
+        if(Adaptor3d_HSurfaceTool::GetType(SurfToCheck) == GeomAbs_Torus) {
+          gp_Torus aTor = Adaptor3d_HSurfaceTool::Torus(SurfToCheck);
           gp_Dir aTorDir = aTor.Axis().Direction();
           gp_Dir aProjDir = mySFunc.Direction();