]> OCCT Git - occt-copy.git/commitdiff
0026019: Unstable behavior of test cases with operation mkvolume
authoremv <emv@opencascade.com>
Wed, 15 Jul 2015 10:09:36 +0000 (13:09 +0300)
committerabv <abv@opencascade.com>
Wed, 2 Sep 2015 11:39:56 +0000 (14:39 +0300)
The maps have been replaced with indexed maps to provide stability
of the algorithms based on the General Fuse algorithm.

21 files changed:
src/BOPAlgo/BOPAlgo_ArgumentAnalyzer.cxx
src/BOPAlgo/BOPAlgo_BOP.cxx
src/BOPAlgo/BOPAlgo_BuilderArea.cdl
src/BOPAlgo/BOPAlgo_BuilderFace.cxx
src/BOPAlgo/BOPAlgo_BuilderSolid.cxx
src/BOPAlgo/BOPAlgo_Builder_1.cxx
src/BOPAlgo/BOPAlgo_Builder_2.cxx
src/BOPAlgo/BOPAlgo_Builder_3.cxx
src/BOPAlgo/BOPAlgo_PaveFiller_1.cxx
src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx
src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx
src/BOPAlgo/BOPAlgo_PaveFiller_7.cxx
src/BOPAlgo/BOPAlgo_PaveFiller_8.cxx
src/BOPAlgo/BOPAlgo_WireSplitter.cxx
src/BOPAlgo/BOPAlgo_WireSplitter_1.cxx
src/BOPCol/BOPCol.cdl
src/BOPCol/BOPCol_IndexedDataMapOfShapeShape.hxx [new file with mode: 0644]
src/BOPCol/BOPCol_IndexedMapOfOrientedShape.hxx [new file with mode: 0644]
src/BOPCol/FILES
src/BOPDS/BOPDS_DS.cxx
src/BOPDS/BOPDS_IteratorSI.cxx

index 71c0e1e6e91635b76d6946f4fd9f723e24f5ceab..61d8d2240fb627546b56b9d8235d4ae8863d3341 100644 (file)
 
 #include <BOPAlgo_ArgumentAnalyzer.ixx>
 
+#include <BOPAlgo_ArgumentAnalyzer.hxx>
+#include <BOPAlgo_BuilderFace.hxx>
+#include <BOPAlgo_CheckerSI.hxx>
+#include <BOPAlgo_Operation.hxx>
+#include <BOPCol_ListOfShape.hxx>
+#include <BOPCol_MapOfShape.hxx>
+#include <BOPCol_IndexedMapOfShape.hxx>
+#include <BOPCol_SequenceOfShape.hxx>
+#include <BOPDS_DS.hxx>
+#include <BOPDS_MapOfPassKey.hxx>
+#include <BOPTools.hxx>
+#include <BOPTools_AlgoTools.hxx>
+#include <BOPTools_AlgoTools3D.hxx>
+#include <BRep_Builder.hxx>
+#include <BRep_TEdge.hxx>
+#include <BRep_TFace.hxx>
+#include <BRep_Tool.hxx>
+#include <BRep_TVertex.hxx>
+#include <BRepExtrema_DistShapeShape.hxx>
+#include <Geom_Surface.hxx>
+#include <gp_Pnt.hxx>
+#include <IntTools_CommonPrt.hxx>
+#include <IntTools_Context.hxx>
+#include <IntTools_EdgeEdge.hxx>
+#include <IntTools_Range.hxx>
 #include <Standard_ErrorHandler.hxx>
 #include <Standard_Failure.hxx>
 
 #include <TopoDS_Wire.hxx>
 #include <TopoDS_Shell.hxx>
 #include <TopoDS_Solid.hxx>
-
-#include <BRep_TVertex.hxx>
-#include <BRep_TEdge.hxx>
-#include <BRep_TFace.hxx>
-#include <BRep_Builder.hxx>
-#include <BRep_Tool.hxx>
-
-#include <TopExp.hxx>
-#include <TopExp_Explorer.hxx>
-
-#include <BRepExtrema_DistShapeShape.hxx>
-//
 #include <BOPCol_ListOfShape.hxx>
 #include <BOPCol_SequenceOfShape.hxx>
 #include <BOPCol_MapOfShape.hxx>
@@ -63,6 +76,8 @@
 #include <BOPAlgo_CheckerSI.hxx>
 #include <BOPAlgo_BuilderFace.hxx>
 
+#include <TopExp_Explorer.hxx>
+
 // ================================================================================
 // function: Constructor
 // purpose:
