0024002: Overall code and build procedure refactoring -- automatic
[occt.git] / src / BRepCheck / BRepCheck_Shell.cxx
index 16237a4..f0d9bbd 100644 (file)
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#include <BRepCheck_Shell.ixx>
 
-#include <BRepCheck_ListOfStatus.hxx>
-#include <BRepCheck_ListIteratorOfListOfStatus.hxx>
-
-#include <TopTools_MapOfShape.hxx>
-#include <TopTools_MapIteratorOfMapOfShape.hxx>
-#include <TopTools_ListOfShape.hxx>
-#include <TopTools_ListIteratorOfListOfShape.hxx>
-#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
-#include <BRep_Tool.hxx>
 #include <BRep_Builder.hxx>
-
-#include <TopExp_Explorer.hxx>
-
+#include <BRep_Tool.hxx>
 #include <BRepCheck.hxx>
+#include <BRepCheck_ListIteratorOfListOfStatus.hxx>
+#include <BRepCheck_ListOfStatus.hxx>
+#include <BRepCheck_Shell.hxx>
+#include <Standard_Type.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
 #include <TopoDS.hxx>
 #include <TopoDS_Edge.hxx>
 #include <TopoDS_Face.hxx>
-#include <TopExp.hxx>
-
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Shell.hxx>
 #include <TopTools_DataMapIteratorOfDataMapOfShapeInteger.hxx>
 #include <TopTools_DataMapOfShapeInteger.hxx>
-
-//=======================================================================
-//function : PropagateRecurs
-//purpose  : 
-//=======================================================================
-static void PropagateRecurs(const TopTools_IndexedDataMapOfShapeListOfShape& mapEF,
-                     const TopoDS_Shape& fac,
-                     TopTools_MapOfShape& mapF)
-{
-  if (mapF.Contains(fac))
-  {
-    return;
-  }
-  
-  mapF.Add(fac);  // attention, if oriented == Standard_True, fac should
-                  // be FORWARD or REVERSED. It is not checked.
-
-  TopExp_Explorer ex;
-  for (ex.Init(fac,TopAbs_EDGE); ex.More(); ex.Next())
-  {
-    const TopoDS_Edge& edg = TopoDS::Edge(ex.Current());
-    // test if the edge is in the map (only orienteed edges are present)
-    if (mapEF.Contains(edg))
-    {
-      for (TopTools_ListIteratorOfListOfShape itl(mapEF.FindFromKey(edg)); itl.More(); itl.Next())
-      {
-        if (!itl.Value().IsSame(fac) && !mapF.Contains(itl.Value()))
-        {
-          PropagateRecurs(mapEF,itl.Value(),mapF);
-        }
-      }
-    }
-  }
-}
+#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <TopTools_ListOfShape.hxx>
+#include <TopTools_MapIteratorOfMapOfShape.hxx>
+#include <TopTools_MapOfShape.hxx>
 
 //=======================================================================
 //function : Propagate
@@ -563,7 +528,7 @@ BRepCheck_Status BRepCheck_Shell::Orientation(const Standard_Boolean Update)
     }
   }
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (BRepCheck_Trace(0) > 1) {
     TopTools_DataMapIteratorOfDataMapOfShapeInteger itt(MapOfShapeOrientation);
     Standard_Integer upper = MapOfShapeOrientation.NbBuckets();
@@ -754,7 +719,7 @@ BRepCheck_Status BRepCheck_Shell::Orientation(const Standard_Boolean Update)
 //       orf = (TopAbs_Orientation)MapOfShapeOrientation.Find(Fref);
          Fref.Orientation(orf);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (BRepCheck_Trace(0) > 3) {
     cout << "Fref : " ;
     PrintShape(Fref, MapOfShapeOrientation.NbBuckets());
@@ -797,7 +762,7 @@ BRepCheck_Status BRepCheck_Shell::Orientation(const Standard_Boolean Update)
 //         orf = (TopAbs_Orientation)MapOfShapeOrientation.Find(Fcur);
            Fcur.Orientation(orf);
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (BRepCheck_Trace(0) > 3) {
     cout << "    Fcur : " ;
     PrintShape(Fcur, MapOfShapeOrientation.NbBuckets());
@@ -817,7 +782,7 @@ BRepCheck_Status BRepCheck_Shell::Orientation(const Standard_Boolean Update)
                  BRepCheck::Add(myMap(myShape), myOstat);
                }
                // quit, otherwise there is a risk of taking too much time.
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (BRepCheck_Trace(0) > 3) {
     orf = (TopAbs_Orientation)MapOfShapeOrientation.Find(Fcur);
     Fcur.Orientation(orf);
@@ -832,7 +797,7 @@ BRepCheck_Status BRepCheck_Shell::Orientation(const Standard_Boolean Update)
              MapOfShapeOrientation(Fcur)=orf;
 
 
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (BRepCheck_Trace(0) > 3) {
     orf = (TopAbs_Orientation)MapOfShapeOrientation.Find(Fcur);
     Fcur.Orientation(orf);
@@ -953,10 +918,11 @@ Standard_Integer BRepCheck_Shell::NbConnectedSet(TopTools_ListOfShape& theSets)
            }
          }
          if (!newCur) {
-          theSets.Append(CurShell);
-          CurShell.Nullify();
-          newCur=Standard_True;
-          BRB.MakeShell(CurShell);
+            CurShell.Closed (BRep_Tool::IsClosed (CurShell));
+            theSets.Append(CurShell);
+            CurShell.Nullify();
+            newCur=Standard_True;
+            BRB.MakeShell(CurShell);
          }
        }
        if (theFaces.IsEmpty()) break;