Salome HOME
Merge branch 'V9_2_2_BR'
[modules/geom.git] / src / GEOMAlgo / GEOMAlgo_Gluer2_1.cxx
index 400613da76298888a0f8f26a8994d06db7c3d69d..590bf2211f0bada8dc1df29403cf8efdc0cc67c7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2019  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
@@ -6,7 +6,7 @@
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 #include <TopTools_ListIteratorOfListOfShape.hxx>
 #include <TopTools_ListOfShape.hxx>
 
-#include <BOPTools_Tools.hxx>
-#include <BOPTools_Tools2D.hxx>
-#include <BOPTools_Tools3D.hxx>
-
-#include <GEOMAlgo_Tools.hxx>
+#include <BOPTools_AlgoTools.hxx>
+#include <GEOMAlgo_AlgoTools.hxx>
+#include <BOPTools_AlgoTools2D.hxx>
 
 //=======================================================================
 //function : MakeBRepShapes
@@ -100,7 +98,6 @@ void GEOMAlgo_Gluer2::MakeFace(const TopoDS_Face& theF,
   Standard_Boolean bIsToReverse, bIsUPeriodic;
   Standard_Integer iRet;
   Standard_Real aTol, aUMin, aUMax, aVMin, aVMax;
-  TopAbs_Orientation aOrE;
   Handle(Geom_Surface) aS;
   TopLoc_Location aLoc;
   TopoDS_Shape aW, aWr;
@@ -118,7 +115,7 @@ void GEOMAlgo_Gluer2::MakeFace(const TopoDS_Face& theF,
   //
   aTol=BRep_Tool::Tolerance(aFF);
   aS=BRep_Tool::Surface(aFF, aLoc);
-  bIsUPeriodic=GEOMAlgo_Tools::IsUPeriodic(aS);
+  bIsUPeriodic=GEOMAlgo_AlgoTools::IsUPeriodic(aS);
   BRepTools::UVBounds(aFF, aUMin, aUMax, aVMin, aVMax);
   //
   aBB.MakeFace (aFnew, aS, aLoc, aTol);
@@ -160,22 +157,26 @@ void GEOMAlgo_Gluer2::MakeFace(const TopoDS_Face& theF,
       //
       if (!BRep_Tool::Degenerated(aEx)) {
         aEx.Orientation(TopAbs_FORWARD);
+        TopoDS_Edge aE_forward = aE;
+        aE_forward.Orientation(TopAbs_FORWARD);
         if (bIsUPeriodic) {
-          GEOMAlgo_Tools::RefinePCurveForEdgeOnFace(aEx, aFF, aUMin, aUMax);
+          GEOMAlgo_AlgoTools::RefinePCurveForEdgeOnFace(aEx, aFF, aUMin, aUMax);
         }
         //
         //modified by NIZNHY-PKV Fri Feb 03 11:18:17 2012f
-        iRet=GEOMAlgo_Tools::BuildPCurveForEdgeOnFace(aE, aEx, aFF, myContext);
+        iRet=GEOMAlgo_AlgoTools::BuildPCurveForEdgeOnFace(aE_forward, aEx, aFF, myContext);
         if (iRet) {
           continue;
         }
-        //BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aEx, aFF);
         //modified by NIZNHY-PKV Fri Feb 03 11:18:20 2012t
         //
-        bIsToReverse=BOPTools_Tools3D::IsSplitToReverse1(aEx, aE, myContext);
-        if (bIsToReverse) {
+        bIsToReverse=GEOMAlgo_AlgoTools::IsSplitToReverse(aEx, aE_forward, myContext);
+        //bIsToReverse=BOPTools_AlgoTools::IsSplitToReverse(aEx, aE, myContext);
+
+        aEx.Orientation(aE.Orientation());
+        
+        if (bIsToReverse)
           aEx.Reverse();
-        }
       }
       else {
         aEx.Orientation(aE.Orientation());
@@ -224,7 +225,7 @@ void GEOMAlgo_Gluer2::MakeEdge(const TopoDS_Edge& aE,
   aVR2.Orientation(TopAbs_REVERSED);
   //
   if (!bIsDE) {
-    BOPTools_Tools::MakeSplitEdge(aEx, aVR1, aT1, aVR2, aT2, aNewEdge);
+    BOPTools_AlgoTools::MakeSplitEdge(aEx, aVR1, aT1, aVR2, aT2, aNewEdge);
   }
   else {
     Standard_Real aTol;