@@ -825,10 +840,9 @@ void BOPAlgo_ArgumentAnalyzer::TestMergeEdge()
 // ================================================================================
 void BOPAlgo_ArgumentAnalyzer::TestContinuity() 
 {
-  Standard_Integer i;
+  Standard_Integer i, j, aNbS;
   Standard_Real f, l;
   TopExp_Explorer aExp;
-  BOPCol_MapIteratorOfMapOfShape aIt;
   //
   for (i = 0; i < 2; ++i) {
     const TopoDS_Shape& aS = !i ? myShape1 : myShape2;
@@ -836,7 +850,7 @@ void BOPAlgo_ArgumentAnalyzer::TestContinuity()
       continue;
     }
     //
-    BOPCol_MapOfShape aMS;
+    BOPCol_IndexedMapOfShape aMS;
     //Edges
     aExp.Init(aS, TopAbs_EDGE);
     for (; aExp.More(); aExp.Next()) {
@@ -860,9 +874,9 @@ void BOPAlgo_ArgumentAnalyzer::TestContinuity()
     }
     //
     //add shapes with continuity C0 to result
-    aIt.Initialize(aMS);
-    for (; aIt.More(); aIt.Next()) {
-      const TopoDS_Shape& aFS = aIt.Value();
+    aNbS = aMS.Extent();
+    for (j = 1; j <= aNbS; ++j) {
+      const TopoDS_Shape& aFS = aMS(j);
       BOPAlgo_CheckResult aResult;
       if(i == 0) {
         aResult.SetShape1(myShape1);
index ec88eab219b22d95172a93826047fa07125129c2..25d20a8846eb8a3d017b5f8708142aeefdecd4a8 100644 (file)
 #include <NCollection_DataMap.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
 
-typedef NCollection_DataMap  
-  <BOPTools_Set, 
-  TopoDS_Shape, 
-  BOPTools_SetMapHasher> BOPTools_DataMapOfSetShape; 
+typedef NCollection_IndexedDataMap
+  <BOPTools_Set,
+  TopoDS_Shape,
+  BOPTools_SetMapHasher> BOPTools_IndexedDataMapOfSetShape;
 //
-typedef BOPTools_DataMapOfSetShape::Iterator 
-  BOPTools_DataMapIteratorOfDataMapOfSetShape; 
-
 static
   TopAbs_ShapeEnum TypeToExplore(const Standard_Integer theDim);
 
@@ -535,7 +532,7 @@ void BOPAlgo_BOP::BuildRC()
   BOPCol_ListIteratorOfListOfShape aItLS, aItIm; 
   Standard_Boolean bHasInterf;
   Standard_Integer iX;
-  BOPTools_DataMapOfSetShape aDMSTS;
+  BOPTools_IndexedDataMapOfSetShape aDMSTS;
   //
   myErrorStatus=0;
   //
@@ -595,7 +592,7 @@ void BOPAlgo_BOP::BuildRC()
             //
             aST.Add(aSIm, TopAbs_FACE);
             //
-            aDMSTS.Bind(aST, aSIm);
+            aDMSTS.Add(aST, aSIm);
           }
         }
       }
@@ -660,8 +657,8 @@ void BOPAlgo_BOP::BuildRC()
                //
                aST.Add(aSIm, TopAbs_FACE);
                //
-               if (aDMSTS.IsBound(aST)) {
-                 const TopoDS_Shape& aSImA=aDMSTS.Find(aST);
+               if (aDMSTS.Contains(aST)) {
+                 const TopoDS_Shape& aSImA=aDMSTS.FindFromKey(aST);
                  aBB.Add(aC, aSImA);
                }
              }
@@ -674,7 +671,7 @@ void BOPAlgo_BOP::BuildRC()
               //
               aST.Add(aSIm, TopAbs_FACE);
               //
-              bIsBound=aDMSTS.IsBound(aST); 
+              bIsBound=aDMSTS.Contains(aST); 
             }
             //
             if (!bIsBound) {
@@ -841,8 +838,7 @@ void BOPAlgo_BOP::BuildSolid()
   BOPCol_ListOfShape aSFS;
   BOPAlgo_BuilderSolid aSB; 
   BOPCol_MapOfShape aMSA, aMZ;
-  BOPTools_DataMapOfSetShape aDMSTS;
-  BOPTools_DataMapIteratorOfDataMapOfSetShape aItDMSTS;
+  BOPTools_IndexedDataMapOfSetShape aDMSTS;
   //
   myErrorStatus=0;
   //
@@ -898,8 +894,8 @@ void BOPAlgo_BOP::BuildSolid()
         //
         aST.Add(aSx, TopAbs_FACE);
         //
-        if (!aDMSTS.IsBound(aST)) {
-          aDMSTS.Bind(aST, aSx);
+        if (!aDMSTS.Contains(aST)) {
+          aDMSTS.Add(aST, aSx);
         }
         
         continue; 
@@ -996,9 +992,9 @@ void BOPAlgo_BOP::BuildSolid()
     aBB.Add(aRC, aSR);
   }
   //
-  aItDMSTS.Initialize(aDMSTS);
-  for (; aItDMSTS.More(); aItDMSTS.Next()) {
-    const TopoDS_Shape& aSx=aItDMSTS.Value();
+  aNbSx = aDMSTS.Extent();
+  for (i = 1; i <= aNbSx; ++i) {
+    const TopoDS_Shape& aSx = aDMSTS(i);
     aBB.Add(aRC, aSx);
   }
   //
index 7d6fa7876b067dbb54784c064256eda62019b569..40b61e8194fd8b77e9f22e3f1c193a2d4b7f12ed 100644 (file)
@@ -25,7 +25,7 @@ uses
     Shape from TopoDS, 
     BaseAllocator from BOPCol, 
     ListOfShape from BOPCol,
-    MapOfOrientedShape from BOPCol, 
+    IndexedMapOfOrientedShape from BOPCol, 
     Context  from IntTools 
     
 --raises
@@ -73,7 +73,7 @@ fields
     myLoopsInternal  :  ListOfShape from BOPCol is protected;
     
     myAreas          :  ListOfShape from BOPCol is protected;  
-    myShapesToAvoid  :  MapOfOrientedShape from BOPCol is protected;  
+    myShapesToAvoid  :  IndexedMapOfOrientedShape from BOPCol is protected;  
  
 end BuilderArea; 
 
index 09acefd67ffa29e7b4bb9c936cf1ecfd69edd801..4b98a2aeef1103a7eb91773937d275a748518d53 100644 (file)
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#include <BOPAlgo_BuilderFace.ixx>
-//
-#include <NCollection_UBTreeFiller.hxx>
-#include <NCollection_DataMap.hxx>
-//
-#include <TColStd_MapIntegerHasher.hxx>
-//
-#include <gp_Pnt2d.hxx>
-#include <gp_Pln.hxx>
-#include <gp_Vec.hxx>
+#include <Bnd_Box.hxx>
+#include <BOPAlgo_BuilderFace.hxx>
+#include <BOPAlgo_WireEdgeSet.hxx>
+#include <BOPAlgo_WireSplitter.hxx>
+#include <BOPCol_Box2DBndTree.hxx>
+#include <BOPCol_DataMapOfShapeListOfShape.hxx>
+#include <BOPCol_DataMapOfShapeShape.hxx>
+#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
+#include <BOPCol_ListOfShape.hxx>
+#include <BOPCol_MapOfShape.hxx>
+#include <BOPCol_MapOfOrientedShape.hxx>
+#include <BOPTools.hxx>
+#include <BOPTools_AlgoTools.hxx>
+#include <BOPTools_AlgoTools2D.hxx>
+#include <BRep_Builder.hxx>
+#include <BRep_Tool.hxx>
+#include <BRepBndLib.hxx>
+#include <BRepTools.hxx>
+#include <Geom_Surface.hxx>
 #include <gp_Dir.hxx>
 #include <gp_Pnt.hxx>
 //
 #include <BOPTools_AlgoTools.hxx>
 #include <BOPTools_AlgoTools2D.hxx>
 #include <BOPAlgo_WireEdgeSet.hxx>
+#include <NCollection_UBTreeFiller.hxx>
 //
-#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
-#include <BOPTools.hxx>
-#include <BOPCol_ListOfShape.hxx>
-//
-#include <BOPCol_DataMapOfShapeShape.hxx>
-#include <BOPCol_DataMapOfShapeListOfShape.hxx>
-#include <BOPCol_MapOfShape.hxx>
-#include <BOPCol_Box2DBndTree.hxx>
-//
-#include <BOPAlgo_WireSplitter.hxx>
-
 static
   Standard_Boolean IsGrowthWire(const TopoDS_Shape& ,
                                 const BOPCol_IndexedMapOfShape& );
@@ -79,7 +78,7 @@ static
                             const TopoDS_Shape& ,
                             Handle(IntTools_Context)& );
 static
-  void MakeInternalWires(const BOPCol_MapOfShape& ,
+  void MakeInternalWires(const BOPCol_IndexedMapOfShape& ,
                          BOPCol_ListOfShape& );
 static 
   void GetWire(const TopoDS_Shape& , 
@@ -132,8 +131,7 @@ class BOPAlgo_ShapeBox2D {
 //
 typedef NCollection_IndexedDataMap 
   <Standard_Integer, 
-  BOPAlgo_ShapeBox2D, 
-  TColStd_MapIntegerHasher>  BOPAlgo_IndexedDataMapOfIntegerShapeBox2D; 
+  BOPAlgo_ShapeBox2D>  BOPAlgo_IndexedDataMapOfIntegerShapeBox2D; 
 
 typedef NCollection_IndexedDataMap 
   <TopoDS_Shape, 
@@ -333,9 +331,8 @@ void BOPAlgo_BuilderFace::PerformLoops()
   myErrorStatus=0;
   //
   Standard_Boolean bFlag;
-  Standard_Integer iErr, aNbEA;
+  Standard_Integer i, iErr, aNbEA;
   BOPCol_ListIteratorOfListOfShape aIt;
-  BOPCol_MapIteratorOfMapOfOrientedShape aItM;
   BOPCol_IndexedDataMapOfShapeListOfShape aVEMap;
   BOPCol_MapOfOrientedShape aMAdded;
   TopoDS_Iterator aItW;
@@ -384,9 +381,9 @@ void BOPAlgo_BuilderFace::PerformLoops()
   }
   // 
   // b. collect all edges that are to avoid
-  aItM.Initialize(myShapesToAvoid);
-  for (; aItM.More(); aItM.Next()) {
-    const TopoDS_Shape& aE=aItM.Key();
+  aNbEA = myShapesToAvoid.Extent();
+  for (i = 1; i <= aNbEA; ++i) {
+    const TopoDS_Shape& aE = myShapesToAvoid(i);
     aMEP.Add(aE);
   }
   //
@@ -402,10 +399,9 @@ void BOPAlgo_BuilderFace::PerformLoops()
   // 2. Internal Wires
   myLoopsInternal.Clear();
   //
-  aNbEA=myShapesToAvoid.Extent();
-  aItM.Initialize(myShapesToAvoid);
-  for (; aItM.More(); aItM.Next()) {
-    const TopoDS_Shape& aEE=aItM.Key();
+  aNbEA = myShapesToAvoid.Extent();
+  for (i = 1; i <= aNbEA; ++i) {
+    const TopoDS_Shape& aEE = myShapesToAvoid(i);
     BOPTools::MapShapesAndAncestors(aEE, 
                                     TopAbs_VERTEX, 
                                     TopAbs_EDGE, 
@@ -413,9 +409,8 @@ void BOPAlgo_BuilderFace::PerformLoops()
   }
   //
   bFlag=Standard_True;
-  aItM.Initialize(myShapesToAvoid);
-  for (; aItM.More()&&bFlag; aItM.Next()) {
-    const TopoDS_Shape& aEE=aItM.Key();
+  for (i = 1; (i <= aNbEA) && bFlag; ++i) {
+    const TopoDS_Shape& aEE = myShapesToAvoid(i);
     if (!aMAdded.Add(aEE)) {
       continue;
     }
@@ -447,7 +442,7 @@ void BOPAlgo_BuilderFace::PerformLoops()
     }//for (; aItW.More(); aItW.Next()) {
     aW.Closed(BRep_Tool::IsClosed(aW));
     myLoopsInternal.Append(aW);
-  }//for (; aItM.More(); aItM.Next()) {
+  }//for (i = 1; (i <= aNbEA) && bFlag; ++i) {
 }
 //=======================================================================
 //function : PerformAreas
@@ -706,11 +701,11 @@ void BOPAlgo_BuilderFace::PerformInternalShapes()
   }
   // 
   //Standard_Real aTol;
+  Standard_Integer i;
   BRep_Builder aBB;
   BOPCol_ListIteratorOfListOfShape aIt1, aIt2;
   TopoDS_Iterator aIt; 
-  BOPCol_MapOfShape aME, aMEP;
-  BOPCol_MapIteratorOfMapOfShape aItME;
+  BOPCol_IndexedMapOfShape aME1, aME2, aMEP;
   BOPCol_IndexedDataMapOfShapeListOfShape aMVE;
   BOPCol_ListOfShape aLSI;
   //
@@ -721,10 +716,9 @@ void BOPAlgo_BuilderFace::PerformInternalShapes()
     aIt.Initialize(aWire);
     for (; aIt.More(); aIt.Next()) {
       const TopoDS_Shape& aE=aIt.Value();
-      aME.Add(aE);
+      aME1.Add(aE);
     }
   }
-  aNbWI=aME.Extent();
   //
   // 2 Process faces
   aIt2.Initialize(myAreas);
@@ -735,13 +729,17 @@ void BOPAlgo_BuilderFace::PerformInternalShapes()
     BOPTools::MapShapesAndAncestors(aF, TopAbs_VERTEX, TopAbs_EDGE, aMVE);
     //
     // 2.1 Separate faces to process aMEP
+    aME2.Clear();
     aMEP.Clear();
-    aItME.Initialize(aME);
-    for (; aItME.More(); aItME.Next()) {
-      const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&aItME.Key()));
+    aNbWI = aME1.Extent();
+    for (i = 1; i <= aNbWI; ++i) {
+      const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&aME1(i)));
       if (IsInside(aE, aF, myContext)) {
         aMEP.Add(aE);
       }
