Salome HOME
Updated copyright comment
[modules/geom.git] / src / GEOMAlgo / GEOMAlgo_GlueAnalyser.cxx
index 8a7124c3196b52d812008e9c66f1abb456f12bf6..b8cdf27d0fa61f10a6cf368008122b34cb7b05c5 100644 (file)
@@ -1,36 +1,45 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  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.
+// 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, 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
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-// File:       GEOMAlgo_GlueDetector.cxx
-// Created:    Wed Dec 15 11:08:09 2004
-// Author:     Peter KURNEV
-//             <pkv@irinox>
-//
-#include <GEOMAlgo_GlueAnalyser.ixx>
+
+// File:        GEOMAlgo_GlueDetector.cxx
+// Created:     Wed Dec 15 11:08:09 2004
+// Author:      Peter KURNEV
+
+#include <GEOMAlgo_GlueAnalyser.hxx>
+
+#include <Bnd_Box.hxx>
+#include <Bnd_HArray1OfBox.hxx>
+#include <Bnd_BoundSortBox.hxx>
+#include <BRepBndLib.hxx>
+
+#include <TColStd_ListIteratorOfListOfInteger.hxx>
+#include <TColStd_ListOfInteger.hxx>
 
 #include <TopoDS.hxx>
 #include <TopoDS_Shape.hxx>
 #include <TopoDS_Face.hxx>
 #include <TopoDS_Edge.hxx>
 #include <TopoDS_Compound.hxx>
+#include <TopoDS_Vertex.hxx>
 
 #include <BRep_Builder.hxx>
 
 #include <TopTools_ListIteratorOfListOfShape.hxx>
 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
 #include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
+#include <TopTools_MapOfShape.hxx>
 
+#include <GEOMAlgo_IndexedDataMapOfIntegerShape.hxx>
+#include <GEOMAlgo_IndexedDataMapOfShapeBox.hxx>
 #include <GEOMAlgo_PassKeyShape.hxx>
 #include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
-#include <GEOMAlgo_Tools.hxx>
+#include <GEOMAlgo_AlgoTools.hxx>
 #include <GEOMAlgo_CoupleOfShapes.hxx>
-
+#include <GEOMAlgo_ListOfCoupleOfShapes.hxx>
 #include <GEOMAlgo_Gluer.hxx>
-#include <Bnd_HArray1OfBox.hxx>
-#include <Bnd_BoundSortBox.hxx>
-#include <TopoDS_Vertex.hxx>
-#include <GEOMAlgo_IndexedDataMapOfIntegerShape.hxx>
-#include <GEOMAlgo_IndexedDataMapOfShapeBox.hxx>
-#include <Bnd_Box.hxx>
-#include <TColStd_ListOfInteger.hxx>
-#include <TopTools_MapOfShape.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
-#include <BRepBndLib.hxx>
 
 //=======================================================================
-//function : 
-//purpose  : 
+//function :
+//purpose  :
 //=======================================================================
   GEOMAlgo_GlueAnalyser::GEOMAlgo_GlueAnalyser()
 :
 {}
 //=======================================================================
 //function : ~
-//purpose  : 
+//purpose  :
 //=======================================================================
   GEOMAlgo_GlueAnalyser::~GEOMAlgo_GlueAnalyser()
 {}
 //=======================================================================
 //function : HasSolidsToGlue
-//purpose  : 
+//purpose  :
 //=======================================================================
   Standard_Boolean GEOMAlgo_GlueAnalyser::HasSolidsToGlue()const
 {
@@ -83,7 +85,7 @@
 }
 //=======================================================================
 //function : HasSolidsAlone
-//purpose  : 
+//purpose  :
 //=======================================================================
   Standard_Boolean GEOMAlgo_GlueAnalyser::HasSolidsAlone()const
 {
@@ -91,7 +93,7 @@
 }
 //=======================================================================
 //function : SolidsToGlue
-//purpose  : 
+//purpose  :
 //=======================================================================
   const GEOMAlgo_ListOfCoupleOfShapes& GEOMAlgo_GlueAnalyser::SolidsToGlue()const
 {
 }
 //=======================================================================
 //function : SolidsAlone
-//purpose  : 
+//purpose  :
 //=======================================================================
   const TopTools_ListOfShape& GEOMAlgo_GlueAnalyser::SolidsAlone()const
 {
 }
 //=======================================================================
 //function : Perform
