From: emv Date: Wed, 15 Jul 2015 10:09:36 +0000 (+0300) Subject: 0026019: Unstable behavior of test cases with operation mkvolume X-Git-Tag: V7_0_0_beta~414 X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff_plain;h=319da2e43f8966812ec36cb3f097e760979e8a45 0026019: Unstable behavior of test cases with operation mkvolume The maps have been replaced with indexed maps to provide stability of the algorithms based on the General Fuse algorithm. --- diff --git a/src/BOPAlgo/BOPAlgo_ArgumentAnalyzer.cxx b/src/BOPAlgo/BOPAlgo_ArgumentAnalyzer.cxx index bb075bf244..2a058586ac 100644 --- a/src/BOPAlgo/BOPAlgo_ArgumentAnalyzer.cxx +++ b/src/BOPAlgo/BOPAlgo_ArgumentAnalyzer.cxx @@ -12,13 +12,13 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. - #include #include #include #include #include #include +#include #include #include #include @@ -50,8 +50,6 @@ #include #include #include - -// // ================================================================================ // function: Constructor // purpose: @@ -814,10 +812,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; @@ -825,7 +822,7 @@ void BOPAlgo_ArgumentAnalyzer::TestContinuity() continue; } // - BOPCol_MapOfShape aMS; + BOPCol_IndexedMapOfShape aMS; //Edges aExp.Init(aS, TopAbs_EDGE); for (; aExp.More(); aExp.Next()) { @@ -849,9 +846,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); diff --git a/src/BOPAlgo/BOPAlgo_BOP.cxx b/src/BOPAlgo/BOPAlgo_BOP.cxx index 234bfd81f9..18c743ef0b 100644 --- a/src/BOPAlgo/BOPAlgo_BOP.cxx +++ b/src/BOPAlgo/BOPAlgo_BOP.cxx @@ -39,15 +39,11 @@ #include #include +typedef NCollection_IndexedDataMap + BOPTools_IndexedDataMapOfSetShape; // -typedef NCollection_DataMap - BOPTools_DataMapOfSetShape; -// -typedef BOPTools_DataMapOfSetShape::Iterator - BOPTools_DataMapIteratorOfDataMapOfSetShape; - static TopAbs_ShapeEnum TypeToExplore(const Standard_Integer theDim); @@ -515,7 +511,7 @@ void BOPAlgo_BOP::BuildRC() BOPCol_ListIteratorOfListOfShape aItLS, aItIm; Standard_Boolean bHasInterf; Standard_Integer iX; - BOPTools_DataMapOfSetShape aDMSTS; + BOPTools_IndexedDataMapOfSetShape aDMSTS; // myErrorStatus=0; // @@ -575,7 +571,7 @@ void BOPAlgo_BOP::BuildRC() // aST.Add(aSIm, TopAbs_FACE); // - aDMSTS.Bind(aST, aSIm); + aDMSTS.Add(aST, aSIm); } } } @@ -640,8 +636,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); } } @@ -654,7 +650,7 @@ void BOPAlgo_BOP::BuildRC() // aST.Add(aSIm, TopAbs_FACE); // - bIsBound=aDMSTS.IsBound(aST); + bIsBound=aDMSTS.Contains(aST); } // if (!bIsBound) { @@ -821,8 +817,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; // @@ -878,8 +873,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; @@ -976,9 +971,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); } // diff --git a/src/BOPAlgo/BOPAlgo_BuilderArea.hxx b/src/BOPAlgo/BOPAlgo_BuilderArea.hxx index 092d479168..78c1dcc723 100644 --- a/src/BOPAlgo/BOPAlgo_BuilderArea.hxx +++ b/src/BOPAlgo/BOPAlgo_BuilderArea.hxx @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include class IntTools_Context; @@ -72,7 +72,7 @@ Standard_EXPORT virtual ~BOPAlgo_BuilderArea(); BOPCol_ListOfShape myLoops; BOPCol_ListOfShape myLoopsInternal; BOPCol_ListOfShape myAreas; - BOPCol_MapOfOrientedShape myShapesToAvoid; + BOPCol_IndexedMapOfOrientedShape myShapesToAvoid; private: diff --git a/src/BOPAlgo/BOPAlgo_BuilderFace.cxx b/src/BOPAlgo/BOPAlgo_BuilderFace.cxx index 9f27d2a2c3..19885937d7 100644 --- a/src/BOPAlgo/BOPAlgo_BuilderFace.cxx +++ b/src/BOPAlgo/BOPAlgo_BuilderFace.cxx @@ -16,7 +16,6 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. - #include #include #include @@ -27,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -56,14 +56,6 @@ #include #include -// -// -// -// -// -// -// -// // // // @@ -79,7 +71,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& , @@ -333,9 +325,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 +375,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 +393,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 +403,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; } @@ -446,7 +435,7 @@ void BOPAlgo_BuilderFace::PerformLoops() }//for (; aItE.More(); aItE.Next()) { }//for (; aItW.More(); aItW.Next()) { myLoopsInternal.Append(aW); - }//for (; aItM.More(); aItM.Next()) { + }//for (i = 1; (i <= aNbEA) && bFlag; ++i) { } //======================================================================= //function : PerformAreas @@ -705,11 +694,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; // @@ -720,10 +709,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); @@ -734,13 +722,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 @@ -755,13 +747,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; } @@ -771,24 +759,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; } diff --git a/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx b/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx index 292a58cf03..52ea0d569b 100644 --- a/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx +++ b/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx @@ -15,14 +15,13 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. // - - #include #include #include #include #include #include +#include #include #include #include @@ -63,17 +62,6 @@ #include #include -// -// -// -// -// -// -// -// -// -// -// // static Standard_Boolean IsGrowthShell(const TopoDS_Shape& , @@ -86,7 +74,7 @@ static const TopoDS_Shape& , Handle(IntTools_Context)& ); static - void MakeInternalShells(const BOPCol_MapOfShape& , + void MakeInternalShells(const BOPCol_IndexedMapOfShape& , BOPCol_ListOfShape& ); //======================================================================= @@ -261,14 +249,7 @@ typedef BOPCol_ContextCnt Handle(IntTools_Context)> BOPAlgo_FaceSolidCnt; // //======================================================================= -typedef NCollection_DataMap - BOPAlgo_DataMapOfShapePnt; -typedef BOPAlgo_DataMapOfShapePnt::Iterator - BOPAlgo_DataMapIteratorOfDataMapOfShapePnt; -// //======================================================================= //function : //purpose : @@ -448,10 +429,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 +492,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 +516,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 +564,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 +576,8 @@ void BOPAlgo_BuilderSolid::PerformAreas() NCollection_UBTreeFiller 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 +675,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 +734,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 +763,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 +783,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 +963,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; } diff --git a/src/BOPAlgo/BOPAlgo_Builder_1.cxx b/src/BOPAlgo/BOPAlgo_Builder_1.cxx index 0458073f4e..bc7716ed81 100644 --- a/src/BOPAlgo/BOPAlgo_Builder_1.cxx +++ b/src/BOPAlgo/BOPAlgo_Builder_1.cxx @@ -141,19 +141,19 @@ 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); + } } } } @@ -286,9 +286,9 @@ 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 { diff --git a/src/BOPAlgo/BOPAlgo_Builder_2.cxx b/src/BOPAlgo/BOPAlgo_Builder_2.cxx index 0db8de23b8..e28a036846 100644 --- a/src/BOPAlgo/BOPAlgo_Builder_2.cxx +++ b/src/BOPAlgo/BOPAlgo_Builder_2.cxx @@ -265,7 +265,6 @@ void BOPAlgo_Builder::BuildSplitFaces() BOPCol_MapOfShape aMFence; Handle(NCollection_BaseAllocator) aAllocator; BOPCol_ListOfShape aLFIm(myAllocator); - BOPCol_MapIteratorOfMapOfShape aItMS; BOPAlgo_VectorOfBuilderFace aVBF; // myErrorStatus=0; @@ -867,27 +866,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; } diff --git a/src/BOPAlgo/BOPAlgo_Builder_3.cxx b/src/BOPAlgo/BOPAlgo_Builder_3.cxx index 6bd36a448c..8570c4c437 100644 --- a/src/BOPAlgo/BOPAlgo_Builder_3.cxx +++ b/src/BOPAlgo/BOPAlgo_Builder_3.cxx @@ -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(); diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_1.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_1.cxx index 4899fe710b..8eb388e51f 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_1.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_1.cxx @@ -47,7 +47,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; diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx index e87967449b..4220a2d2fc 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx @@ -740,8 +740,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; @@ -781,7 +780,6 @@ void BOPAlgo_PaveFiller::TreatNewVertices // Standard_Integer aIP, aNbIP1, aIP1; BOPCol_ListOfShape aLVSD; - BOPCol_MapIteratorOfMapOfInteger aItMI; BOPCol_ListOfInteger aLIP, aLIP1, aLIPC; BOPCol_ListIteratorOfListOfInteger aItLIP; // @@ -826,14 +824,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); } diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx index ce8ffb26c7..afbfeedb2f 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx @@ -15,14 +15,12 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. - #include #include #include #include #include #include -#include #include #include #include diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_7.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_7.cxx index f248d70a9d..77f2bc0f28 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_7.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_7.cxx @@ -15,10 +15,9 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. - #include #include -#include +#include #include #include #include @@ -55,6 +54,7 @@ #include #include + static Standard_Boolean IsBasedOnPlane(const TopoDS_Face& aF); @@ -464,8 +464,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; // @@ -483,9 +483,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))); // @@ -497,9 +497,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); @@ -707,10 +707,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; // @@ -728,15 +727,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()); diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_8.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_8.cxx index 27629cb3d3..2e967df6f0 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_8.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_8.cxx @@ -138,15 +138,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); @@ -154,9 +153,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); @@ -164,9 +163,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); diff --git a/src/BOPAlgo/BOPAlgo_WireSplitter.cxx b/src/BOPAlgo/BOPAlgo_WireSplitter.cxx index d34ecedb0a..e79d00590c 100644 --- a/src/BOPAlgo/BOPAlgo_WireSplitter.cxx +++ b/src/BOPAlgo/BOPAlgo_WireSplitter.cxx @@ -118,7 +118,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); @@ -182,7 +181,7 @@ void BOPAlgo_WireSplitter::MakeConnexityBlocks() } } } - }//for (; aItM.More(); aItM.Next()) { + }//for (k=1; k<=aNbVP; ++k) { // aNbVP=aMVAdd.Extent(); if (!aNbVP) { diff --git a/src/BOPAlgo/BOPAlgo_WireSplitter_1.cxx b/src/BOPAlgo/BOPAlgo_WireSplitter_1.cxx index a1afa2f5e0..9ba28c6ce9 100644 --- a/src/BOPAlgo/BOPAlgo_WireSplitter_1.cxx +++ b/src/BOPAlgo/BOPAlgo_WireSplitter_1.cxx @@ -12,10 +12,9 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. - #include #include -#include +#include #include #include #include @@ -49,7 +48,6 @@ #include #include #include - typedef NCollection_DataMap \ \ BOPCol_DataMapOfShapeBoolean; @@ -841,8 +839,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; // @@ -850,32 +847,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); // diff --git a/src/BOPCol/BOPCol_IndexedDataMapOfShapeShape.hxx b/src/BOPCol/BOPCol_IndexedDataMapOfShapeShape.hxx new file mode 100644 index 0000000000..8df38ff4b4 --- /dev/null +++ b/src/BOPCol/BOPCol_IndexedDataMapOfShapeShape.hxx @@ -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 +#include + +#include + +typedef NCollection_IndexedDataMap BOPCol_IndexedDataMapOfShapeShape; + +#endif diff --git a/src/BOPCol/BOPCol_IndexedMapOfOrientedShape.hxx b/src/BOPCol/BOPCol_IndexedMapOfOrientedShape.hxx new file mode 100644 index 0000000000..3848b37848 --- /dev/null +++ b/src/BOPCol/BOPCol_IndexedMapOfOrientedShape.hxx @@ -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 +#include + +#include + +typedef NCollection_IndexedMap BOPCol_IndexedMapOfOrientedShape; + +#endif diff --git a/src/BOPCol/FILES b/src/BOPCol/FILES index 172c1b8ca9..cd2addcbe3 100644 --- a/src/BOPCol/FILES +++ b/src/BOPCol/FILES @@ -21,6 +21,8 @@ BOPCol_IndexedDataMapOfShapeInteger.hxx BOPCol_IndexedDataMapOfShapeListOfShape.hxx BOPCol_IndexedMapOfInteger.hxx BOPCol_IndexedMapOfShape.hxx +BOPCol_IndexedDataMapOfShapeShape.hxx +BOPCol_IndexedMapOfOrientedShape.hxx BOPCol_ListOfInteger.hxx BOPCol_ListOfListOfShape.hxx BOPCol_ListOfShape.hxx diff --git a/src/BOPDS/BOPDS_DS.cxx b/src/BOPDS/BOPDS_DS.cxx index fcae9ea309..732a5e138e 100644 --- a/src/BOPDS/BOPDS_DS.cxx +++ b/src/BOPDS/BOPDS_DS.cxx @@ -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); diff --git a/src/BOPDS/BOPDS_IteratorSI.cxx b/src/BOPDS/BOPDS_IteratorSI.cxx index 76a4d4f009..3cf6c4c891 100644 --- a/src/BOPDS/BOPDS_IteratorSI.cxx +++ b/src/BOPDS/BOPDS_IteratorSI.cxx @@ -12,14 +12,12 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. - #include #include #include #include #include #include -#include #include #include #include @@ -89,7 +87,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(); @@ -120,10 +117,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); } } //