Salome HOME
Mantis 0054772: crash when select point in viewer inside created face
[modules/geom.git] / src / GEOMAlgo / GEOMAlgo_Gluer2_3.cxx
index 5ccb17521a8a392092fcb5b20ac1df764b952f81..94007d5990b4d376b5a0e958457e5ee51e70e89c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2012  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
@@ -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_IndexedMapOfShape.hxx>
 
-#include <NMTTools_CoupleOfShape.hxx>
-#include <NMTTools_ListOfCoupleOfShape.hxx>
-#include <NMTTools_ListIteratorOfListOfCoupleOfShape.hxx>
-#include <NMTTools_IndexedDataMapOfShapeIndexedMapOfShape.hxx>
-#include <NMTTools_Tools.hxx>
+#include <GEOMAlgo_CoupleOfShapes.hxx>
+#include <GEOMAlgo_ListOfCoupleOfShapes.hxx>
+#include <GEOMAlgo_ListIteratorOfListOfCoupleOfShapes.hxx>
 
+#include <GEOMAlgo_AlgoTools.hxx>
 #include <GEOMAlgo_GlueDetector.hxx>
+#include <GEOMAlgo_IndexedDataMapOfShapeIndexedMapOfShape.hxx>
 
 
 static
@@ -65,7 +65,7 @@ static
 void GEOMAlgo_Gluer2::Detect()
 {
   Standard_Boolean bCheckGeometry;
-  Standard_Integer iErr, aNbSD;
+  Standard_Integer iErr;
   TopTools_ListIteratorOfListOfShape aItLS;
   TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItDMSLS;
   //GEOMAlgo_GlueDetector aDetector;
@@ -106,7 +106,6 @@ void GEOMAlgo_Gluer2::Detect()
   for (; aItDMSLS.More(); aItDMSLS.Next()) {
     const TopoDS_Shape& aSkey=aItDMSLS.Key();
     const TopTools_ListOfShape& aLSD=aItDMSLS.Value();
-    aNbSD=aLSD.Extent();
     myImagesDetected.Bind(aSkey, aLSD);
   }
   //
@@ -130,9 +129,9 @@ void GEOMAlgo_Gluer2::PerformShapesToWork()
   Standard_Integer aNbSG, i, j, k, aNbC, aNb, aNbSD;
   TopTools_ListIteratorOfListOfShape aItLS1, aItLS2;
   TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItDMSLS;
-  NMTTools_CoupleOfShape aCS;
-  NMTTools_ListOfCoupleOfShape aLCS;
-  NMTTools_ListIteratorOfListOfCoupleOfShape aItCS;
+  GEOMAlgo_CoupleOfShapes aCS;
+  GEOMAlgo_ListOfCoupleOfShapes aLCS;
+  GEOMAlgo_ListIteratorOfListOfCoupleOfShapes aItCS;
   //
   myErrorStatus=0;
   myWarningStatus=0;
@@ -186,9 +185,9 @@ void GEOMAlgo_Gluer2::PerformShapesToWork()
   //
   // 2. Find Chains
   TopTools_ListOfShape aLSX;
-  NMTTools_IndexedDataMapOfShapeIndexedMapOfShape aMC;
+  GEOMAlgo_IndexedDataMapOfShapeIndexedMapOfShape aMC;
   //
-  NMTTools_Tools::FindChains(aLCS, aMC);
+  GEOMAlgo_AlgoTools::FindChains(aLCS, aMC);
   //
   // 3. myImagesToWork, myOriginsToWork
   aNbC=aMC.Extent();
@@ -209,8 +208,8 @@ void GEOMAlgo_Gluer2::PerformShapesToWork()
 //function : TreatPair
 //purpose  :
 //=======================================================================
-void GEOMAlgo_Gluer2::TreatPair(const NMTTools_CoupleOfShape& aCS,
-                                NMTTools_ListOfCoupleOfShape& aLCS)
+void GEOMAlgo_Gluer2::TreatPair(const GEOMAlgo_CoupleOfShapes& aCS,
+                                GEOMAlgo_ListOfCoupleOfShapes& aLCS)
 {
   if (myErrorStatus) {
     return;
@@ -222,7 +221,7 @@ void GEOMAlgo_Gluer2::TreatPair(const NMTTools_CoupleOfShape& aCS,
   TopTools_IndexedMapOfShape aMS1, aMS2;
   TopTools_DataMapOfShapeListOfShape aDMSLS;
   TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItDMSLS;
-  NMTTools_CoupleOfShape aCSS;
+  GEOMAlgo_CoupleOfShapes aCSS;
   //
   // 1. Checking the pair on whether it can be glued at all
   // 1.1