-//purpose  : 
+//purpose  :
 //=======================================================================
   void GEOMAlgo_GlueAnalyser::Perform()
 {
     return;
   }
   //
+  // Initialize the context
+  GEOMAlgo_ShapeAlgo::Perform();
+  //
   InnerTolerance();
   if (myErrorStatus) {
     return;
 }
 //=======================================================================
 //function : DetectVertices
-//purpose  : 
+//purpose  :
 //=======================================================================
   void GEOMAlgo_GlueAnalyser::DetectVertices()
 {
     const TopoDS_Shape& aV=aMV(i);
     Bnd_Box aBox;
     //
-    aBox.SetGap(myTol); 
+    aBox.SetGap(myTol);
     BRepBndLib::Add(aV, aBox);
     aHAB->SetValue(i, aBox);
     aMIS.Add(i, aV);
-    aMSB.Add(aV, aBox); 
+    aMSB.Add(aV, aBox);
   }
   //
   aBSB.Initialize(aHAB);
     const TColStd_ListOfInteger& aLI=aBSB.Compare(aBoxV);
     aNbVSD=aLI.Extent();
     if (!aNbVSD) {
-      myErrorStatus=3; // it must not be 
+      myErrorStatus=3; // it must not be
       return;
     }
     //
       aIndex=aIt.Value();
       const TopoDS_Shape& aVx=aMIS.FindFromKey(aIndex);
       if(!j) {
-       aVF=aVx;
+        aVF=aVx;
       }
       aLVSD.Append(aVx);
       aMVProcessed.Add(aVx);
     for (; aItS.More(); aItS.Next()) {
       const TopoDS_Shape& aVSD=aItS.Value();
       if (!myOrigins.IsBound(aVSD)) {
-       myOrigins.Bind(aVSD, aV);
+        myOrigins.Bind(aVSD, aV);
       }
     }
   }
 }
 //=======================================================================
 //function : DetectFaces
-//purpose  : 
+//purpose  :
 //=======================================================================
   void GEOMAlgo_GlueAnalyser::DetectFaces()
 {
 }
 //=======================================================================
 //function : DetectEdges
-//purpose  : 
+//purpose  :
 //=======================================================================
   void GEOMAlgo_GlueAnalyser::DetectEdges()
 {
 }
 //=======================================================================
 //function : DetectShapes
-//purpose  : 
+//purpose  :
 //=======================================================================
   void GEOMAlgo_GlueAnalyser::DetectShapes(const TopAbs_ShapeEnum aType)
 {
   aNbF=aMF.Extent();
   for (i=1; i<=aNbF; ++i) {
     const TopoDS_Shape& aS=aMF(i);
-    // 
+    //
     //aPKF.Clear();//qft
     if (aType==TopAbs_FACE) {
       const TopoDS_Face& aF=TopoDS::Face(aS);
   }
   // check geometric coincidence
   if (myCheckGeometry) {
-    iErr=GEOMAlgo_Tools::RefineSDShapes(aMPKLF, myTol, myContext); //XX
+    iErr=GEOMAlgo_AlgoTools::RefineSDShapes(aMPKLF, myTol, myContext); //XX
     if (iErr) {
       myErrorStatus=200;
       return;
     for (; aItS.More(); aItS.Next()) {
       const TopoDS_Shape& aFSD=aItS.Value();
       if (!myOrigins.IsBound(aFSD)) {
-       myOrigins.Bind(aFSD, aNewShape);
+        myOrigins.Bind(aFSD, aNewShape);
       }
     }
   }
 }
 //=======================================================================
 //function : DetectSolids
-//purpose  : 
+//purpose  :
 //=======================================================================
   void GEOMAlgo_GlueAnalyser::DetectSolids()
 {
     aFx[1]=aLF.Last();
     for (i=0; i<2; ++i) {
       if (!aMFS.Contains(aFx[i])) {
-       continue;// it must not be so
+        continue;// it must not be so
       }
       //
       const TopTools_ListOfShape& aLS=aMFS.FindFromKey(aFx[i]);
       aNbS=aLS.Extent();
       if (aNbS!=1) {
-       continue;
+        continue;
       }
       aSx[i]=aLS.First();
     }
   //
   mySolidsToGlue.Clear();
   mySolidsAlone.Clear();
-  
+
   //
   aNbC=aMPKLS.Extent();
   if (!aNbC) {