+      else {
+        aME2.Add(aE);
+      }
     }
     //
     // 2.2 Make Internal Wires
@@ -756,13 +754,9 @@ void BOPAlgo_BuilderFace::PerformInternalShapes()
     }
     //
     // 2.4 Remove faces aMFP from aMF
-    aItME.Initialize(aMEP);
-    for (; aItME.More(); aItME.Next()) {
-      const TopoDS_Shape& aE=aItME.Key();
-      aME.Remove(aE);
-    }
+    aME1 = aME2;
     //
-    aNbWI=aME.Extent();
+    aNbWI = aME1.Extent();
     if (!aNbWI) {
       break;
     }
@@ -772,24 +766,23 @@ void BOPAlgo_BuilderFace::PerformInternalShapes()
 //function : MakeInternalWires
 //purpose  : 
 //=======================================================================
-void MakeInternalWires(const BOPCol_MapOfShape& theME,
+void MakeInternalWires(const BOPCol_IndexedMapOfShape& theME,
                        BOPCol_ListOfShape& theWires)
 {
-  BOPCol_MapIteratorOfMapOfShape aItM;
+  Standard_Integer i, aNbE;
   BOPCol_MapOfShape aAddedMap;
   BOPCol_ListIteratorOfListOfShape aItE;
   BOPCol_IndexedDataMapOfShapeListOfShape aMVE;
   BRep_Builder aBB;
   //
-  aItM.Initialize(theME);
-  for (; aItM.More(); aItM.Next()) {
-    const TopoDS_Shape& aE=aItM.Key();
+  aNbE = theME.Extent();
+  for (i = 1; i <= aNbE; ++i) {
+    const TopoDS_Shape& aE = theME(i);
     BOPTools::MapShapesAndAncestors(aE, TopAbs_VERTEX, TopAbs_EDGE, aMVE);
   }
   //
-  aItM.Initialize(theME);
-  for (; aItM.More(); aItM.Next()) {
-    TopoDS_Shape aEE=aItM.Key();
+  for (i = 1; i <= aNbE; ++i) {
+    TopoDS_Shape aEE = theME(i);
     if (!aAddedMap.Add(aEE)) {
       continue;
     }
index c361954c153ce2fd5a670c222de9b3ab0f27da82..b9b9ef1b7a097e4af081aebc872f0887f6d53d03 100644 (file)
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 //
-#include <BOPAlgo_BuilderSolid.ixx>
-//
-#include <NCollection_List.hxx>
-#include <NCollection_DataMap.hxx>
-#include <NCollection_UBTreeFiller.hxx>
-#include <NCollection_IncAllocator.hxx>
-//
-#include <gp_Pnt2d.hxx>
-#include <gp_Pln.hxx>
-#include <gp_Vec.hxx>
+#include <BOPAlgo_BuilderSolid.hxx>
+#include <BOPAlgo_ShellSplitter.hxx>
+#include <BOPCol_BoxBndTree.hxx>
+#include <BOPCol_DataMapOfShapeListOfShape.hxx>
+#include <BOPCol_DataMapOfShapeShape.hxx>
+#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
+#include <BOPCol_IndexedDataMapOfShapeShape.hxx>
+#include <BOPCol_ListOfInteger.hxx>
+#include <BOPCol_ListOfShape.hxx>
+#include <BOPCol_MapOfOrientedShape.hxx>
+#include <BOPCol_MapOfShape.hxx>
+#include <BOPCol_NCVector.hxx>
+#include <BOPCol_Parallel.hxx>
+#include <BOPTools.hxx>
+#include <BOPTools_AlgoTools.hxx>
+#include <BOPTools_AlgoTools3D.hxx>
+#include <BOPTools_CoupleOfShape.hxx>
+#include <BRep_Builder.hxx>
+#include <BRep_Tool.hxx>
+#include <BRepBndLib.hxx>
+#include <BRepClass3d_SolidClassifier.hxx>
+#include <Geom2d_Curve.hxx>
+#include <Geom_Curve.hxx>
+#include <Geom_Surface.hxx>
 #include <gp_Dir.hxx>
 #include <gp_Pnt.hxx>
 //
 
 #include <BRep_Builder.hxx>
 #include <BRep_Tool.hxx>
-//
-#include <TopExp.hxx>
-#include <TopExp_Explorer.hxx>
-//
-#include <BRepBndLib.hxx>
-#include <BRepClass3d_SolidClassifier.hxx>
-//
-#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
-#include <BOPCol_ListOfShape.hxx>
-#include <BOPCol_MapOfOrientedShape.hxx>
-#include <BOPCol_DataMapOfShapeShape.hxx>
-#include <BOPCol_DataMapOfShapeListOfShape.hxx>
-#include <BOPCol_MapOfShape.hxx>
-#include <BOPCol_BoxBndTree.hxx>
-#include <BOPCol_ListOfInteger.hxx>
-#include <BOPCol_NCVector.hxx>
-#include <BOPCol_Parallel.hxx>
-//
-#include <BOPTools.hxx>
-#include <BOPTools_CoupleOfShape.hxx>
-#include <BOPTools_AlgoTools.hxx>
-#include <BOPTools_AlgoTools3D.hxx>
-//
+#include <Precision.hxx>
 #include <IntTools_Context.hxx>
-//
-#include <BOPAlgo_ShellSplitter.hxx>
-
+#include <NCollection_IncAllocator.hxx>
+#include <NCollection_UBTreeFiller.hxx>
 
+//
 static
   Standard_Boolean IsGrowthShell(const TopoDS_Shape& ,
                                  const BOPCol_IndexedMapOfShape& );
@@ -86,7 +78,7 @@ static
                             const TopoDS_Shape& ,
                             Handle(IntTools_Context)& );
 static
-  void MakeInternalShells(const BOPCol_MapOfShape& ,
+  void MakeInternalShells(const BOPCol_IndexedMapOfShape& ,
                           BOPCol_ListOfShape& );
 
 //=======================================================================
@@ -261,14 +253,7 @@ typedef BOPCol_ContextCnt
   Handle(IntTools_Context)> BOPAlgo_FaceSolidCnt;
 //
 //=======================================================================
-typedef NCollection_DataMap
-  <TopoDS_Shape, 
-  gp_Pnt, 
-  TopTools_ShapeMapHasher> BOPAlgo_DataMapOfShapePnt; 
 
-typedef BOPAlgo_DataMapOfShapePnt::Iterator 
-  BOPAlgo_DataMapIteratorOfDataMapOfShapePnt; 
-//
 //=======================================================================
 //function : 
 //purpose  : 
@@ -448,10 +433,9 @@ void BOPAlgo_BuilderSolid::PerformShapesToAvoid()
 //=======================================================================
 void BOPAlgo_BuilderSolid::PerformLoops()
 {
-  Standard_Integer iErr;
+  Standard_Integer iErr, i, aNbSh;
   BOPCol_ListIteratorOfListOfShape aIt;
   TopoDS_Iterator aItS;
-  BOPCol_MapIteratorOfMapOfOrientedShape aItM;
   Handle(NCollection_BaseAllocator) aAlr;
   // 
   myErrorStatus=0;
@@ -512,9 +496,9 @@ void BOPAlgo_BuilderSolid::PerformLoops()
   }
   // 
   // b. collect all edges that are to avoid
-  aItM.Initialize(myShapesToAvoid);
-  for (; aItM.More(); aItM.Next()) {
-    const TopoDS_Shape& aF=aItM.Key();
+  aNbSh = myShapesToAvoid.Extent();
+  for (i = 1; i <= aNbSh; ++i) {
+    const TopoDS_Shape& aF = myShapesToAvoid(i);
     aMP.Add(aF);
   }
   //
@@ -536,17 +520,16 @@ void BOPAlgo_BuilderSolid::PerformLoops()
   aEFMap.Clear();
   AddedFacesMap.Clear();
   //
-  aItM.Initialize(myShapesToAvoid);
-  for (; aItM.More(); aItM.Next()) {
-    const TopoDS_Shape& aFF=aItM.Key();
+  aNbSh = myShapesToAvoid.Extent();
+  for (i = 1; i <= aNbSh; ++i) {
+    const TopoDS_Shape& aFF = myShapesToAvoid(i);
     BOPTools::MapShapesAndAncestors(aFF, 
         TopAbs_EDGE, TopAbs_FACE, 
         aEFMap);
   }
   //
-  aItM.Initialize(myShapesToAvoid);
-  for (; aItM.More(); aItM.Next()) {
-    const TopoDS_Shape& aFF=aItM.Key();
+  for (i = 1; i <= aNbSh; ++i) {
+    const TopoDS_Shape& aFF = myShapesToAvoid(i);
     if (!AddedFacesMap.Add(aFF)) {
       continue;
     }
@@ -585,11 +568,11 @@ void BOPAlgo_BuilderSolid::PerformLoops()
 void BOPAlgo_BuilderSolid::PerformAreas()
 {
   Standard_Boolean bIsGrowth, bIsHole;
-  Standard_Integer k;
+  Standard_Integer i, k, aNbInOut, aNbMSH;
   BRep_Builder aBB; 
   BOPCol_ListIteratorOfListOfShape aItLS;
   BOPCol_ListOfShape aNewSolids, aHoleShells; 
-  BOPCol_DataMapOfShapeShape aInOutMap;
+  BOPCol_IndexedDataMapOfShapeShape aInOutMap;
   BOPCol_IndexedMapOfShape aMHF;
   BOPCol_ListIteratorOfListOfInteger aItLI;
   BOPCol_BoxBndTreeSelector aSelector;
@@ -597,10 +580,8 @@ void BOPAlgo_BuilderSolid::PerformAreas()
   NCollection_UBTreeFiller 
     <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
   BOPAlgo_DataMapOfIntegerBSSB aDMISB(100);
+  BOPCol_IndexedDataMapOfShapeListOfShape aMSH;
   BOPAlgo_DataMapIteratorOfDataMapOfIntegerBSSB aItDMISB;
-  BOPCol_DataMapOfShapeListOfShape aMSH;
-  BOPCol_DataMapIteratorOfDataMapOfShapeShape aItDMSS;
-  BOPCol_DataMapIteratorOfDataMapOfShapeListOfShape aItMSH;
   //
   myErrorStatus=0;
   //
@@ -698,42 +679,41 @@ void BOPAlgo_BuilderSolid::PerformAreas()
         continue;
       }
       //
-      if (aInOutMap.IsBound (aHole)){
-        const TopoDS_Shape& aSolidWas=aInOutMap(aHole);
+      if (aInOutMap.Contains (aHole)){
+        const TopoDS_Shape& aSolidWas = aInOutMap.FindFromKey(aHole);
         if (IsInside(aSolid, aSolidWas, myContext)) {
-          aInOutMap.UnBind(aHole);
-          aInOutMap.Bind (aHole, aSolid);
+          aInOutMap.ChangeFromKey(aHole) = aSolid;
         }
       }
       else{
-        aInOutMap.Bind(aHole, aSolid);
+        aInOutMap.Add(aHole, aSolid);
       }
     }
-  }//for (; aItDMISB.More(); aItDMISB.Next()) {
+  }//for (i = 1; i <= aNbDMISB; ++i) {
   //
   // 5. Map [Solid/Holes] -> aMSH 
-  aItDMSS.Initialize(aInOutMap);
-  for (; aItDMSS.More(); aItDMSS.Next()) {
-    const TopoDS_Shape& aHole=aItDMSS.Key();
-    const TopoDS_Shape& aSolid=aItDMSS.Value();
+  aNbInOut = aInOutMap.Extent();
+  for (i = 1; i <= aNbInOut; ++i) {
+    const TopoDS_Shape& aHole = aInOutMap.FindKey(i);
+    const TopoDS_Shape& aSolid = aInOutMap(i);
     //
-    if (aMSH.IsBound(aSolid)) {
-      BOPCol_ListOfShape& aLH=aMSH.ChangeFind(aSolid);
+    if (aMSH.Contains(aSolid)) {
+      BOPCol_ListOfShape& aLH = aMSH.ChangeFromKey(aSolid);
       aLH.Append(aHole);
     }
     else {
       BOPCol_ListOfShape aLH;
       aLH.Append(aHole);
-      aMSH.Bind(aSolid, aLH);
+      aMSH.Add(aSolid, aLH);
     }
   }
   //
   // 6. Add aHoles to Solids
-  aItMSH.Initialize(aMSH);
-  for (; aItMSH.More(); aItMSH.Next()) {
-    TopoDS_Solid aSolid=(*(TopoDS_Solid*)(&aItMSH.Key()));
+  aNbMSH = aMSH.Extent();
+  for (i = 1; i <= aNbMSH; ++i) {
+    TopoDS_Solid aSolid=(*(TopoDS_Solid*)(&(aMSH.FindKey(i))));
+    const BOPCol_ListOfShape& aLH = aMSH(i);
     //
-    const BOPCol_ListOfShape& aLH=aItMSH.Value();
     aItLS.Initialize(aLH);
     for (; aItLS.More(); aItLS.Next()) {
       const TopoDS_Shape& aHole = aItLS.Value();
@@ -758,7 +738,7 @@ void BOPAlgo_BuilderSolid::PerformAreas()
   aItLS.Initialize(aHoleShells);
   for (; aItLS.More(); aItLS.Next()) {
     const TopoDS_Shape& aHole = aItLS.Value();
-    if (!aInOutMap.IsBound(aHole)){
+    if (!aInOutMap.Contains(aHole)){
       TopoDS_Solid aSolid;
       //
       aBB.MakeSolid(aSolid);
@@ -787,7 +767,7 @@ void BOPAlgo_BuilderSolid::PerformInternalShapes()
   TopoDS_Iterator aIt;
   TopExp_Explorer aExp;
   BOPCol_ListIteratorOfListOfShape  aItLS;
-  BOPCol_MapOfShape aMFs;
+  BOPCol_IndexedMapOfShape aMFs;
   BOPCol_ListOfShape aLSI;
   BOPAlgo_VectorOfFaceSolid aVFS;
   BOPAlgo_VectorOfFacePnt aVFP;
@@ -807,7 +787,9 @@ void BOPAlgo_BuilderSolid::PerformInternalShapes()
     for (; aIt.More(); aIt.Next()) {
       const TopoDS_Face& aF=*((TopoDS_Face*)&aIt.Value());
       //
-      if (aMFs.Add(aF)) {
+      if (!aMFs.Contains(aF)) {
+        aMFs.Add(aF);
+        //
         gp_Pnt aP;
         gp_Pnt2d aP2D;
         //
@@ -985,27 +967,25 @@ void BOPAlgo_BuilderSolid::PerformInternalShapes()
 //function : MakeInternalShells
 //purpose  : 
 //=======================================================================
-void MakeInternalShells(const BOPCol_MapOfShape& theMF,
+void MakeInternalShells(const BOPCol_IndexedMapOfShape& theMF,
                         BOPCol_ListOfShape& theShells)
 {
-  BOPCol_ListIteratorOfListOfShape aItF;
+  Standard_Integer i, aNbF;
   BRep_Builder aBB;
-  //
+  BOPCol_ListIteratorOfListOfShape aItF;
   BOPCol_IndexedDataMapOfShapeListOfShape aMEF;
-  BOPCol_MapIteratorOfMapOfShape aItM;
   BOPCol_MapOfShape aAddedFacesMap;
   //
-  aItM.Initialize(theMF);
-  for (; aItM.More(); aItM.Next()) {
-    const TopoDS_Shape& aF=aItM.Key();
+  aNbF = theMF.Extent();
+  for (i = 1; i <= aNbF; ++i) {
+    TopoDS_Shape aF = theMF(i);
     BOPTools::MapShapesAndAncestors(aF, 
         TopAbs_EDGE, TopAbs_FACE, 
         aMEF);
   }
   //
-  aItM.Initialize(theMF);
-  for (; aItM.More(); aItM.Next()) {
-    TopoDS_Shape aFF=aItM.Key();
+  for (i = 1; i <= aNbF; ++i) {
+    TopoDS_Shape aFF = theMF(i);
     if (!aAddedFacesMap.Add(aFF)) {
       continue;
     }
index 5c1e98a35f716b210816f9a38a8c848de0c0b306..4206e105b07fb1e3db8e399649794a2c1a80611f 100644 (file)
     aType=aS.ShapeType();
     if (aType==theType) {
       if (myImages.IsBound(aS)){
-       const BOPCol_ListOfShape& aLSIm=myImages.Find(aS);
-       aItIm.Initialize(aLSIm);
-       for (; aItIm.More(); aItIm.Next()) {
-         const TopoDS_Shape& aSIm=aItIm.Value();
-         if (aM.Add(aSIm)) {
-           aBB.Add(myShape, aSIm);
-         }
-       }
+        const BOPCol_ListOfShape& aLSIm=myImages.Find(aS);
+        aItIm.Initialize(aLSIm);
+        for (; aItIm.More(); aItIm.Next()) {
+          const TopoDS_Shape& aSIm=aItIm.Value();
+          if (aM.Add(aSIm)) {
+            aBB.Add(myShape, aSIm);
+          }
+        }
       }
       else {
-       if (aM.Add(aS)) {
-         aBB.Add(myShape, aS);
-       }
+        if (aM.Add(aS)) {
+          aBB.Add(myShape, aS);
+        }
       }
     }
   }
       const BOPCol_ListOfShape& aLFIm=myImages.Find(aSX);
       aItIm.Initialize(aLFIm);
       for (; aItIm.More(); aItIm.Next()) {
-       TopoDS_Shape aSXIm=aItIm.Value();
-       aSXIm.Orientation(aOrX);
-       aBB.Add(aCIm, aSXIm);
+        TopoDS_Shape aSXIm=aItIm.Value();
+        aSXIm.Orientation(aOrX);
+        aBB.Add(aCIm, aSXIm);
       }
     }
     else {
index 7ba2e5c29b2cfe1d1b6728c84f8f1b1c703ed1c9..342834bcd315a6bdb6bac6f82a3d1da388a509d0 100644 (file)
@@ -264,7 +264,6 @@ void BOPAlgo_Builder::BuildSplitFaces()
   BOPCol_MapOfShape aMFence;
   Handle(NCollection_BaseAllocator) aAllocator;
   BOPCol_ListOfShape aLFIm(myAllocator);
-  BOPCol_MapIteratorOfMapOfShape aItMS;
   BOPAlgo_VectorOfBuilderFace aVBF;
   //
   myErrorStatus=0;
@@ -866,27 +865,27 @@ Standard_Boolean HasPaveBlocksOnIn(const BOPDS_FaceInfo& aFI1,
                                    const BOPDS_FaceInfo& aFI2)
 {
   Standard_Boolean bRet;
-  BOPDS_MapIteratorOfMapOfPaveBlock aItMPB;
+  Standard_Integer i, aNbPB;
   //
   bRet=Standard_False;
-  const BOPDS_IndexedMapOfPaveBlock& aMPBOn1=aFI1.PaveBlocksOn();
-  const BOPDS_IndexedMapOfPaveBlock& aMPBIn1=aFI1.PaveBlocksIn();
-  //
-  const BOPDS_IndexedMapOfPaveBlock& aMPBOn2=aFI2.PaveBlocksOn();
-  aItMPB.Initialize(aMPBOn2);
-  for (; aItMPB.More(); aItMPB.Next()) {
-    const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
-    bRet=aMPBOn1.Contains(aPB) || aMPBIn1.Contains(aPB);
+  const BOPDS_IndexedMapOfPaveBlock& aMPBOn1 = aFI1.PaveBlocksOn();
+  const BOPDS_IndexedMapOfPaveBlock& aMPBIn1 = aFI1.PaveBlocksIn();
+  //
+  const BOPDS_IndexedMapOfPaveBlock& aMPBOn2 = aFI2.PaveBlocksOn();
+  aNbPB = aMPBOn2.Extent();
+  for (i = 1; i <= aNbPB; ++i) {
+    const Handle(BOPDS_PaveBlock)& aPB = aMPBOn2(i);
+    bRet = aMPBOn1.Contains(aPB) || aMPBIn1.Contains(aPB);
     if (bRet) {
       return bRet;
     }
   }
   //
-  const BOPDS_IndexedMapOfPaveBlock& aMPBIn2=aFI2.PaveBlocksIn();
-  aItMPB.Initialize(aMPBIn2);
-  for (; aItMPB.More(); aItMPB.Next()) {
-    const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
-    bRet=aMPBOn1.Contains(aPB) || aMPBIn1.Contains(aPB);
+  const BOPDS_IndexedMapOfPaveBlock& aMPBIn2 = aFI2.PaveBlocksIn();
+  aNbPB = aMPBIn2.Extent();
+  for (i = 1; i <= aNbPB; ++i) {
+    const Handle(BOPDS_PaveBlock)& aPB = aMPBIn2(i);
+    bRet = aMPBOn1.Contains(aPB) || aMPBIn1.Contains(aPB);
     if (bRet) {
       return bRet;
     }
index 6bd36a448c9b6a80baaa589ee9f816deec976f66..8570c4c43744e3d260fc16624c3af1c5eef8370e 100644 (file)
@@ -801,7 +801,6 @@ void BOPAlgo_Builder::BuildSplitSolids
   Standard_Integer i, aNbS;
   TopExp_Explorer aExp;
   BOPCol_ListIteratorOfListOfShape aIt;
-  BOPCol_DataMapIteratorOfDataMapOfShapeShape aIt1;
   //
   Handle(NCollection_IncAllocator) aAlr0;
   aAlr0=new NCollection_IncAllocator();
@@ -933,7 +932,6 @@ void BOPAlgo_Builder::FillInternalShapes()
   TopAbs_State aState; 
   TopoDS_Iterator aItS;
   BRep_Builder aBB;
-  BOPCol_MapIteratorOfMapOfShape aItM;
   BOPCol_ListIteratorOfListOfShape aIt, aIt1;
   //
   Handle(NCollection_IncAllocator) aAllocator;
@@ -942,12 +940,13 @@ void BOPAlgo_Builder::FillInternalShapes()
   //
   BOPCol_IndexedDataMapOfShapeListOfShape aMSx(100, aAllocator);
   BOPCol_IndexedMapOfShape aMx(100, aAllocator);
-  BOPCol_MapOfShape aMSI(100, aAllocator);
+  BOPCol_IndexedMapOfShape aMSI(100, aAllocator);
   BOPCol_MapOfShape aMFence(100, aAllocator);
   BOPCol_MapOfShape aMSOr(100, aAllocator);
   BOPCol_ListOfShape aLSd(aAllocator);
   BOPCol_ListOfShape aLArgs(aAllocator);
   BOPCol_ListOfShape aLSC(aAllocator);
+  BOPCol_ListOfShape aLSI(aAllocator);
   //
   // 1. Shapes to process
   //
@@ -1066,20 +1065,23 @@ void BOPAlgo_Builder::FillInternalShapes()
   //
   // 3. Some shapes of aMSI can be already tied with faces of 
   //    split solids
-  aItM.Initialize(aMSI); 
-  for (; aItM.More(); aItM.Next()) {
-    const TopoDS_Shape& aSI=aItM.Key();
+  aNbSI = aMSI.Extent();
+  for (i = 1; i <= aNbSI; ++i) {
+    const TopoDS_Shape& aSI = aMSI(i);
     if (aMSx.Contains(aSI)) {
       const BOPCol_ListOfShape &aLSx=aMSx.FindFromKey(aSI);
-      aNbSx=aLSx.Extent();
-      if (aNbSx) {
-        aMSI.Remove(aSI);
+      aNbSx = aLSx.Extent();
+      if (!aNbSx) {
+        aLSI.Append(aSI);
       }
     }
+    else {
+      aLSI.Append(aSI);
+    }
   }
   //
   // 4. Just check it
-  aNbSI=aMSI.Extent();
+  aNbSI = aLSI.Extent();
   if (!aNbSI) {
     return;
   }
@@ -1090,49 +1092,52 @@ void BOPAlgo_Builder::FillInternalShapes()
   for (; aIt.More(); aIt.Next()) {
     TopoDS_Solid aSd=TopoDS::Solid(aIt.Value());
     //
-    aItM.Initialize(aMSI); 
-    for (; aItM.More(); aItM.Next()) {
-      TopoDS_Shape aSI=aItM.Key();
+    aIt1.Initialize(aLSI);
+    for (; aIt1.More();) {
+      TopoDS_Shape aSI = aIt1.Value();
       aSI.Orientation(TopAbs_INTERNAL);
       //
       aState=BOPTools_AlgoTools::ComputeStateByOnePoint
         (aSI, aSd, 1.e-11, myContext);
-      if (aState==TopAbs_IN) {
+      //
+      if (aState != TopAbs_IN) {
+        aIt1.Next();
+        continue;
+      }
+      //
+      if(aMSOr.Contains(aSd)) {
         //
-        if(aMSOr.Contains(aSd)) {
-          //
-          TopoDS_Solid aSdx;
-          //
-          aBB.MakeSolid(aSdx);
-          aItS.Initialize(aSd);
-          for (; aItS.More(); aItS.Next()) {
-            const TopoDS_Shape& aSh=aItS.Value();
-            aBB.Add(aSdx, aSh);
-          }
-          //
-          aBB.Add(aSdx, aSI);
-          //
-          if (myImages.IsBound(aSdx)) {
-            BOPCol_ListOfShape& aLS=myImages.ChangeFind(aSdx);
-            aLS.Append(aSdx);
-          } 
-          else {
-            BOPCol_ListOfShape aLS;
-            aLS.Append(aSdx);
-            myImages.Bind(aSd, aLS);
-          }
-          //
-          aMSOr.Remove(aSd);
-          aSd=aSdx;
+        TopoDS_Solid aSdx;
+        //
+        aBB.MakeSolid(aSdx);
+        aItS.Initialize(aSd);
+        for (; aItS.More(); aItS.Next()) {
+          const TopoDS_Shape& aSh=aItS.Value();
+          aBB.Add(aSdx, aSh);
         }
+        //
+        aBB.Add(aSdx, aSI);
+        //
+        if (myImages.IsBound(aSdx)) {
+          BOPCol_ListOfShape& aLS=myImages.ChangeFind(aSdx);
+          aLS.Append(aSdx);
+        } 
         else {
-          aBB.Add(aSd, aSI);
+          BOPCol_ListOfShape aLS;
+          aLS.Append(aSdx);
+          myImages.Bind(aSd, aLS);
         }
         //
-        aMSI.Remove(aSI);
-      } //if (aState==TopAbs_IN) {
-    }// for (; aItM.More(); aItM.Next()) {
-  }//for (; aIt1.More(); aIt1.Next()) {
+        aMSOr.Remove(aSd);
+        aSd=aSdx;
+      }
+      else {
+        aBB.Add(aSd, aSI);
+      }
+      //
+      aLSI.Remove(aIt1);
+    }//for (; aIt1.More();) {
+  }//for (; aIt.More(); aIt.Next()) {
   //
   //-----------------------------------------------------scope t
   aLArgs.Clear();
index e918fc915acf827c6e7f7eb2eb257b8de3c536e2..54882518005b6163592723b2fbb6fa4f530f0e67 100644 (file)
@@ -46,7 +46,6 @@
   Standard_Boolean bWithSubShape;
   Standard_Integer n1, n2, iFlag, nX, n, aSize, i, j, k, aNbBlocks;
   Handle(NCollection_IncAllocator) aAllocator;
-  BOPCol_DataMapIteratorOfDataMapOfIntegerListOfInteger aItMILI;
   BOPCol_ListIteratorOfListOfInteger aItLI, aItLI2;
   TopoDS_Vertex aVn;
   BOPDS_ShapeInfo aSIn;
index dffce44d40861d1913c01d5ad82091acf9e63503..71af23d2e583c867dab37b607505e6ac185ec68f 100644 (file)
@@ -737,8 +737,7 @@ void BOPAlgo_PaveFiller::TreatNewVertices
   BOPCol_IndexedMapOfShape aMVProcessed;
   BOPCol_MapOfInteger aMFence;
   BOPCol_ListIteratorOfListOfInteger aIt;
-  BOPCol_DataMapOfShapeListOfShape aDMVLV;
-  BOPCol_DataMapIteratorOfDataMapOfShapeListOfShape aItDMVLV;
+  BOPCol_IndexedDataMapOfShapeListOfShape aDMVLV;
   //
   BOPCol_BoxBndTreeSelector aSelector;
   BOPCol_BoxBndTree aBBTree;
@@ -778,7 +777,6 @@ void BOPAlgo_PaveFiller::TreatNewVertices
     //
     Standard_Integer aIP, aNbIP1, aIP1;
     BOPCol_ListOfShape aLVSD;
-    BOPCol_MapIteratorOfMapOfInteger aItMI;
     BOPCol_ListOfInteger aLIP, aLIP1, aLIPC;
     BOPCol_ListIteratorOfListOfInteger aItLIP;
     //
@@ -823,14 +821,14 @@ void BOPAlgo_PaveFiller::TreatNewVertices
       aLVSD.Append(aVP);
     }
     aVF=aLVSD.First();
-    aDMVLV.Bind(aVF, aLVSD);
+    aDMVLV.Add(aVF, aLVSD);
   }// for (i=1; i<=aNbV; ++i) {
 
   // Make new vertices
-  aItDMVLV.Initialize(aDMVLV);
-  for(; aItDMVLV.More(); aItDMVLV.Next()) {
-    const TopoDS_Shape& aV=aItDMVLV.Key();
-    const BOPCol_ListOfShape& aLVSD=aItDMVLV.Value();
+  aNbV = aDMVLV.Extent();
+  for (i = 1; i <= aNbV; ++i) {
+    const TopoDS_Shape& aV = aDMVLV.FindKey(i);
+    const BOPCol_ListOfShape& aLVSD = aDMVLV(i);
     if (aLVSD.IsEmpty()) {
       myImages.Add(aV, aLVSD);
     }
index b51988c1ed65b6e82eb2612c11914ea855164002..7f2de978305f8960a454c59ee35f94c1284f6aa1 100644 (file)
@@ -65,8 +65,6 @@
 #include <BOPCol_MapOfInteger.hxx>
 #include <BOPCol_ListOfShape.hxx>
 #include <BOPCol_DataMapOfShapeInteger.hxx>
-#include <BOPCol_ListOfInteger.hxx>
-#include <BOPCol_IndexedMapOfInteger.hxx>
 #include <BOPCol_DataMapOfIntegerReal.hxx>
 #include <BOPCol_NCVector.hxx>
 #include <BOPCol_Parallel.hxx>
index 445f7ec23374de929174e379d17a860ac6368fd0..23a274c92e8f3c703d617e2d08f8869a7b6a7c3f 100644 (file)
 
 #include <BOPAlgo_PaveFiller.ixx>
 
-#include <NCollection_IncAllocator.hxx>
-
-#include <Geom_RectangularTrimmedSurface.hxx>
-#include <Geom_Plane.hxx>
-#include <Geom_Surface.hxx>
-#include <Geom_RectangularTrimmedSurface.hxx>
-
-#include <TopoDS_Vertex.hxx>
-#include <TopoDS_Edge.hxx>
-#include <TopoDS_Face.hxx>
-
-#include <BRepBndLib.hxx>
-
-#include <BRep_Tool.hxx>
-#include <BRep_Builder.hxx>
-
-#include <TopExp.hxx>
-#include <TopExp_Explorer.hxx>
-
-#include <Geom_Curve.hxx>
-#include <Geom_Surface.hxx>
-#include <Geom2d_Curve.hxx>
-
+#include <BOPAlgo_PaveFiller.hxx>
+#include <BOPAlgo_SectionAttribute.hxx>
+#include <BOPCol_IndexedMapOfShape.hxx>
 #include <BOPCol_NCVector.hxx>
 #include <BOPCol_Parallel.hxx>
 #include <BOPCol_MapOfShape.hxx>
 #include <BOPTools_AlgoTools.hxx>
 #include <BOPTools_AlgoTools2D.hxx>
 
+#include <BRep_Builder.hxx>
+#include <BRepBndLib.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
+#include <Geom2d_Curve.hxx>
+#include <Geom_Curve.hxx>
+#include <Geom_Surface.hxx>
+#include <Geom_Plane.hxx>
+#include <Geom_RectangularTrimmedSurface.hxx>
+
 static
   Standard_Boolean IsBasedOnPlane(const TopoDS_Face& aF);
 
@@ -472,8 +462,8 @@ void BOPAlgo_PaveFiller::MakePCurves()
 {
   Standard_Boolean bHasPC;
   Standard_Integer i, nF1, nF2, aNbC, k, nE, aNbFF, aNbFI, nEx;
+  Standard_Integer j, aNbPBIn, aNbPBOn;
   BOPDS_ListIteratorOfListOfPaveBlock aItLPB;
-  BOPDS_MapIteratorOfMapOfPaveBlock aItMPB;
   TopoDS_Face aF1F, aF2F;
   BOPAlgo_VectorOfMPC aVMPC;
   //
@@ -491,9 +481,9 @@ void BOPAlgo_PaveFiller::MakePCurves()
     aF1F.Orientation(TopAbs_FORWARD);
     // In
     const BOPDS_IndexedMapOfPaveBlock& aMPBIn=aFI.PaveBlocksIn();
-    aItMPB.Initialize(aMPBIn);
-    for(; aItMPB.More(); aItMPB.Next()) {
-      const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
+    aNbPBIn = aMPBIn.Extent();
+    for (j = 1; j <= aNbPBIn; ++j) {
+      const Handle(BOPDS_PaveBlock)& aPB = aMPBIn(j);
       nE=aPB->Edge();
       const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE)));
       //
@@ -505,9 +495,9 @@ void BOPAlgo_PaveFiller::MakePCurves()
     //
     // On
     const BOPDS_IndexedMapOfPaveBlock& aMPBOn=aFI.PaveBlocksOn();
-    aItMPB.Initialize(aMPBOn);
-    for(; aItMPB.More(); aItMPB.Next()) {
-      const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
+    aNbPBOn = aMPBOn.Extent();
+    for (j = 1; j <= aNbPBOn; ++j) {
+      const Handle(BOPDS_PaveBlock)& aPB = aMPBOn(j);
       nE=aPB->Edge();
       const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE)));
       bHasPC=BOPTools_AlgoTools2D::HasCurveOnSurface (aE, aF1F);
@@ -715,10 +705,9 @@ void BOPAlgo_PaveFiller::Prepare()
     TopAbs_FACE
   };
   Standard_Boolean bJustAdd, bIsBasedOnPlane;
-  Standard_Integer i, aNb, n1, nF;
+  Standard_Integer i, aNb, n1, nF, aNbF;
   TopExp_Explorer aExp;
-  BOPCol_MapOfShape aMF;
-  BOPCol_MapIteratorOfMapOfShape aItMF;
+  BOPCol_IndexedMapOfShape aMF;
   //
   myErrorStatus=0;
   //
@@ -736,15 +725,15 @@ void BOPAlgo_PaveFiller::Prepare()
     }
   }
   //
-  if (aMF.IsEmpty()) {
+  aNbF = aMF.Extent();
+  if (!aNbF) {
     return;
   }
   //
   BOPAlgo_VectorOfBPC aVBPC;
   //
-  aItMF.Initialize(aMF);
-  for (; aItMF.More(); aItMF.Next()) {
-    const TopoDS_Face& aF=*((TopoDS_Face *)&aItMF.Key());
+  for (i = 1; i <= aNbF; ++i) {
+    const TopoDS_Face& aF = *(TopoDS_Face*)&aMF(i);
     aExp.Init(aF, aType[1]);
     for (; aExp.More(); aExp.Next()) {
       const TopoDS_Edge& aE=*((TopoDS_Edge *)&aExp.Current());
index 82b8e33f8fec3447f9f3a58eee9cfde9f8a9454e..3f42376e10ebbac72a1c499fefd6638f009ea5d2 100644 (file)
@@ -142,15 +142,14 @@ static
                                           const Standard_Integer nF,
                                           BOPDS_ListOfPaveBlock& aLPBOut)
 {
-  Standard_Integer nV1, nV2;
-  BOPDS_MapIteratorOfMapOfPaveBlock aItMPB;
+  Standard_Integer i, aNbPBOn, aNbPBIn, aNbPBSc, nV1, nV2;
   //
   const BOPDS_FaceInfo& aFI=myDS->ChangeFaceInfo(nF);
   // In
   const BOPDS_IndexedMapOfPaveBlock& aMPBIn=aFI.PaveBlocksIn();
-  aItMPB.Initialize(aMPBIn);
-  for(; aItMPB.More(); aItMPB.Next()) {
-    const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
+  aNbPBIn = aMPBIn.Extent();
+  for (i = 1; i <= aNbPBIn; ++i) {
+    const Handle(BOPDS_PaveBlock)& aPB = aMPBIn(i);
     aPB->Indices(nV1, nV2);
     if (nV==nV1 || nV==nV2) {
       aLPBOut.Append(aPB);
@@ -158,9 +157,9 @@ static
   }
   // On
   const BOPDS_IndexedMapOfPaveBlock& aMPBOn=aFI.PaveBlocksOn();
-  aItMPB.Initialize(aMPBOn);
-  for(; aItMPB.More(); aItMPB.Next()) {
-    const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
+  aNbPBOn = aMPBOn.Extent();
+  for (i = 1; i <= aNbPBOn; ++i) {
+    const Handle(BOPDS_PaveBlock)& aPB = aMPBOn(i);
     aPB->Indices(nV1, nV2);
     if (nV==nV1 || nV==nV2) {
       aLPBOut.Append(aPB);
@@ -168,9 +167,9 @@ static
   }
   // Sections
   const BOPDS_IndexedMapOfPaveBlock& aMPBSc=aFI.PaveBlocksSc();
-  aItMPB.Initialize(aMPBSc);
-  for(; aItMPB.More(); aItMPB.Next()) {
-    const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
+  aNbPBSc = aMPBSc.Extent();
+  for (i = 1; i <= aNbPBSc; ++i) {
+    const Handle(BOPDS_PaveBlock)& aPB = aMPBSc(i);
     aPB->Indices(nV1, nV2);
     if (nV==nV1 || nV==nV2) {
       aLPBOut.Append(aPB);
index c01423e88ff71e07f67cb5795e90d7a22772cc08..9c8020d73d467e8929f5dd1adae0e7adcdac8247 100644 (file)
@@ -120,7 +120,6 @@ void BOPAlgo_WireSplitter::MakeConnexityBlocks()
   TopoDS_Iterator aItE;
   TopoDS_Shape aER;
   BOPCol_ListIteratorOfListOfShape aIt;
-  BOPCol_MapIteratorOfMapOfShape aItM;
   //
   BOPCol_IndexedDataMapOfShapeListOfShape aMVE(100, myAllocator);
   BOPCol_IndexedMapOfShape aMVP(100, myAllocator);
@@ -184,7 +183,7 @@ void BOPAlgo_WireSplitter::MakeConnexityBlocks()
             }
           }
         }
-      }//for (; aItM.More(); aItM.Next()) {
+      }//for (k=1; k<=aNbVP; ++k) {
       //
       aNbVP=aMVAdd.Extent();
       if (!aNbVP) {
index 34408661d91f36c18c207ac9b60fa22bd747c186..697d1eb68e2ea01f21a251a77108f346f68bb8d3 100644 (file)
 
 #include <BOPAlgo_WireSplitter.ixx>
 
-#include <Precision.hxx>
-
-#include <gp_Pnt2d.hxx>
-#include <gp_Vec2d.hxx>
-#include <gp_Dir2d.hxx>
-
-#include <Geom_Surface.hxx>
-#include <Geom_Plane.hxx>
-#include <Geom_RectangularTrimmedSurface.hxx>
+#include <BOPAlgo_WireEdgeSet.hxx>
+#include <BOPAlgo_WireSplitter.hxx>
+#include <BOPCol_IndexedDataMapOfShapeInteger.hxx>
+#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
+#include <BOPCol_ListOfShape.hxx>
+#include <BOPCol_MapOfShape.hxx>
+#include <BOPCol_SequenceOfPnt2d.hxx>
+#include <BOPCol_SequenceOfReal.hxx>
+#include <BOPCol_SequenceOfShape.hxx>
+#include <BOPTools_AlgoTools2D.hxx>
+#include <BRep_Builder.hxx>
+#include <BRep_Tool.hxx>
+#include <BRepAdaptor_Surface.hxx>
 #include <Geom2d_Curve.hxx>
 #include <Geom2d_Line.hxx>
 #include <GeomAdaptor_Surface.hxx>
@@ -42,9 +46,6 @@
 #include <BRep_Builder.hxx>
 
 #include <TopTools_ShapeMapHasher.hxx>
-#include <TopExp.hxx>
-#include <TopExp_Explorer.hxx>
-
 #include <BRepAdaptor_Surface.hxx>
 
 #include <BOPCol_ListOfShape.hxx>
@@ -848,8 +849,7 @@ void RefineAngles(const TopoDS_Face& myFace,
                   BOPAlgo_IndexedDataMapOfShapeListOfEdgeInfo& mySmartMap)
 {
   Standard_Integer aNb, i;
-  BOPCol_DataMapOfShapeInteger aMSI;
-  BOPCol_DataMapIteratorOfDataMapOfShapeInteger aItMSI;
+  BOPCol_IndexedDataMapOfShapeInteger aMSI;
   BOPCol_MapOfShape aMBE;
   BOPCol_ListIteratorOfListOfShape aIt;
   //
@@ -857,32 +857,29 @@ void RefineAngles(const TopoDS_Face& myFace,
   aIt.Initialize(myEdges);
   for(; aIt.More(); aIt.Next()) {
     const TopoDS_Shape& aE=aIt.Value();
-    if(aMSI.IsBound(aE)) {
-      Standard_Integer& iCnt=aMSI.ChangeFind(aE);
+    if(aMSI.Contains(aE)) {
+      Standard_Integer& iCnt = aMSI.ChangeFromKey(aE);
       ++iCnt;
     }
     else {
-      Standard_Integer iCnt=1;
-      aMSI.Bind(aE, iCnt);
+      Standard_Integer iCnt = 1;
+      aMSI.Add(aE, iCnt);
     }
   }
   //
-  aItMSI.Initialize(aMSI);
-  for(; aItMSI.More(); aItMSI.Next()) {
-    Standard_Integer iCnt;
-    //
-    const TopoDS_Shape& aE=aItMSI.Key();
-    iCnt=aItMSI.Value();
-    if (iCnt==1) {
+  aNb = aMSI.Extent();
+  for (i = 1; i <= aNb; ++i) {
+    Standard_Integer iCnt = aMSI(i);
+    if (iCnt == 1) {
+      const TopoDS_Shape& aE = aMSI.FindKey(i);
       aMBE.Add(aE);
     }
-    
   }
   //
   aMSI.Clear();
   //
-  aNb=mySmartMap.Extent();
-  for (i=1; i<=aNb; ++i) {
+  aNb = mySmartMap.Extent();
+  for (i = 1; i <= aNb; ++i) {
     const TopoDS_Vertex& aV=*((TopoDS_Vertex*)&mySmartMap.FindKey(i)); 
     BOPAlgo_ListOfEdgeInfo& aLEI=mySmartMap(i);
     //
index 05654dc8917ec15caabf08d435a5c49b47734fd7..1112492811cf7711e05285f8f217ff2c61ab41a1 100644 (file)
@@ -49,6 +49,7 @@ is
     imported DataMapOfIntegerListOfShape from BOPCol;
     imported IndexedDataMapOfIntegerListOfInteger from BOPCol;
     imported IndexedDataMapOfShapeInteger from BOPCol;  
-   
+    imported IndexedDataMapOfShapeShape; 
+    imported IndexedMapOfOrientedShape;   
     
 end BOPCol;
diff --git a/src/BOPCol/BOPCol_IndexedDataMapOfShapeShape.hxx b/src/BOPCol/BOPCol_IndexedDataMapOfShapeShape.hxx
new file mode 100644 (file)
index 0000000..8df38ff
--- /dev/null
@@ -0,0 +1,25 @@
+// Created by: Eugeny MALTCHIKOV
+// Copyright (c) 2015 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef BOPCol_IndexedDataMapOfShapeShape_HeaderFile
+#define BOPCol_IndexedDataMapOfShapeShape_HeaderFile
+
+#include <TopoDS_Shape.hxx>
+#include <TopTools_ShapeMapHasher.hxx>
+
+#include <NCollection_IndexedDataMap.hxx>
+
+typedef NCollection_IndexedDataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher> BOPCol_IndexedDataMapOfShapeShape;
+
+#endif
diff --git a/src/BOPCol/BOPCol_IndexedMapOfOrientedShape.hxx b/src/BOPCol/BOPCol_IndexedMapOfOrientedShape.hxx
new file mode 100644 (file)
index 0000000..3848b37
--- /dev/null
@@ -0,0 +1,25 @@
+// Created by: Eugeny MALTCHIKOV
+// Copyright (c) 2015 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef BOPCol_IndexedMapOfOrientedShape_HeaderFile
+#define BOPCol_IndexedMapOfOrientedShape_HeaderFile
+
+#include <TopoDS_Shape.hxx>  
+#include <TopTools_OrientedShapeMapHasher.hxx>
+
+#include <NCollection_IndexedMap.hxx>
+
+typedef NCollection_IndexedMap<TopoDS_Shape, TopTools_OrientedShapeMapHasher> BOPCol_IndexedMapOfOrientedShape;
+
+#endif
index 8be3e7ddbdc7089afe9fdd056f705b3662d4c601..e30dd413eda0d904ba69278bfe1907d265d889fe 100644 (file)
@@ -19,6 +19,8 @@ BOPCol_DataMapOfShapeListOfShape.hxx
 BOPCol_MapOfOrientedShape.hxx
 BOPCol_IndexedDataMapOfShapeListOfShape.hxx
 BOPCol_IndexedMapOfShape.hxx
+BOPCol_IndexedDataMapOfShapeShape.hxx
+BOPCol_IndexedMapOfOrientedShape.hxx
 BOPCol_ListOfListOfShape.hxx
 BOPCol_SequenceOfShape.hxx
 BOPCol_SequenceOfPnt2d.hxx
index f4e133a7cc5314a09d8e91fe82be0060153778bf..12f4440fb2b54807cd589296e62102e86ef5d94f 100644 (file)
@@ -1363,7 +1363,7 @@ void BOPDS_DS::FaceInfoIn(const Standard_Integer theF,
     if (aSx.ShapeType()==TopAbs_VERTEX){
       nV=Index(aSx);
       if (HasShapeSD(nV, nVSD)) {
- nV=nVSD;
       nV=nVSD;
       }
       theMI.Add(nV);
     }
@@ -1446,20 +1446,19 @@ void BOPDS_DS::AloneVertices(const Standard_Integer theI,
 {
   if (HasFaceInfo(theI)) {
     //
-    Standard_Integer i, nV1, nV2, nV;
-    BOPDS_MapIteratorOfMapOfPaveBlock aItMPB;
+    Standard_Integer i, j, nV1, nV2, nV, aNbPB;
     BOPCol_MapIteratorOfMapOfInteger aItMI;
     //
     BOPCol_MapOfInteger aMI(100, myAllocator);
     //
     const BOPDS_FaceInfo& aFI=FaceInfo(theI);
     //
-    for (i=0; i<2; ++i) {
+    for (i = 0; i < 2; ++i) {
       const BOPDS_IndexedMapOfPaveBlock& aMPB=
         (!i) ? aFI.PaveBlocksIn() : aFI.PaveBlocksSc();
-      aItMPB.Initialize(aMPB);
-      for (; aItMPB.More(); aItMPB.Next()) {
-        const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
+      aNbPB = aMPB.Extent();
+      for (j = 1; j <= aNbPB; ++j) {
+        const Handle(BOPDS_PaveBlock)& aPB = aMPB(j);
         aPB->Indices(nV1, nV2);
         aMI.Add(nV1);
         aMI.Add(nV2);
index c3ab3c1894c0b3f2c732504d95e54c704fd275b3..bd477d0ff6642c235424242428eac4ab21b3e93f 100644 (file)
@@ -37,7 +37,6 @@
 #include <BOPCol_DataMapOfShapeInteger.hxx>
 #include <BOPCol_DataMapOfIntegerInteger.hxx>
 #include <BOPCol_DataMapOfIntegerListOfInteger.hxx>
-#include <BOPCol_IndexedMapOfInteger.hxx>
 #include <BOPDS_ShapeInfo.hxx>
 #include <BOPCol_ListOfInteger.hxx>
 #include <BOPCol_IndexedMapOfInteger.hxx>
@@ -93,7 +92,6 @@ void BOPDS_IteratorSI::Intersect()
   TopAbs_ShapeEnum aTi, aTj;
   Handle(NCollection_IncAllocator) aAllocator;
   BOPCol_ListIteratorOfListOfInteger aIt;
-  BOPCol_DataMapIteratorOfDataMapOfIntegerListOfInteger aItVSD;
   //
   //-----------------------------------------------------scope_1 f
   aAllocator=new NCollection_IncAllocator();
@@ -124,10 +122,10 @@ void BOPDS_IteratorSI::Intersect()
       const BOPCol_ListOfInteger& aLA=aSI.SubShapes();
       aIt.Initialize(aLA);
       for (; aIt.More(); aIt.Next()) {
-       iX=aIt.Value();
-       aPKXB.Clear();
-       aPKXB.SetIds(i, iX);
-       aMPA.Add(aPKXB);
+        iX=aIt.Value();
+        aPKXB.Clear();
+        aPKXB.SetIds(i, iX);
+        aMPA.Add(aPKXB);
       }
     }
     //