Salome HOME
Merge commit '4823245056426a9ccf9c7965daecf11459f58af5' into V9_11_BR
[modules/geom.git] / src / ShHealOper / ShHealOper_FillHoles.cxx
index 799aa8f6ef0bd067bcb30b77d67e341f3d335224..c8e7a5cb264a5e3c2cc98ef70773b4cf70026bd5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 // Created:   26.04.04 17:35:30
 // Author:    Galina KULIKOVA
 
-#include <Basics_OCCTVersion.hxx>
-
 #include <ShapeFix_Shell.hxx>
 #include <ShapeFix_Face.hxx>
 #include <ShHealOper_FillHoles.hxx>
 #include <ShapeAnalysis_FreeBounds.hxx>
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <BRep_Tool.hxx>
 #include <BRepAdaptor_Curve.hxx>
+#if OCC_VERSION_LARGE < 0x07070000
 #include <BRepAdaptor_HCurve.hxx>
+#endif
 #include <BRep_Builder.hxx>
 #include <BRepFill_CurveConstraint.hxx>
 #include <BRepBuilderAPI_MakeFace.hxx>
@@ -232,7 +234,7 @@ Standard_Boolean ShHealOper_FillHoles::prepareWires(const TopTools_SequenceOfSha
       if (!BRep_Tool::Degenerated (TopoDS::Edge (aExp.Current())))
         if(myEdgeFaces.Contains(aExp.Current()) && myEdgeFaces.FindFromKey(aExp.Current()).Extent() >1)
           continue;
-        aSeqEdges->Append(aExp.Current());
+      aSeqEdges->Append(aExp.Current()); // to do: mustn't this clause be within if(!BRep_Tool::Degenerated...)?
     }
   }
 
@@ -286,7 +288,11 @@ Handle(Geom_Surface) ShHealOper_FillHoles::buildSurface(const TopoDS_Wire& theWi
 
       TopoDS_Edge ae = TopoDS::Edge(aIter.Value());
       BRepAdaptor_Curve adC(ae);
-      Handle(BRepAdaptor_HCurve) aHAD= new BRepAdaptor_HCurve(adC);
+#if OCC_VERSION_LARGE < 0x07070000
+      Handle(BRepAdaptor_HCurve) aHAD = new BRepAdaptor_HCurve(adC);
+#else
+      Handle(BRepAdaptor_Curve) aHAD = new BRepAdaptor_Curve(adC);
+#endif
       // Handle(BRepFill_CurveConstraint) aConst =
       //     new BRepFill_CurveConstraint (Handle(Adaptor3d_HCurve)::DownCast(aHAD), (Standard_Integer) GeomAbs_C0, myNbPtsOnCur, myTol3d);
       Handle(GeomPlate_CurveConstraint) aConst =
@@ -321,7 +327,7 @@ Handle(Geom_Surface) ShHealOper_FillHoles::buildSurface(const TopoDS_Wire& theWi
     theSenses    = aBuilder.Sense();
   }
 
-  catch (Standard_Failure) {
+  catch (Standard_Failure&) {
     aSurf.Nullify();
     return aSurf;
   }
@@ -361,7 +367,7 @@ Standard_Boolean ShHealOper_FillHoles::addFace(const Handle(Geom_Surface)& theSu
     aB.Range (anEdge, aFace, aF, aL);
 
     // Set orientation of the edge: orientation should be changed
-    // if its orientation does not make sence with curve orientation
+    // if its orientation does not make sense with curve orientation
     // recommended by GeomPlate
     if ((anEdge.Orientation() == TopAbs_FORWARD) ==
         (theSenses->Value (theOrders->Value (aInd)) == 1)) {