diff --git a/src/BOPAlgo/BOPAlgo_BOP_1.cxx b/src/BOPAlgo/BOPAlgo_BOP_1.cxx index 6c202ec6e7..0583c96c83 100644 --- a/src/BOPAlgo/BOPAlgo_BOP_1.cxx +++ b/src/BOPAlgo/BOPAlgo_BOP_1.cxx @@ -43,12 +43,11 @@ void BOPAlgo_BOP::BuildSection() { - Standard_Integer i, aNb, nE; + Standard_Integer i, aNb, nE, aNbPB, j; TopoDS_Shape aRC; BRep_Builder aBB; BOPCol_MapOfShape aME; BOPDS_ListIteratorOfListOfPaveBlock aItLPB; - BOPDS_MapIteratorOfMapOfPaveBlock aItMPB; // myErrorStatus=0; // @@ -78,11 +77,11 @@ aNb=aFIP.Extent(); for (i=0; iEdge(); const TopoDS_Shape& aE=myDS->Shape(nE); if (aME.Add(aE)) { diff --git a/src/BOPAlgo/BOPAlgo_Builder_2.cxx b/src/BOPAlgo/BOPAlgo_Builder_2.cxx index cc9814dba3..3da81279cd 100644 --- a/src/BOPAlgo/BOPAlgo_Builder_2.cxx +++ b/src/BOPAlgo/BOPAlgo_Builder_2.cxx @@ -67,10 +67,10 @@ static static void FillMap(const TopoDS_Shape& aS1, const TopoDS_Shape& aS2, - BOPCol_DataMapOfShapeListOfShape& aDMSLS, + BOPCol_IndexedDataMapOfShapeListOfShape& aDMSLS, Handle(NCollection_IncAllocator)& aAllocator); static - void MakeBlocksCnx(const BOPCol_DataMapOfShapeListOfShape& aMILI, + void MakeBlocksCnx(const BOPCol_IndexedDataMapOfShapeListOfShape& aMILI, BOPCol_DataMapOfIntegerListOfShape& aMBlocks, Handle(NCollection_IncAllocator)& aAllocator); @@ -95,13 +95,12 @@ static void BOPAlgo_Builder::BuildSplitFaces() { Standard_Boolean bHasFaceInfo, bIsClosed, bIsDegenerated, bToReverse; - Standard_Integer i, aNbS, aNbPBIn, aNbPBOn, aNbPBSc, aNbAV, nSp; + Standard_Integer i, j, aNbS, aNbPBIn, aNbPBOn, aNbPBSc, aNbAV, nSp; TopoDS_Face aFF, aFSD; TopoDS_Edge aSp, aEE; TopAbs_Orientation anOriF, anOriE; TopExp_Explorer aExp; BOPCol_ListIteratorOfListOfShape aIt; - BOPDS_MapIteratorOfMapOfPaveBlock aItMPB; BOPCol_ListOfInteger aLIAV; BOPCol_MapOfShape aMFence; Handle(NCollection_IncAllocator) aAllocator; @@ -135,9 +134,9 @@ static // const BOPDS_FaceInfo& aFI=myDS->FaceInfo(i); // - const BOPDS_MapOfPaveBlock& aMPBIn=aFI.PaveBlocksIn(); - const BOPDS_MapOfPaveBlock& aMPBOn=aFI.PaveBlocksOn(); - const BOPDS_MapOfPaveBlock& aMPBSc=aFI.PaveBlocksSc(); + const BOPDS_IndexedMapOfPaveBlock& aMPBIn=aFI.PaveBlocksIn(); + const BOPDS_IndexedMapOfPaveBlock& aMPBOn=aFI.PaveBlocksOn(); + const BOPDS_IndexedMapOfPaveBlock& aMPBSc=aFI.PaveBlocksSc(); aLIAV.Clear(); myDS->AloneVertices(i, aLIAV); @@ -226,9 +225,8 @@ static // // // 1.2 In edges - aItMPB.Initialize(aMPBIn); - for (; aItMPB.More(); aItMPB.Next()) { - const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value(); + for (j=1; j<=aNbPBIn; ++j) { + const Handle(BOPDS_PaveBlock)& aPB=aMPBIn(j); nSp=aPB->Edge(); aSp=(*(TopoDS_Edge*)(&myDS->Shape(nSp))); // @@ -240,9 +238,8 @@ static // // // 1.3 Section edges - aItMPB.Initialize(aMPBSc); - for (; aItMPB.More(); aItMPB.Next()) { - const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value(); + for (j=1; j<=aNbPBSc; ++j) { + const Handle(BOPDS_PaveBlock)& aPB=aMPBSc(j); nSp=aPB->Edge(); aSp=(*(TopoDS_Edge*)(&myDS->Shape(nSp))); // @@ -256,7 +253,7 @@ static BOPAlgo_BuilderFace aBF(aAllocator); // aBF.SetFace(aFF); - aBF.SetContext(myContext); + //aBF.SetContext(myContext); // // <-DEB ft // @@ -298,7 +295,6 @@ static Handle(NCollection_IncAllocator) aAllocator; BOPCol_ListIteratorOfListOfShape aItF1, aItF2; BOPTools_ListOfCoupleOfShape aLCS; - BOPCol_DataMapIteratorOfDataMapOfIntegerListOfShape aItBlocks; BOPCol_ListIteratorOfListOfShape aItLS; // myErrorStatus=0; @@ -311,7 +307,7 @@ static } //-----------------------------------------------------scope f aAllocator=new NCollection_IncAllocator(); - BOPCol_DataMapOfShapeListOfShape aDMSLS(100, aAllocator); + BOPCol_IndexedDataMapOfShapeListOfShape aDMSLS(100, aAllocator); BOPCol_DataMapOfIntegerListOfShape aMBlocks(100, aAllocator); BOPTools_DataMapOfShapeSet aMSST(100, aAllocator); // @@ -403,16 +399,13 @@ static } } // for (i=0; i aMSDF - aItBlocks.Initialize(aMBlocks); - for (; aItBlocks.More(); aItBlocks.Next()) { - const BOPCol_ListOfShape& aLSD=aItBlocks.Value(); + aNbS = aMBlocks.Extent(); + for (i=0; iShapeInfo(i); + // + if (aSI.ShapeType()!=TopAbs_SOLID) { + continue; + } + // + const TopoDS_Shape& aS=aSI.Shape(); + if(!theDraftSolids.IsBound(aS)) { + continue; + } + const TopoDS_Shape& aSD=theDraftSolids.Find(aS); const BOPCol_ListOfShape& aLFIN= (theInParts.IsBound(aS)) ? theInParts.Find(aS) : aLSEmpty; // @@ -492,7 +495,7 @@ static // 1.3 Build new solids BOPAlgo_BuilderSolid aSB(theAllocator); // - aSB.SetContext(myContext); + //aSB.SetContext(myContext); aSB.SetShapes(aSFS); aSB.Perform(); iErr=aSB.ErrorStatus(); diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller.cdl b/src/BOPAlgo/BOPAlgo_PaveFiller.cdl index 39c5441bbb..51ad584bfd 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller.cdl +++ b/src/BOPAlgo/BOPAlgo_PaveFiller.cdl @@ -35,8 +35,10 @@ uses MapOfInteger from BOPCol, ListOfInteger from BOPCol, DataMapOfShapeInteger from BOPCol, + IndexedDataMapOfShapeInteger from BOPCol, DataMapOfIntegerListOfInteger from BOPCol, DataMapOfShapeListOfShape from BOPCol, + IndexedDataMapOfShapeListOfShape from BOPCol, -- Context from BOPInt, -- @@ -47,8 +49,8 @@ uses Iterator from BOPDS, PIterator from BOPDS, PaveBlock from BOPDS, - Curve from BOPDS, - DataMapOfShapeCoupleOfPaveBlocks from BOPDS, + Curve from BOPDS, + IndexedDataMapOfShapeCoupleOfPaveBlocks from BOPDS, MapOfPaveBlock from BOPDS, ListOfPaveBlock from BOPDS, ListOfPave from BOPDS, @@ -140,14 +142,14 @@ is thePB:out PaveBlock from BOPDS) is protected; - PerformVertices(me:out; - theMVCPB:out DataMapOfShapeCoupleOfPaveBlocks from BOPDS; + PerformVerticesEE(me:out; + theMVCPB:out IndexedDataMapOfShapeCoupleOfPaveBlocks from BOPDS; theAllocator:out BaseAllocator from BOPCol) returns Integer from Standard is protected; - PerformVertices1(me:out; - theMVCPB:out DataMapOfShapeCoupleOfPaveBlocks from BOPDS; + PerformVerticesEF(me:out; + theMVCPB:out IndexedDataMapOfShapeCoupleOfPaveBlocks from BOPDS; theAllocator:out BaseAllocator from BOPCol) returns Integer from Standard is protected; @@ -182,8 +184,7 @@ is theTolR3D:Real from Standard; theNC:out Curve from BOPDS; nF1:Integer from Standard; - nF2:Integer from Standard; - aMVB:out MapOfInteger from BOPCol) + nF2:Integer from Standard) is protected; ExtendedTolerance(me:out; @@ -199,8 +200,7 @@ is theTolR3D:Real from Standard; theNC:out Curve from BOPDS; --modified by NIZHNY-EMV Thu Mar 31 14:40:58 2011 - theMVOnIn:out MapOfInteger from BOPCol; - theMVB:out MapOfInteger from BOPCol) + theMVOnIn:out MapOfInteger from BOPCol) --modified by NIZHNY-EMV Thu Mar 31 14:41:02 2011 is protected; @@ -208,7 +208,8 @@ is thePB:PaveBlock from BOPDS; theNC:Curve from BOPDS; theTolR3D:Real from Standard; - theMPB:MapOfPaveBlock from BOPDS) + theMPB:MapOfPaveBlock from BOPDS; + thePBOut:out PaveBlock from BOPDS) returns Boolean from Standard is protected; @@ -221,7 +222,7 @@ is is protected; PostTreatFF(me:out; - theMSCPB:out DataMapOfShapeCoupleOfPaveBlocks from BOPDS; + theMSCPB:out IndexedDataMapOfShapeCoupleOfPaveBlocks from BOPDS; theMVI:out DataMapOfShapeInteger from BOPCol; theAllocator:out BaseAllocator from BOPCol) returns Integer from Standard @@ -305,10 +306,9 @@ is ProcessExistingPaveBlocks(me:out; theInt : Integer from Standard; theMPBOnIn : MapOfPaveBlock from BOPDS; - theMV : MapOfInteger from BOPCol; - theMPB : out MapOfPaveBlock from BOPDS; - theMSCPB : out DataMapOfShapeCoupleOfPaveBlocks from BOPDS; - theMVI : out DataMapOfShapeInteger from BOPCol) + theMSCPB : out IndexedDataMapOfShapeCoupleOfPaveBlocks from BOPDS; + theMVI : out DataMapOfShapeInteger from BOPCol; + theMPB : out MapOfPaveBlock from BOPDS) is protected; --modified by NIZHNY-EMV Fri Dec 23 15:40:06 2011 @@ -322,8 +322,8 @@ is --modified by NIZHNY-EMV Wed Jan 11 10:59:32 2012 TreatNewVertices(me:out; - theMVI : DataMapOfShapeInteger from BOPCol; - theImages : out DataMapOfShapeListOfShape from BOPCol) + theMVI : IndexedDataMapOfShapeInteger from BOPCol; + theImages : out IndexedDataMapOfShapeListOfShape from BOPCol) is protected; --modified by NIZHNY-EMV Wed Jan 11 10:59:33 2012 @@ -336,15 +336,21 @@ is --- is closed 3D-curve --modified by NIZHNY-EMV Wed Feb 15 08:40:02 2012 - IsCommonBlockOnFaces(me:out; - aPB : PaveBlock from BOPDS; - nF1 : Integer from Standard; - nF2 : Integer from Standard) - returns Boolean from Standard + PreparePostTreatFF(me:out; + aInt : Integer from Standard; + aPB : PaveBlock from BOPDS; + aMSCPB : out IndexedDataMapOfShapeCoupleOfPaveBlocks from BOPDS; + aMVI : out DataMapOfShapeInteger from BOPCol; + aVC : out VectorOfCurve from BOPDS) is protected; ---Purpose: - --- Checks if the PaveBlock aPB is common block - --- for faces with indices nF1 and nF2 + ---Keeps data for post treatment + + RefineFaceInfoOn(me:out) + is protected; + ---Purpose: + --- Refines the state On for the all faces having + --- state information fields myArguments : ListOfShape from BOPCol is protected; diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller.cxx index e9f2ad2bef..ffc14e0cd3 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller.cxx @@ -198,8 +198,6 @@ return; } // - myDS->RefineFaceInfoOn(); - // // 22 PerformFF(); if (myErrorStatus) { @@ -211,6 +209,8 @@ return; } // + RefineFaceInfoOn(); + // MakePCurves(); if (myErrorStatus) { return; diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_1.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_1.cxx index 23dcfa87ba..bf90059acb 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_1.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_1.cxx @@ -49,7 +49,7 @@ void BOPAlgo_PaveFiller::PerformVV() { Standard_Boolean bWithSubShape; - Standard_Integer n1, n2, iFlag, nX, n, aSize, i, aNbVV, j, iX; + Standard_Integer n1, n2, iFlag, nX, n, aSize, i, aNbVV, j, iX, k, aNbBlocks; Handle(NCollection_IncAllocator) aAllocator; BOPCol_DataMapIteratorOfDataMapOfIntegerListOfInteger aItMILI; BOPCol_ListIteratorOfListOfInteger aItLI, aItLI2; @@ -73,7 +73,7 @@ // //-----------------------------------------------------scope f aAllocator=new NCollection_IncAllocator(); - BOPCol_DataMapOfIntegerListOfInteger aMILI(100, aAllocator); + BOPCol_IndexedDataMapOfIntegerListOfInteger aMILI(100, aAllocator); BOPCol_DataMapOfIntegerListOfInteger aMBlocks(100, aAllocator); BOPCol_ListOfShape aLV(aAllocator); // @@ -94,9 +94,9 @@ BOPAlgo_Tools::MakeBlocksCnx(aMILI, aMBlocks, aAllocator); // // 3. Make vertices - aItMILI.Initialize(aMBlocks); - for (; aItMILI.More(); aItMILI.Next()) { - const BOPCol_ListOfInteger& aLI=aItMILI.Value(); + aNbBlocks=aMBlocks.Extent(); + for (k=0; ki) { - n2=aItLI2.Value(); - // - myDS->AddInterf(n1, n2); - iX=aVVs.Append()-1; - BOPDS_InterfVV& aVV=aVVs(iX); - aVV.SetIndices(n1, n2); - aVV.SetIndexNew(n); - } + if (j>i) { + n2=aItLI2.Value(); + // + myDS->AddInterf(n1, n2); + iX=aVVs.Append()-1; + BOPDS_InterfVV& aVV=aVVs(iX); + aVV.SetIndices(n1, n2); + aVV.SetIndexNew(n); + } } } } diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx index fe1acfc107..171705a81b 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx @@ -91,8 +91,8 @@ // //-----------------------------------------------------scope f aAllocator=new NCollection_IncAllocator(); - BOPDS_DataMapOfPaveBlockListOfPaveBlock aMPBLPB(100, aAllocator); - BOPDS_DataMapOfShapeCoupleOfPaveBlocks aMVCPB(100, aAllocator); + BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock aMPBLPB(100, aAllocator); + BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks aMVCPB(100, aAllocator); // aDiscretize=30; aDeflection=0.01; @@ -133,9 +133,12 @@ Handle(BOPDS_PaveBlock)& aPB1=aIt1.ChangeValue(); if (!aPB1->HasShrunkData()) { FillShrunkData(aPB1); - if (myErrorStatus) { - return; + if (myWarningStatus) { + continue; } + //if (myErrorStatus) { + // return; + //} } aPB1->ShrunkData(aTS11, aTS12, aBB1); // @@ -146,9 +149,12 @@ Handle(BOPDS_PaveBlock)& aPB2=aIt2.ChangeValue(); if (!aPB2->HasShrunkData()) { FillShrunkData(aPB2); - if (myErrorStatus) { - return; + if (myWarningStatus) { + continue; } + //if (myErrorStatus) { + // return; + //} } aPB2->ShrunkData(aTS21, aTS22, aBB2); // @@ -203,12 +209,12 @@ // aNbCPrts=aCPrts.Length(); //modified by NIZHNY-EMV Wed Dec 07 14:13:15 2011 - if (aNbCPrts) { - if (myWarningStatus) { - myErrorStatus = 40; - return; - } - } + //if (aNbCPrts) { + // if (myWarningStatus) { + // myErrorStatus = 40; + // continue; + // } + //} //modified by NIZHNY-EMV Wed Dec 07 14:13:16 2011 for (i=1; i<=aNbCPrts; ++i) { const IntTools_CommonPrt& aCPart=aCPrts(i); @@ -297,7 +303,7 @@ // aCPB.SetPaveBlocks(aPB1, aPB2); aCPB.SetIndexInterf(iX); - aMVCPB.Bind(aVnew, aCPB); + aMVCPB.Add(aVnew, aCPB); }//case TopAbs_VERTEX: break; // @@ -339,7 +345,7 @@ // post treatment //========================================= BOPAlgo_Tools::PerformCommonBlocks(aMPBLPB, aAllocator); - PerformVertices(aMVCPB, aAllocator); + PerformVerticesEE(aMVCPB, aAllocator); //-----------------------------------------------------scope t aMPBLPB.Clear(); aMVCPB.Clear(); @@ -349,8 +355,8 @@ //function : PerformVertices //purpose : //======================================================================= - Standard_Integer BOPAlgo_PaveFiller::PerformVertices - (BOPDS_DataMapOfShapeCoupleOfPaveBlocks& theMVCPB, + Standard_Integer BOPAlgo_PaveFiller::PerformVerticesEE + (BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMVCPB, Handle(NCollection_BaseAllocator)& theAllocator) { Standard_Integer aNbV, iRet; @@ -361,22 +367,19 @@ return iRet; } // - Standard_Integer nVx, iV, j, nE, iFlag, iX; + Standard_Integer nVx, iV, j, nE, iFlag, iX, i, aNb; Standard_Real aT; TopoDS_Shape aV; BOPCol_ListIteratorOfListOfShape aItLS; BOPCol_ListIteratorOfListOfInteger aItLI; - BOPCol_DataMapIteratorOfDataMapOfShapeListOfShape aItImag; - BOPDS_DataMapIteratorOfDataMapOfShapeCoupleOfPaveBlocks aItMVCPB; - BOPDS_DataMapIteratorOfDataMapOfPaveBlockListOfInteger aItMPBLI; BOPDS_ListIteratorOfListOfPaveBlock aItLPB; BOPDS_ShapeInfo aSI; BOPDS_Pave aPave; // - BOPDS_DataMapOfPaveBlockListOfInteger aMPBLI(100, theAllocator); + BOPDS_IndexedDataMapOfPaveBlockListOfInteger aMPBLI(100, theAllocator); BOPCol_ListOfShape aLS(theAllocator); - BOPCol_DataMapOfShapeInteger aMVI(100, theAllocator); - BOPCol_DataMapOfShapeListOfShape aImages; + BOPCol_IndexedDataMapOfShapeInteger aMVI(100, theAllocator); + BOPCol_IndexedDataMapOfShapeListOfShape aImages; // aSI.SetShapeType(TopAbs_VERTEX); BOPDS_VectorOfInterfEE& aEEs=myDS->InterfEE(); @@ -384,12 +387,11 @@ // 1 prepare arguments // // <- DEB - aItMVCPB.Initialize(theMVCPB); - for (; aItMVCPB.More(); aItMVCPB.Next()) { - const TopoDS_Shape& aS=aItMVCPB.Key(); - const BOPDS_CoupleOfPaveBlocks& aCPB=aItMVCPB.Value(); + for (i=1; i<=aNbV; ++i) { + const TopoDS_Shape& aS=theMVCPB.FindKey(i); + const BOPDS_CoupleOfPaveBlocks& aCPB=theMVCPB.FindFromIndex(i); iV=aCPB.IndexInterf(); - aMVI.Bind(aS, iV); + aMVI.Add(aS, iV); } // // 2 Fuse vertices @@ -397,10 +399,10 @@ // // 3 Add new vertices to myDS; // connect indices to CPB structure - aItImag.Initialize(aImages); - for (; aItImag.More(); aItImag.Next()) { - const TopoDS_Vertex& aV=(*(TopoDS_Vertex*)(&aItImag.Key())); - const BOPCol_ListOfShape& aLVSD=aItImag.Value(); + aNb = aImages.Extent(); + for (i=1; i<=aNb; ++i) { + const TopoDS_Vertex& aV=(*(TopoDS_Vertex*)(&aImages.FindKey(i))); + const BOPCol_ListOfShape& aLVSD=aImages.FindFromIndex(i); // aSI.SetShape(aV); iV=myDS->Append(aSI); @@ -412,7 +414,7 @@ aItLS.Initialize(aLVSD); for (; aItLS.More(); aItLS.Next()) { const TopoDS_Shape& aVx = aItLS.Value(); - BOPDS_CoupleOfPaveBlocks &aCPB=theMVCPB.ChangeFind(aVx); + BOPDS_CoupleOfPaveBlocks &aCPB=theMVCPB.ChangeFromKey(aVx); aCPB.SetIndex(iV); // update EE interference iX=aCPB.IndexInterf(); @@ -425,20 +427,19 @@ { Handle(BOPDS_PaveBlock) aPB[2]; // - aItMVCPB.Initialize(theMVCPB); - for (; aItMVCPB.More(); aItMVCPB.Next()) { - const BOPDS_CoupleOfPaveBlocks& aCPB=aItMVCPB.Value(); + for (i=1; i<=aNbV; ++i) { + const BOPDS_CoupleOfPaveBlocks& aCPB=theMVCPB.FindFromIndex(i); iV=aCPB.Index(); aCPB.PaveBlocks(aPB[0], aPB[1]); for (j=0; j<2; ++j) { - if (aMPBLI.IsBound(aPB[j])) { - BOPCol_ListOfInteger& aLI=aMPBLI.ChangeFind(aPB[j]); + if (aMPBLI.Contains(aPB[j])) { + BOPCol_ListOfInteger& aLI=aMPBLI.ChangeFromKey(aPB[j]); aLI.Append(iV); } else { BOPCol_ListOfInteger aLI(theAllocator); aLI.Append(iV); - aMPBLI.Bind(aPB[j], aLI); + aMPBLI.Add(aPB[j], aLI); } } } @@ -447,13 +448,13 @@ // 5 // 5.1 Compute Extra Paves and // 5.2. Add Extra Paves to the PaveBlocks - aItMPBLI.Initialize(aMPBLI); - for (; aItMPBLI.More(); aItMPBLI.Next()) { - Handle(BOPDS_PaveBlock) aPB=aItMPBLI.Key(); + aNb=aMPBLI.Extent(); + for(i=1; i<=aNb; ++i) { + Handle(BOPDS_PaveBlock) aPB=aMPBLI.FindKey(i); nE=aPB->OriginalEdge(); const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE))); // 1,2 - const BOPCol_ListOfInteger& aLI=aItMPBLI.Value(); + const BOPCol_ListOfInteger& aLI=aMPBLI.FindFromIndex(i); aItLI.Initialize(aLI); for (; aItLI.More(); aItLI.Next()) { nVx=aItLI.Value(); @@ -468,9 +469,9 @@ } } // 6 Split PaveBlocksa - aItMPBLI.Initialize(aMPBLI); - for (; aItMPBLI.More(); aItMPBLI.Next()) { - Handle(BOPDS_PaveBlock) aPB=aItMPBLI.Key(); + aNb=aMPBLI.Extent(); + for(i=1; i<=aNb; ++i) { + Handle(BOPDS_PaveBlock) aPB=aMPBLI.FindKey(i); nE=aPB->OriginalEdge(); // 3 if (!aPB->IsCommonBlock()) { @@ -490,19 +491,17 @@ //purpose : //======================================================================= void BOPAlgo_PaveFiller::TreatNewVertices( - const BOPCol_DataMapOfShapeInteger& aMapVI, - BOPCol_DataMapOfShapeListOfShape& myImages) + const BOPCol_IndexedDataMapOfShapeInteger& aMapVI, + BOPCol_IndexedDataMapOfShapeListOfShape& myImages) { Standard_Integer j, i, aNbV, aNbVSD; Standard_Real aTol; TopoDS_Shape aVF; TopoDS_Vertex aVnew; - BOPCol_IndexedMapOfShape aMV, aMVProcessed; + BOPCol_IndexedMapOfShape aMVProcessed; BOPCol_ListIteratorOfListOfInteger aIt; - BOPCol_DataMapIteratorOfDataMapOfShapeListOfShape aItIm; - BOPCol_DataMapIteratorOfDataMapOfShapeInteger aItMVI; - BOPCol_DataMapOfShapeListOfShape aMVV; + BOPCol_IndexedDataMapOfShapeListOfShape aMVLV; BOPCol_DataMapOfIntegerShape aMIS; BOPCol_IndexedDataMapOfShapeBox aMSB; // @@ -510,15 +509,9 @@ BOPDS_BoxBndTree aBBTree; NCollection_UBTreeFiller aTreeFiller(aBBTree); // - aItMVI.Initialize(aMapVI); - for (; aItMVI.More(); aItMVI.Next()) { - const TopoDS_Shape& aV=aItMVI.Key(); - aMV.Add(aV); - } - // - aNbV = aMV.Extent(); + aNbV = aMapVI.Extent(); for (i=1; i<=aNbV; ++i) { - const TopoDS_Shape& aV=aMV(i); + const TopoDS_Shape& aV=aMapVI.FindKey(i); Bnd_Box aBox; // aTol=BRep_Tool::Tolerance(*(TopoDS_Vertex*)(&aV)); @@ -535,7 +528,7 @@ // Chains for (i=1; i<=aNbV; ++i) { - const TopoDS_Shape& aV=aMV(i); + const TopoDS_Shape& aV=aMapVI.FindKey(i); // if (aMVProcessed.Contains(aV)) { continue; @@ -613,37 +606,22 @@ aLVSD.Append(aVP); aMVProcessed.Add(aVP); } - myImages.Bind(aVF, aLVSD); + aMVLV.Add(aVF, aLVSD); }// for (i=1; i<=aNbV; ++i) { // Make new vertices - aMV.Clear(); - aItIm.Initialize(myImages); - for (; aItIm.More(); aItIm.Next()) { - const TopoDS_Shape& aV=aItIm.Key(); - BOPCol_ListOfShape& aLVSD=aItIm.ChangeValue(); + aNbV=aMVLV.Extent(); + for (i=1; i<=aNbV; ++i) { + const TopoDS_Shape& aV=aMVLV.FindKey(i); + BOPCol_ListOfShape& aLVSD=aMVLV.ChangeFromIndex(i); aNbVSD=aLVSD.Extent(); if (aNbVSD>1) { - aMV.Add(aV); BOPTools_AlgoTools::MakeVertex(aLVSD, aVnew); - aMVV.Bind(aVnew, aLVSD); + myImages.Add(aVnew, aLVSD); + } else { + myImages.Add(aV, aLVSD); } } - // - // UnBind old vertices - aNbV=aMV.Extent(); - for (i=1; i<=aNbV; ++i) { - const TopoDS_Shape& aV=aMV(i); - myImages.UnBind(aV); - } - // - // Bind new vertices - aItIm.Initialize(aMVV); - for (; aItIm.More(); aItIm.Next()) { - const TopoDS_Shape& aV=aItIm.Key(); - const BOPCol_ListOfShape& aLVSD=aItIm.Value(); - myImages.Bind(aV, aLVSD); - } } //======================================================================= @@ -677,11 +655,7 @@ aSR.Perform(); iErr=aSR.ErrorStatus(); if (iErr) { - //modified by NIZHNY-EMV Wed Dec 07 14:12:10 2011 - if (iErr==6) { - myWarningStatus = 1; - } - //modified by NIZHNY-EMV Wed Dec 07 14:12:12 2011 + myWarningStatus = 1; //myErrorStatus=40; return; } diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx index ca4791a40e..1756e57a63 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx @@ -91,8 +91,8 @@ aAllocator=new NCollection_IncAllocator(); BOPCol_MapOfInteger aMIEFC(100, aAllocator); - BOPDS_DataMapOfShapeCoupleOfPaveBlocks aMVCPB(100, aAllocator); - BOPDS_DataMapOfPaveBlockListOfInteger aMPBLI(100, aAllocator); + BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks aMVCPB(100, aAllocator); + BOPDS_IndexedDataMapOfPaveBlockListOfInteger aMPBLI(100, aAllocator); // aDiscretize=35; aDeflection=0.01; @@ -118,7 +118,7 @@ const Bnd_Box& aBBF=myDS->ShapeInfo(nF).Box(); // BOPDS_FaceInfo& aFI=myDS->ChangeFaceInfo(nF); - const BOPDS_MapOfPaveBlock& aMPBF=aFI.PaveBlocksOn(); + const BOPDS_IndexedMapOfPaveBlock& aMPBF=aFI.PaveBlocksOn(); const BOPCol_MapOfInteger& aMIFOn=aFI.VerticesOn(); const BOPCol_MapOfInteger& aMIFIn=aFI.VerticesIn(); // @@ -173,14 +173,6 @@ // const IntTools_SequenceOfCommonPrts& aCPrts=aEdgeFace.CommonParts(); aNbCPrts=aCPrts.Length(); - //modified by NIZHNY-EMV Wed Dec 07 14:17:07 2011 - /*if (aNbCPrts) { - if (myWarningStatus) { - myErrorStatus = 40; - return; - } - }*/ - //modified by NIZHNY-EMV Wed Dec 07 14:17:09 2011 for (i=1; i<=aNbCPrts; ++i) { const IntTools_CommonPrt& aCPart=aCPrts(i); aType=aCPart.Type(); @@ -275,7 +267,7 @@ // aCPB.SetPaveBlocks(aPB, aPB); aCPB.SetIndexInterf(iX); - aMVCPB.Bind(aVnew, aCPB); + aMVCPB.Add(aVnew, aCPB); } } break; @@ -314,7 +306,7 @@ // post treatment //========================================= BOPAlgo_Tools::PerformCommonBlocks(aMPBLI, aAllocator); - PerformVertices1(aMVCPB, aAllocator); + PerformVerticesEF(aMVCPB, aAllocator); // // Update FaceInfoIn for all faces having EF common parts BOPCol_MapIteratorOfMapOfInteger aItMI; @@ -338,8 +330,8 @@ //function : PerformVertices1 //purpose : //======================================================================= - Standard_Integer BOPAlgo_PaveFiller::PerformVertices1 - (BOPDS_DataMapOfShapeCoupleOfPaveBlocks& theMVCPB, + Standard_Integer BOPAlgo_PaveFiller::PerformVerticesEF + (BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMVCPB, Handle(NCollection_BaseAllocator)& theAllocator) { Standard_Integer aNbV, iRet; @@ -350,29 +342,26 @@ return iRet; } // - Standard_Integer nVx, nVSD, iV, iErr, nE, iFlag, iX; + Standard_Integer nVx, nVSD, iV, iErr, nE, iFlag, iX, i, aNbPBLI; Standard_Real aT; TopoDS_Shape aV; BOPCol_ListIteratorOfListOfShape aItLS; BOPCol_ListIteratorOfListOfInteger aItLI; - BOPDS_DataMapIteratorOfDataMapOfShapeCoupleOfPaveBlocks aItMVCPB; - BOPDS_DataMapIteratorOfDataMapOfPaveBlockListOfInteger aItMPBLI; BOPDS_PDS aPDS; BOPDS_ShapeInfo aSI; BOPDS_Pave aPave; // BOPCol_ListOfShape aLS(theAllocator); BOPCol_DataMapOfShapeInteger aMVI(100, theAllocator); - BOPDS_DataMapOfPaveBlockListOfInteger aMPBLI(100, theAllocator); + BOPDS_IndexedDataMapOfPaveBlockListOfInteger aMPBLI(100, theAllocator); BOPAlgo_PaveFiller aPF(theAllocator); // aSI.SetShapeType(TopAbs_VERTEX); BOPDS_VectorOfInterfEF& aEFs=myDS->InterfEF(); // // 1 prepare arguments - aItMVCPB.Initialize(theMVCPB); - for (; aItMVCPB.More(); aItMVCPB.Next()) { - const TopoDS_Shape& aS=aItMVCPB.Key(); + for (i=1; i<=aNbV; ++i) { + const TopoDS_Shape& aS=theMVCPB.FindKey(i); aLS.Append(aS); } // @@ -414,7 +403,7 @@ iV=aMVI.Find(aV); } // - BOPDS_CoupleOfPaveBlocks &aCPB=theMVCPB.ChangeFind(aVx); + BOPDS_CoupleOfPaveBlocks &aCPB=theMVCPB.ChangeFromKey(aVx); aCPB.SetIndex(iV); // update EF interference iX=aCPB.IndexInterf(); @@ -422,27 +411,27 @@ aEF.SetIndexNew(iV); // map aMPBLI const Handle(BOPDS_PaveBlock)& aPB=aCPB.PaveBlock1(); - if (aMPBLI.IsBound(aPB)) { - BOPCol_ListOfInteger& aLI=aMPBLI.ChangeFind(aPB); + if (aMPBLI.Contains(aPB)) { + BOPCol_ListOfInteger& aLI=aMPBLI.ChangeFromKey(aPB); aLI.Append(iV); } else { BOPCol_ListOfInteger aLI(theAllocator); aLI.Append(iV); - aMPBLI.Bind(aPB, aLI); + aMPBLI.Add(aPB, aLI); } } // // 5 // 5.1 Compute Extra Paves and // 5.2. Add Extra Paves to the PaveBlocks - aItMPBLI.Initialize(aMPBLI); - for (; aItMPBLI.More(); aItMPBLI.Next()) { - Handle(BOPDS_PaveBlock) aPB=aItMPBLI.Key(); + aNbPBLI=aMPBLI.Extent(); + for (i=1; i<=aNbPBLI; ++i) { + Handle(BOPDS_PaveBlock) aPB=aMPBLI.FindKey(i); + const BOPCol_ListOfInteger& aLI=aMPBLI.FindFromIndex(i); nE=aPB->OriginalEdge(); const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE))); // - const BOPCol_ListOfInteger& aLI=aItMPBLI.Value(); aItLI.Initialize(aLI); for (; aItLI.More(); aItLI.Next()) { nVx=aItLI.Value(); @@ -457,9 +446,8 @@ } } // 6 Split PaveBlocksa - aItMPBLI.Initialize(aMPBLI); - for (; aItMPBLI.More(); aItMPBLI.Next()) { - Handle(BOPDS_PaveBlock) aPB=aItMPBLI.Key(); + for (i=1; i<=aNbPBLI; ++i) { + Handle(BOPDS_PaveBlock) aPB=aMPBLI.FindKey(i); nE=aPB->OriginalEdge(); // 3 if (!aPB->IsCommonBlock()) { diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx index 7b9567ddc4..bf9abce85d 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx @@ -65,6 +65,7 @@ #include #include #include +#include #include #include @@ -99,6 +100,9 @@ static void FindPaveBlocksByFirst(BOPDS_ListOfPaveBlock& aLPBC, static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE, const Handle(BOPInt_Context)& aCtx); +static Standard_Boolean IsAnalytic(const TopoDS_Face& aF1, + const TopoDS_Face& aF2); + //======================================================================= //function : PerformFF //purpose : @@ -160,8 +164,12 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE, if (bIsDone) { aTolR3D=aFaceFace.TolReached3d(); aTolR2D=aFaceFace.TolReached2d(); - if (aTolR3D < 1.e-7){ - aTolR3D=1.e-7; + if (aTolR3D < 5.e-6){ + if (!IsAnalytic(aF1, aF2)) { + aTolR3D=5.e-6; + } else if (aTolR3D < 1.e-7) { + aTolR3D=1.e-7; + } } if (aTolR2D < 1.e-7){ aTolR2D=1.e-7; @@ -244,12 +252,13 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE, } // Standard_Boolean bExist, bValid2D; - Standard_Integer i, nF1, nF2, aNbC, aNbP, j, aSC; + Standard_Integer i, nF1, nF2, aNbC, aNbP, j; Standard_Integer nV1, nV2, iFlag; Standard_Real aTolR3D, aTolR2D, aT1, aT2; Handle(NCollection_IncAllocator) aAllocator; BOPDS_ListIteratorOfListOfPaveBlock aItLPB; TopoDS_Edge aES; + Handle(BOPDS_PaveBlock) aPBOut; // //-----------------------------------------------------scope f aAllocator=new NCollection_IncAllocator(); @@ -260,10 +269,9 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE, BOPDS_MapOfPaveBlock aMPBOnIn(100, aAllocator), aMPBAdd(100, aAllocator); BOPDS_ListOfPaveBlock aLPB(aAllocator); - BOPDS_DataMapOfShapeCoupleOfPaveBlocks aMSCPB(100, aAllocator); + BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks aMSCPB(100, aAllocator); BOPCol_DataMapOfShapeInteger aMVI(100, aAllocator); //modified by NIZHNY-EMV Tue Sep 27 08:26:45 2011 - BOPCol_MapOfInteger aMVB; BOPCol_DataMapOfIntegerListOfInteger aMInterfs; BOPCol_ListOfInteger aLIEF; iFlag = 1 + 2 + 4 + 8 + 16; // 2^0 + 2^1 + 2^2 + 2^3 + 2^4 @@ -300,7 +308,6 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE, // aMVOnIn.Clear(); aMPBOnIn.Clear(); - aMVB.Clear(); // myDS->VerticesOnIn(nF1, nF2, aMVOnIn, aMPBOnIn); myDS->SharedEdges(nF1, nF2, aLSE, aAllocator); @@ -319,17 +326,14 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE, // aCPB.SetIndexInterf(i); aCPB.SetIndex(j); - aMSCPB.Bind(aV, aCPB); + aMSCPB.Add(aV, aCPB); } } - - //modified by NIZHNY-EMV Tue Sep 27 08:26:16 2011 + // // 2. Treat Curves aMVStick.Clear(); aMInterfs.Clear(); GetInterfs(nF1, nF2, aMVStick, aMInterfs, iFlag); - //modified by NIZHNY-EMV Tue Sep 27 08:26:18 2011 - //modified by NIZHNY-EMV Fri Sep 23 11:54:59 2011 for (j=0; jIndices(nV1, nV2); aPB->Range (aT1, aT2); - //modified by NIZHNY-EMV Mon Apr 09 11:36:30 2012 - if (fabs(aT1 - aT2) < Precision::PConfusion()) { - continue; - } - //modified by NIZHNY-EMV Mon Apr 09 11:36:31 2012 - bExist=IsExistingPaveBlock(aPB, aNC, aTolR3D, aMPBOnIn); - if (bExist) { - aSC++; - continue; - } // - bExist=IsExistingPaveBlock(aPB, aNC, aTolR3D, aLSE); - if (bExist) { - aSC++; + if (fabs(aT1 - aT2) < Precision::PConfusion()) { continue; } // @@ -403,6 +388,32 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE, continue; } // + bExist=IsExistingPaveBlock(aPB, aNC, aTolR3D, aLSE); + if (bExist) { + continue; + } + // + bExist=IsExistingPaveBlock(aPB, aNC, aTolR3D, aMPBOnIn, aPBOut); + if (bExist) { + if (aMPBAdd.Add(aPBOut)) { + if (!aPBOut->IsCommonBlock()) { + TopoDS_Edge& aE = *(TopoDS_Edge*)&myDS->Shape(aPBOut->Edge()); + if (aTolR3D > BRep_Tool::Tolerance(aE)) { + BRep_Builder BB; + // + TopoDS_Vertex& aV1 = *(TopoDS_Vertex*)&myDS->Shape(aPBOut->Pave1().Index()); + TopoDS_Vertex& aV2 = *(TopoDS_Vertex*)&myDS->Shape(aPBOut->Pave2().Index()); + // + BB.UpdateVertex(aV1, aTolR3D); + BB.UpdateVertex(aV2, aTolR3D); + BB.UpdateEdge(aE, aTolR3D); + } + PreparePostTreatFF(i, aPBOut, aMSCPB, aMVI, aVC); + } + } + continue; + } + // // Make Edge const TopoDS_Vertex& aV1=(*(TopoDS_Vertex *)(&myDS->Shape(nV1))); const TopoDS_Vertex& aV2=(*(TopoDS_Vertex *)(&myDS->Shape(nV2))); @@ -425,19 +436,14 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE, aCPB.SetIndex(j); aCPB.SetPaveBlock1(aPB); // - aMSCPB.Bind(aES, aCPB); + aMSCPB.Add(aES, aCPB); aMVI.Bind(aV1, nV1); aMVI.Bind(aV2, nV2); - aSC++; } // aLPBC.RemoveFirst(); }//for (j=0; jAppend(aSI); // - aType=aS.ShapeType(); - if (aType==TopAbs_VERTEX) { + iX=aCPB.IndexInterf(); + iP=aCPB.Index(); + BOPDS_InterfFF& aFF=aFFs(iX); + BOPDS_VectorOfPoint& aVNP=aFF.ChangePoints(); + BOPDS_Point& aNP=aVNP(iP); + aNP.SetIndex(iV); + } + else if (aType==TopAbs_EDGE) { + //modified by NIZHNY-EMV Thu Dec 15 08:32:11 2011 + aPB1=aCPB.PaveBlock1(); + // + if (aPB1->HasEdge()) { + BOPDS_InterfFF& aFF=aFFs(aCPB.IndexInterf()); + BOPDS_VectorOfCurve& aVNC=aFF.ChangeCurves(); + BOPDS_Curve& aNC=aVNC(aCPB.Index()); + BOPDS_ListOfPaveBlock& aLPBC=aNC.ChangePaveBlocks(); + aLPBC.Clear(); + } else { aSI.SetShapeType(aType); aSI.SetShape(aS); - iV=myDS->Append(aSI); + iE=myDS->Append(aSI); // - iX=aCPB.IndexInterf(); - iP=aCPB.Index(); - BOPDS_InterfFF& aFF=aFFs(iX); - BOPDS_VectorOfPoint& aVNP=aFF.ChangePoints(); - BOPDS_Point& aNP=aVNP(iP); - aNP.SetIndex(iV); + aPB1->SetEdge(iE); } - else if (aType==TopAbs_EDGE) { - //modified by NIZHNY-EMV Thu Dec 15 08:32:11 2011 - aPB1=aCPB.PaveBlock1(); - // - if (aPB1->HasEdge()) { - BOPDS_InterfFF& aFF=aFFs(aCPB.IndexInterf()); - BOPDS_VectorOfCurve& aVNC=aFF.ChangeCurves(); - BOPDS_Curve& aNC=aVNC(aCPB.Index()); - BOPDS_ListOfPaveBlock& aLPBC=aNC.ChangePaveBlocks(); - aLPBC.Clear(); - } else { - aSI.SetShapeType(aType); - aSI.SetShape(aS); - iE=myDS->Append(aSI); - // - aPB1->SetEdge(iE); - } - //modified by NIZHNY-EMV Thu Dec 15 08:32:13 2011 - } - return iRet; + //modified by NIZHNY-EMV Thu Dec 15 08:32:13 2011 } + return iRet; } // // 1 prepare arguments - aIt.Initialize(theMSCPB); - for (; aIt.More(); aIt.Next()) { - const TopoDS_Shape& aS=aIt.Key(); + for (k=1; k<=aNbS; ++k) { + const TopoDS_Shape& aS=theMSCPB.FindKey(k); aLS.Append(aS); } // @@ -616,7 +613,7 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE, iV=aMVI.Find(aV); } // update FF interference - const BOPDS_CoupleOfPaveBlocks &aCPB=theMSCPB.Find(aSx); + const BOPDS_CoupleOfPaveBlocks &aCPB=theMSCPB.FindFromKey(aSx); iX=aCPB.IndexInterf(); iP=aCPB.Index(); BOPDS_InterfFF& aFF=aFFs(iX); @@ -628,7 +625,7 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE, else if (aType==TopAbs_EDGE) { bHasPaveBlocks=aPDS->HasPaveBlocks(nSx); if (!bHasPaveBlocks) { - const BOPDS_CoupleOfPaveBlocks &aCPB=theMSCPB.Find(aSx); + const BOPDS_CoupleOfPaveBlocks &aCPB=theMSCPB.FindFromKey(aSx); aPB1=aCPB.PaveBlock1(); // if (aPB1->HasEdge()) { @@ -653,7 +650,7 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE, } } else { - const BOPDS_CoupleOfPaveBlocks &aCPB=theMSCPB.Find(aSx); + const BOPDS_CoupleOfPaveBlocks &aCPB=theMSCPB.FindFromKey(aSx); iX=aCPB.IndexInterf(); iC=aCPB.Index(); aPB1=aCPB.PaveBlock1(); @@ -883,7 +880,8 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE, (const Handle(BOPDS_PaveBlock)& thePB, const BOPDS_Curve& theNC, const Standard_Real theTolR3D, - const BOPDS_MapOfPaveBlock& theMPBOnIn) + const BOPDS_MapOfPaveBlock& theMPBOnIn, + Handle(BOPDS_PaveBlock&) aPBOut) { Standard_Boolean bRet; Standard_Real aT1, aT2, aTm, aTx; @@ -928,6 +926,7 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE, if (!iFlag) { iFlag=myContext->ComputePE(aPm, theTolR3D, aSp, aTx); if (!iFlag) { + aPBOut = aPB; return bRet; } } @@ -946,8 +945,7 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE, const TopoDS_Face& aF2, const Standard_Real aTolR3D, BOPDS_Curve& aNC, - BOPCol_MapOfInteger& aMVOnIn, - BOPCol_MapOfInteger& aMVB) + BOPCol_MapOfInteger& aMVOnIn) { Standard_Boolean bVF; Standard_Integer nV, iFlag, nVn, j, aNbEP; @@ -1041,7 +1039,6 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE, BRepBndLib::Add(aVn, aBoxDS); //modified by NIZHNY-EMV Wed Mar 16 13:46:01 2011 aMVOnIn.Add(nVn); - aMVB.Add(nVn); //modified by NIZHNY-EMV Tue Apr 12 10:01:51 2011 } } @@ -1055,8 +1052,7 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE, const Standard_Real aTolR3D, BOPDS_Curve& aNC, const Standard_Integer nF1, - const Standard_Integer nF2, - BOPCol_MapOfInteger& aMVB) + const Standard_Integer nF2) { Standard_Boolean bIsVertexOnLine, bInBothFaces; Standard_Integer nV; @@ -1118,8 +1114,6 @@ static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE, BOPDS_ShapeInfo& aSIDS=myDS->ChangeShapeInfo(nV); Bnd_Box& aBoxDS=aSIDS.ChangeBox(); BRepBndLib::Add(aV, aBoxDS); - // - aMVB.Add(nV); } //modified by NIZHNY-EMV Fri Sep 23 13:35:49 2011 } @@ -1629,23 +1623,29 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC, void BOPAlgo_PaveFiller::ProcessExistingPaveBlocks (const Standard_Integer theInt, const BOPDS_MapOfPaveBlock& aMPBOnIn, - const BOPCol_MapOfInteger& aMV, - BOPDS_MapOfPaveBlock& aMPB, - BOPDS_DataMapOfShapeCoupleOfPaveBlocks& aMSCPB, - BOPCol_DataMapOfShapeInteger& aMVI) + BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& aMSCPB, + BOPCol_DataMapOfShapeInteger& aMVI, + BOPDS_MapOfPaveBlock& aMPB) { - Standard_Integer nV, nV1, nV2, nE, iFlag, iC; + Standard_Integer nV, nE, iFlag, aNbV, i; Standard_Real aT; - BOPCol_MapIteratorOfMapOfInteger aIt; + BOPCol_IndexedMapOfInteger aMV; + BOPCol_DataMapIteratorOfDataMapOfShapeInteger aItB; BOPDS_MapIteratorOfMapOfPaveBlock aItPB; // BOPDS_VectorOfInterfFF& aFFs=myDS->InterfFF(); BOPDS_InterfFF& aFF = aFFs(theInt); BOPDS_VectorOfCurve& aVC=aFF.ChangeCurves(); // - aIt.Initialize(aMV); - for (; aIt.More(); aIt.Next()) { - nV = aIt.Value(); + //get bounds + aItB.Initialize(aMVI); + for (; aItB.More(); aItB.Next()) { + aMV.Add(aItB.Value()); + } + // + aNbV = aMV.Extent(); + for (i=1; i<=aNbV; ++i) { + nV = aMV(i); const BOPDS_ShapeInfo& aSIV=myDS->ShapeInfo(nV); const Bnd_Box& aBoxV=aSIV.Box(); const TopoDS_Vertex& aV = *(TopoDS_Vertex*)&aSIV.Shape(); @@ -1669,25 +1669,9 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC, // iFlag=myContext->ComputeVE (aV, aE, aT); if (!iFlag) { - iC=aVC.Append()-1; - BOPDS_Curve& aNC=aVC(iC); - BOPDS_ListOfPaveBlock& aLPBC = aNC.ChangePaveBlocks(); - // aMPB.Add(aPB); - aLPBC.Append(aPB); // - aPB->Indices(nV1, nV2); - const TopoDS_Vertex& aV1=(*(TopoDS_Vertex *)(&myDS->Shape(nV1))); - const TopoDS_Vertex& aV2=(*(TopoDS_Vertex *)(&myDS->Shape(nV2))); - // Keep info for post treatment - BOPDS_CoupleOfPaveBlocks aCPB; - aCPB.SetIndexInterf(theInt); - aCPB.SetIndex(iC); - aCPB.SetPaveBlock1(aPB); - // - aMSCPB.Bind(aE, aCPB); - aMVI.Bind(aV1, nV1); - aMVI.Bind(aV2, nV2); + PreparePostTreatFF(theInt, aPB, aMSCPB, aMVI, aVC); } } } @@ -1707,8 +1691,8 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC, return; } // - BOPDS_MapOfPaveBlock aMPB; - BOPDS_MapIteratorOfMapOfPaveBlock aItMPB; + BOPDS_IndexedMapOfPaveBlock aMPB; + Standard_Integer nE; Handle(BOPDS_PaveBlock) aPBf; aPBf = aLPBC.First(); @@ -1727,6 +1711,31 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC, return; } // + //remove micro edges from aLPB + aIt.Initialize(aLPB); + for (aIt.Next(); aIt.More();) { + aPB = aIt.Value(); + const TopoDS_Edge& aE = *(TopoDS_Edge*)&myDS->Shape(aPB->Edge()); + if (IsMicroEdge(aE, myContext)) { + aLPB.Remove(aIt); + continue; + } + aIt.Next(); + } + //update face info + myDS->UpdateFaceInfoOn(nF1); + // + myDS->UpdateFaceInfoOn(nF2); + // + BOPDS_FaceInfo& aFI1 = myDS->ChangeFaceInfo(nF1); + BOPDS_FaceInfo& aFI2 = myDS->ChangeFaceInfo(nF2); + // + BOPDS_IndexedMapOfPaveBlock& aMPBOn1 = aFI1.ChangePaveBlocksOn(); + BOPDS_IndexedMapOfPaveBlock& aMPBIn1 = aFI1.ChangePaveBlocksIn(); + BOPDS_IndexedMapOfPaveBlock& aMPBOn2 = aFI2.ChangePaveBlocksOn(); + BOPDS_IndexedMapOfPaveBlock& aMPBIn2 = aFI2.ChangePaveBlocksIn(); + // + // aPBf = aLPB.First(); if (aPBf->IsCommonBlock()) { const Handle(BOPDS_CommonBlock)& aCB1 = aPBf->CommonBlock(); @@ -1790,7 +1799,14 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC, for (aIt.Next(); aIt.More(); aIt.Next()) { aPB = aIt.Value(); // - if (IsCommonBlockOnFaces(aPB, nF1, nF2)) { + Standard_Integer nF = (aMPBOn1.Contains(aPBf) || + aMPBIn1.Contains(aPBf)) ? nF2 : nF1; + const TopoDS_Face& aF = *(TopoDS_Face*)&myDS->Shape(nF); + IntTools_Range aShrR(aPB->Pave1().Parameter(), aPB->Pave2().Parameter()); + const TopoDS_Edge& aE = *(TopoDS_Edge*)&myDS->Shape(aPB->Edge()); + // + Standard_Boolean bCom = BOPTools_AlgoTools::IsBlockInOnFace(aShrR, aF, aE, myContext); + if (bCom) { aCB = new BOPDS_CommonBlock; aCB->AddPaveBlock(aPB); aCB->AddFace(nF1); @@ -1802,22 +1818,11 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC, aLPB1.Append(aPB); } } - //update face info - myDS->UpdateFaceInfoOn(nF1); // - myDS->UpdateFaceInfoOn(nF2); - // - BOPDS_FaceInfo& aFI1 = myDS->ChangeFaceInfo(nF1); - BOPDS_FaceInfo& aFI2 = myDS->ChangeFaceInfo(nF2); - // - BOPDS_MapOfPaveBlock& aMPBOn1 = aFI1.ChangePaveBlocksOn(); - BOPDS_MapOfPaveBlock& aMPBIn1 = aFI1.ChangePaveBlocksIn(); - BOPDS_MapOfPaveBlock& aMPBOn2 = aFI2.ChangePaveBlocksOn(); - BOPDS_MapOfPaveBlock& aMPBIn2 = aFI2.ChangePaveBlocksIn(); - // - aItMPB.Initialize(aMPB); - for(; aItMPB.More(); aItMPB.Next()) { - const Handle(BOPDS_PaveBlock)& aPBnew = aItMPB.Value(); + Standard_Integer i, aNbPB; + aNbPB=aMPB.Extent(); + for (i=1; i<=aNbPB; ++i) { + const Handle(BOPDS_PaveBlock)& aPBnew = aMPB(i); if (!aMPBOn1.Contains(aPBnew)) { aMPBIn1.Add(aPBnew); } @@ -1887,50 +1892,38 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC, //modified by NIZHNY-EMV Wed Feb 15 10:08:34 2012 //======================================================================= -// function: IsCommonOnFaces -// purpose: +//function : PreparePostTreatFF +//purpose : //======================================================================= - Standard_Boolean BOPAlgo_PaveFiller::IsCommonBlockOnFaces(const Handle(BOPDS_PaveBlock)& aPB, - const Standard_Integer nF1, - const Standard_Integer nF2) + void BOPAlgo_PaveFiller::PreparePostTreatFF + (const Standard_Integer aInt, + const Handle(BOPDS_PaveBlock)& aPB, + BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& aMSCPB, + BOPCol_DataMapOfShapeInteger& aMVI, + BOPDS_VectorOfCurve& aVC) { - Standard_Boolean bRet; - Standard_Integer i, j, nV1, nV2; - Standard_Real aT1, aT2, aTm, f, l; - gp_Pnt aP1, aP2, aPm; - BRep_Builder aBB; + Standard_Integer nV1, nV2; + // + Standard_Integer iC=aVC.Append()-1; + BOPDS_ListOfPaveBlock& aLPBC = aVC(iC).ChangePaveBlocks(); + aLPBC.Append(aPB); // - bRet = Standard_True; aPB->Indices(nV1, nV2); - // + const TopoDS_Vertex& aV1=(*(TopoDS_Vertex *)(&myDS->Shape(nV1))); + const TopoDS_Vertex& aV2=(*(TopoDS_Vertex *)(&myDS->Shape(nV2))); const TopoDS_Edge& aE = *(TopoDS_Edge*)&myDS->Shape(aPB->Edge()); - Handle(Geom_Curve) aC3D = BRep_Tool::Curve(aE, aT1, aT2); - aTm=IntTools_Tools::IntermediatePoint (aT1, aT2); + // Keep info for post treatment + BOPDS_CoupleOfPaveBlocks aCPB; + aCPB.SetIndexInterf(aInt); + aCPB.SetIndex(iC); + aCPB.SetPaveBlock1(aPB); // - const TopoDS_Vertex& aV1 = *(TopoDS_Vertex*)&myDS->Shape(nV1); - const TopoDS_Vertex& aV2 = *(TopoDS_Vertex*)&myDS->Shape(nV2); - aC3D->D0(aTm, aPm); - // - TopoDS_Vertex aVm = BRepBuilderAPI_MakeVertex(aPm); - aBB.UpdateVertex(aVm, BRep_Tool::Tolerance(aE)); - // - TopoDS_Vertex aV[3] = {aV1, aVm, aV2}; - // - const TopoDS_Face& aF1=(*(TopoDS_Face *)(&myDS->Shape(nF1))); - const TopoDS_Face& aF2=(*(TopoDS_Face *)(&myDS->Shape(nF2))); - // - for (i = 0; i < 2; ++i) { - const TopoDS_Face& aF = (i == 0) ? aF1 : aF2; - for (j = 0; j < 3; ++j) { - if (bRet) { - bRet = !myContext->ComputeVF(aV[i], aF, f, l) ? bRet : !bRet; - } - } - } - // - return bRet; + aMSCPB.Add(aE, aCPB); + aMVI.Bind(aV1, nV1); + aMVI.Bind(aV2, nV2); } + //======================================================================= //function : FindPaveBlocksByFirst //purpose : @@ -1997,6 +1990,31 @@ Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE, return bRet; } +//======================================================================= +//function : IsAnalytic +//purpose : Checks if the faces have analytical surfaces +//======================================================================= + Standard_Boolean IsAnalytic(const TopoDS_Face& aF1, + const TopoDS_Face& aF2) +{ + BRepAdaptor_Surface BAS1(aF1); + BRepAdaptor_Surface BAS2(aF2); + // + Standard_Boolean isAna1 = (BAS1.GetType() == GeomAbs_Plane || + BAS1.GetType() == GeomAbs_Cylinder || + BAS1.GetType() == GeomAbs_Cone || + BAS1.GetType() == GeomAbs_Sphere || + BAS1.GetType() == GeomAbs_Torus); + Standard_Boolean isAna2 = (BAS2.GetType() == GeomAbs_Plane || + BAS2.GetType() == GeomAbs_Cylinder || + BAS2.GetType() == GeomAbs_Cone || + BAS2.GetType() == GeomAbs_Sphere || + BAS2.GetType() == GeomAbs_Torus); + + return (isAna1 && isAna2); +} + + // DEB f /* { diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_7.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_7.cxx index a4af0760a3..8f38753f05 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_7.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_7.cxx @@ -113,9 +113,7 @@ const Handle(BOPDS_CommonBlock)& aCB=aPB->CommonBlock(); bCB=!aCB.IsNull(); if (bCB) { - //modified by NIZHNY-EMV Tue Nov 22 10:27:54 2011 myDS->SortPaveBlocks(aCB); - //modified by NIZHNY-EMV Tue Nov 22 10:27:56 2011 aPB=aCB->PaveBlock1(); } // @@ -185,7 +183,7 @@ aF1F=(*(TopoDS_Face *)(&myDS->Shape(nF1))); aF1F.Orientation(TopAbs_FORWARD); // In - const BOPDS_MapOfPaveBlock& aMPBIn=aFI.PaveBlocksIn(); + const BOPDS_IndexedMapOfPaveBlock& aMPBIn=aFI.PaveBlocksIn(); aItMPB.Initialize(aMPBIn); for(; aItMPB.More(); aItMPB.Next()) { const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value(); @@ -195,7 +193,7 @@ BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace(aE, aF1F); } // On - const BOPDS_MapOfPaveBlock& aMPBOn=aFI.PaveBlocksOn(); + const BOPDS_IndexedMapOfPaveBlock& aMPBOn=aFI.PaveBlocksOn(); aItMPB.Initialize(aMPBOn); for(; aItMPB.More(); aItMPB.Next()) { const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value(); @@ -245,3 +243,45 @@ } } } + +//======================================================================= +// function: RefineFaceInfoOn +// purpose: +//======================================================================= + void BOPAlgo_PaveFiller::RefineFaceInfoOn() +{ + Standard_Integer aNbPBP; + // + myErrorStatus=0; + // + BOPDS_VectorOfListOfPaveBlock& aPBP=myDS->ChangePaveBlocksPool(); + aNbPBP=aPBP.Extent(); + if(!aNbPBP) { + return; + } + // + Standard_Boolean bV1, bV2; + Standard_Integer i, nV1, nV2, aNbPB; + Handle(BOPDS_PaveBlock) aPB; + // + for (i=0; iIndices(nV1, nV2); + bV1=myDS->IsNewShape(nV1); + bV2=myDS->IsNewShape(nV2); + // + if (!(bV1 || bV2)) { + if (!aPB->IsCommonBlock()) { + // the PB seems to be untouced + aLPB.Clear(); + continue; + } + }//if (!(bV1 || bV2)) { + }//if (aNbPB==1) { + }//for (i=0; iRefineFaceInfoOn(); +} diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_8.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_8.cxx index 20ed082725..8b9aa6dd0a 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_8.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_8.cxx @@ -156,7 +156,7 @@ static // const BOPDS_FaceInfo& aFI=myDS->ChangeFaceInfo(nF); // In - const BOPDS_MapOfPaveBlock& aMPBIn=aFI.PaveBlocksIn(); + const BOPDS_IndexedMapOfPaveBlock& aMPBIn=aFI.PaveBlocksIn(); aItMPB.Initialize(aMPBIn); for(; aItMPB.More(); aItMPB.Next()) { const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value(); @@ -166,7 +166,7 @@ static } } // On - const BOPDS_MapOfPaveBlock& aMPBOn=aFI.PaveBlocksOn(); + const BOPDS_IndexedMapOfPaveBlock& aMPBOn=aFI.PaveBlocksOn(); aItMPB.Initialize(aMPBOn); for(; aItMPB.More(); aItMPB.Next()) { const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value(); @@ -176,7 +176,7 @@ static } } // Sections - const BOPDS_MapOfPaveBlock& aMPBSc=aFI.PaveBlocksSc(); + const BOPDS_IndexedMapOfPaveBlock& aMPBSc=aFI.PaveBlocksSc(); aItMPB.Initialize(aMPBSc); for(; aItMPB.More(); aItMPB.Next()) { const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value(); diff --git a/src/BOPAlgo/BOPAlgo_Tools.cdl b/src/BOPAlgo/BOPAlgo_Tools.cdl index 526cfe9c5d..5330c507ec 100644 --- a/src/BOPAlgo/BOPAlgo_Tools.cdl +++ b/src/BOPAlgo/BOPAlgo_Tools.cdl @@ -19,14 +19,16 @@ class Tools from BOPAlgo - ---Purpose: +---Purpose: uses BaseAllocator from BOPCol, + IndexedDataMapOfIntegerListOfInteger from BOPCol, DataMapOfIntegerListOfInteger from BOPCol, PaveBlock from BOPDS, - DataMapOfPaveBlockListOfPaveBlock from BOPDS, - DataMapOfPaveBlockListOfInteger from BOPDS + IndexedDataMapOfPaveBlockListOfInteger from BOPDS, + IndexedDataMapOfPaveBlockListOfPaveBlock from BOPDS, + DataMapOfIntegerListOfPaveBlock from BOPDS --raises is @@ -34,41 +36,41 @@ is --- static methods --- MakeBlocksCnx(myclass; - theMILI :DataMapOfIntegerListOfInteger from BOPCol; - theMBlocks :out DataMapOfIntegerListOfInteger from BOPCol; - theAllocator:out BaseAllocator from BOPCol); + theMILI :IndexedDataMapOfIntegerListOfInteger from BOPCol; + theMBlocks :out DataMapOfIntegerListOfInteger from BOPCol; + theAllocator:out BaseAllocator from BOPCol); MakeBlocks(myclass; - theMILI :DataMapOfPaveBlockListOfPaveBlock from BOPDS; - theMBlocks :out DataMapOfPaveBlockListOfPaveBlock from BOPDS; - theAllocator:out BaseAllocator from BOPCol); - + theMILI :IndexedDataMapOfPaveBlockListOfPaveBlock from BOPDS; + theMBlocks :out DataMapOfIntegerListOfPaveBlock from BOPDS; + theAllocator:out BaseAllocator from BOPCol); + PerformCommonBlocks(myclass; - theMBlocks :out DataMapOfPaveBlockListOfPaveBlock from BOPDS; - theAllocator:out BaseAllocator from BOPCol); + theMBlocks :out IndexedDataMapOfPaveBlockListOfPaveBlock from BOPDS; + theAllocator:out BaseAllocator from BOPCol); + + FillMap(myclass; + tneN1:Integer from Standard; + tneN2:Integer from Standard; + theMILI : out IndexedDataMapOfIntegerListOfInteger from BOPCol; + theAllocator: out BaseAllocator from BOPCol); + FillMap(myclass; - tneN1:Integer from Standard; - tneN2:Integer from Standard; - theMILI : out DataMapOfIntegerListOfInteger from BOPCol; - theAllocator: out BaseAllocator from BOPCol); - - + tnePB1:PaveBlock from BOPDS; + tnePB2:PaveBlock from BOPDS; + theMILI : out IndexedDataMapOfPaveBlockListOfPaveBlock from BOPDS; + theAllocator: out BaseAllocator from BOPCol); + FillMap(myclass; - tnePB1:PaveBlock from BOPDS; - tnePB2:PaveBlock from BOPDS; - theMILI : out DataMapOfPaveBlockListOfPaveBlock from BOPDS; - theAllocator: out BaseAllocator from BOPCol); - - FillMap(myclass; - tnePB1:PaveBlock from BOPDS; - tneF:Integer from Standard; - theMILI : out DataMapOfPaveBlockListOfInteger from BOPDS; - theAllocator: out BaseAllocator from BOPCol); - + tnePB1:PaveBlock from BOPDS; + tneF:Integer from Standard; + theMILI : out IndexedDataMapOfPaveBlockListOfInteger from BOPDS; + theAllocator: out BaseAllocator from BOPCol); + PerformCommonBlocks(myclass; - theMBlocks :DataMapOfPaveBlockListOfInteger from BOPDS; - theAllocator:out BaseAllocator from BOPCol); + theMBlocks :IndexedDataMapOfPaveBlockListOfInteger from BOPDS; + theAllocator:out BaseAllocator from BOPCol); --fields end Tools; diff --git a/src/BOPAlgo/BOPAlgo_Tools.cxx b/src/BOPAlgo/BOPAlgo_Tools.cxx index e446043704..e54ad08a58 100644 --- a/src/BOPAlgo/BOPAlgo_Tools.cxx +++ b/src/BOPAlgo/BOPAlgo_Tools.cxx @@ -18,37 +18,36 @@ #include #include +#include #include #include +#include //======================================================================= //function : MakeBlocksCnx //purpose : //======================================================================= - void BOPAlgo_Tools::MakeBlocksCnx(const BOPCol_DataMapOfIntegerListOfInteger& aMILI, + void BOPAlgo_Tools::MakeBlocksCnx(const BOPCol_IndexedDataMapOfIntegerListOfInteger& aMILI, BOPCol_DataMapOfIntegerListOfInteger& aMBlocks, Handle(NCollection_BaseAllocator)& aAllocator) { - Standard_Integer aNbV, nV, aNbVS, nVP, nVx, aNbVP, k; - BOPCol_DataMapIteratorOfDataMapOfIntegerListOfInteger aItMILI; - BOPCol_MapIteratorOfMapOfInteger aItMVP; + Standard_Integer aNbV, nV, aNbVS, nVP, nVx, aNbVP, aNbEC, k, i, j; BOPCol_ListIteratorOfListOfInteger aItLI; // BOPCol_MapOfInteger aMVS(100, aAllocator); - BOPCol_MapOfInteger aMEC(100, aAllocator); - BOPCol_MapOfInteger aMVP(100, aAllocator); - BOPCol_MapOfInteger aMVAdd(100, aAllocator); + BOPCol_IndexedMapOfInteger aMEC(100, aAllocator); + BOPCol_IndexedMapOfInteger aMVP(100, aAllocator); + BOPCol_IndexedMapOfInteger aMVAdd(100, aAllocator); // aNbV=aMILI.Extent(); // - aItMILI.Initialize(aMILI); - for (k=0; aItMILI.More(); aItMILI.Next()) { + for (k=0,i=1; i<=aNbV; ++i) { aNbVS=aMVS.Extent(); if (aNbVS==aNbV) { break; } // - nV=aItMILI.Key(); + nV = aMILI.FindKey(i); if (aMVS.Contains(nV)){ continue; } @@ -61,10 +60,9 @@ aMVP.Add(nV); while(1) { aNbVP=aMVP.Extent(); - aItMVP.Initialize(aMVP); - for (; aItMVP.More(); aItMVP.Next()) { - nVP=aItMVP.Value(); - const BOPCol_ListOfInteger& aLV=aMILI.Find(nVP); + for (j=1; j<=aNbVP; ++j) { + nVP=aMVP(j); + const BOPCol_ListOfInteger& aLV=aMILI.FindFromKey(nVP); aItLI.Initialize(aLV); for (; aItLI.More(); aItLI.Next()) { nVx=aItLI.Value(); @@ -84,25 +82,23 @@ } // aMVP.Clear(); - aItMVP.Initialize(aMVAdd); - for (; aItMVP.More(); aItMVP.Next()) { - aMVP.Add(aItMVP.Value()); + for (j=1; j<=aNbVP; ++j) { + aMVP.Add(aMVAdd(j)); } aMVAdd.Clear(); }//while(1) { // BOPCol_ListOfInteger aLIx(aAllocator); // - //aLIx.Append(nV); - aItMVP.Initialize(aMEC); - for (; aItMVP.More(); aItMVP.Next()) { - nVx=aItMVP.Value(); + aNbEC = aMEC.Extent(); + for (j=1; j<=aNbEC; ++j) { + nVx=aMEC(j); aLIx.Append(nVx); } // aMBlocks.Bind(k, aLIx); ++k; - }//for (; aItMILI.More(); aItMILI.Next()) { + }//for (k=0,i=1; i<=aNbV; ++i) aMVAdd.Clear(); aMVP.Clear(); aMEC.Clear(); @@ -114,26 +110,26 @@ //======================================================================= void BOPAlgo_Tools::FillMap(const Standard_Integer n1, const Standard_Integer n2, - BOPCol_DataMapOfIntegerListOfInteger& aMILI, + BOPCol_IndexedDataMapOfIntegerListOfInteger& aMILI, Handle(NCollection_BaseAllocator)& aAllocator) { - if (aMILI.IsBound(n1)) { - BOPCol_ListOfInteger& aLI=aMILI.ChangeFind(n1); + if (aMILI.Contains(n1)) { + BOPCol_ListOfInteger& aLI=aMILI.ChangeFromKey(n1); aLI.Append(n2); } else { BOPCol_ListOfInteger aLI(aAllocator); aLI.Append(n2); - aMILI.Bind(n1, aLI); + aMILI.Add(n1, aLI); } - if (aMILI.IsBound(n2)) { - BOPCol_ListOfInteger& aLI=aMILI.ChangeFind(n2); + if (aMILI.Contains(n2)) { + BOPCol_ListOfInteger& aLI=aMILI.ChangeFromKey(n2); aLI.Append(n1); } else { BOPCol_ListOfInteger aLI(aAllocator); aLI.Append(n1); - aMILI.Bind(n2, aLI); + aMILI.Add(n2, aLI); } } //======================================================================= @@ -142,26 +138,26 @@ //======================================================================= void BOPAlgo_Tools::FillMap(const Handle(BOPDS_PaveBlock)& aPB1, const Handle(BOPDS_PaveBlock)& aPB2, - BOPDS_DataMapOfPaveBlockListOfPaveBlock& aMPBLPB, + BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock& aMPBLPB, Handle(NCollection_BaseAllocator)& aAllocator) { - if (aMPBLPB.IsBound(aPB1)) { - BOPDS_ListOfPaveBlock& aLPB=aMPBLPB.ChangeFind(aPB1); + if (aMPBLPB.Contains(aPB1)) { + BOPDS_ListOfPaveBlock& aLPB=aMPBLPB.ChangeFromKey(aPB1); aLPB.Append(aPB2); } else { BOPDS_ListOfPaveBlock aLPB(aAllocator); aLPB.Append(aPB2); - aMPBLPB.Bind(aPB1, aLPB); + aMPBLPB.Add(aPB1, aLPB); } - if (aMPBLPB.IsBound(aPB2)) { - BOPDS_ListOfPaveBlock& aLPB=aMPBLPB.ChangeFind(aPB2); + if (aMPBLPB.Contains(aPB2)) { + BOPDS_ListOfPaveBlock& aLPB=aMPBLPB.ChangeFromKey(aPB2); aLPB.Append(aPB1); } else { BOPDS_ListOfPaveBlock aLPB(aAllocator); aLPB.Append(aPB1); - aMPBLPB.Bind(aPB2, aLPB); + aMPBLPB.Add(aPB2, aLPB); } } //======================================================================= @@ -170,47 +166,44 @@ //======================================================================= void BOPAlgo_Tools::FillMap(const Handle(BOPDS_PaveBlock)& aPB, const Standard_Integer nF, - BOPDS_DataMapOfPaveBlockListOfInteger& aMPBLI, + BOPDS_IndexedDataMapOfPaveBlockListOfInteger& aMPBLI, Handle(NCollection_BaseAllocator)& aAllocator) { - if (aMPBLI.IsBound(aPB)) { - BOPCol_ListOfInteger& aLI=aMPBLI.ChangeFind(aPB); + if (aMPBLI.Contains(aPB)) { + BOPCol_ListOfInteger& aLI=aMPBLI.ChangeFromKey(aPB); aLI.Append(nF); } else { BOPCol_ListOfInteger aLI(aAllocator); aLI.Append(nF); - aMPBLI.Bind(aPB, aLI); + aMPBLI.Add(aPB, aLI); } } //======================================================================= //function : MakeBlocks //purpose : //======================================================================= - void BOPAlgo_Tools::MakeBlocks(const BOPDS_DataMapOfPaveBlockListOfPaveBlock& aMILI, - BOPDS_DataMapOfPaveBlockListOfPaveBlock& aMBlocks, + void BOPAlgo_Tools::MakeBlocks(const BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock& aMILI, + BOPDS_DataMapOfIntegerListOfPaveBlock& aMBlocks, Handle(NCollection_BaseAllocator)& aAllocator) { - Standard_Integer aNbV, aNbVS, aNbVP, k;//nV,nVx,nVP - BOPDS_DataMapIteratorOfDataMapOfPaveBlockListOfPaveBlock aItMILI; - BOPDS_MapIteratorOfMapOfPaveBlock aItMVP; + Standard_Integer aNbV, aNbVS, aNbVP, aNbEC, k, i, j; BOPDS_ListIteratorOfListOfPaveBlock aItLI; // BOPDS_MapOfPaveBlock aMVS(100, aAllocator); - BOPDS_MapOfPaveBlock aMEC(100, aAllocator); - BOPDS_MapOfPaveBlock aMVP(100, aAllocator); - BOPDS_MapOfPaveBlock aMVAdd(100, aAllocator); + BOPDS_IndexedMapOfPaveBlock aMEC(100, aAllocator); + BOPDS_IndexedMapOfPaveBlock aMVP(100, aAllocator); + BOPDS_IndexedMapOfPaveBlock aMVAdd(100, aAllocator); // aNbV=aMILI.Extent(); // - aItMILI.Initialize(aMILI); - for (k=0; aItMILI.More(); aItMILI.Next()) { + for (k=0, i=1; i<=aNbV; ++i) { aNbVS=aMVS.Extent(); if (aNbVS==aNbV) { break; } // - const Handle(BOPDS_PaveBlock)& nV=aItMILI.Key(); + const Handle(BOPDS_PaveBlock)& nV=aMILI.FindKey(i); if (aMVS.Contains(nV)){ continue; } @@ -223,10 +216,9 @@ aMVP.Add(nV); while(1) { aNbVP=aMVP.Extent(); - aItMVP.Initialize(aMVP); - for (; aItMVP.More(); aItMVP.Next()) { - const Handle(BOPDS_PaveBlock)& nVP=aItMVP.Value(); - const BOPDS_ListOfPaveBlock& aLV=aMILI.Find(nVP); + for (j=1; j<=aNbVP; ++j) { + const Handle(BOPDS_PaveBlock)& nVP=aMVP(j); + const BOPDS_ListOfPaveBlock& aLV=aMILI.FindFromKey(nVP); aItLI.Initialize(aLV); for (; aItLI.More(); aItLI.Next()) { const Handle(BOPDS_PaveBlock)& nVx=aItLI.Value(); @@ -246,25 +238,23 @@ } // aMVP.Clear(); - aItMVP.Initialize(aMVAdd); - for (; aItMVP.More(); aItMVP.Next()) { - aMVP.Add(aItMVP.Value()); + for (j=1; j<=aNbVP; ++j) { + aMVP.Add(aMVAdd(j)); } aMVAdd.Clear(); }//while(1) { // BOPDS_ListOfPaveBlock aLIx(aAllocator); // - //aLIx.Append(nV); - aItMVP.Initialize(aMEC); - for (; aItMVP.More(); aItMVP.Next()) { - const Handle(BOPDS_PaveBlock)& nVx=aItMVP.Value(); + aNbEC = aMEC.Extent(); + for (j=1; j<=aNbEC; ++j) { + const Handle(BOPDS_PaveBlock)& nVx=aMEC(j); aLIx.Append(nVx); } // - aMBlocks.Bind(aLIx.First(), aLIx); + aMBlocks.Bind(k, aLIx); ++k; - }//for (; aItMILI.More(); aItMILI.Next()) { + }//for (k=0, i=1; i<=aNbV; ++i) aMVAdd.Clear(); aMVP.Clear(); aMEC.Clear(); @@ -274,7 +264,7 @@ //function : PerformCommonBlocks //purpose : //======================================================================= - void BOPAlgo_Tools::PerformCommonBlocks(BOPDS_DataMapOfPaveBlockListOfPaveBlock& aMPBLPB, + void BOPAlgo_Tools::PerformCommonBlocks(BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock& aMPBLPB, Handle(NCollection_BaseAllocator)& aAllocator) { Standard_Integer aNbCB; @@ -284,18 +274,16 @@ return; } // - Standard_Integer aNbPB; - BOPDS_DataMapIteratorOfDataMapOfPaveBlockListOfPaveBlock aItMPBLPB; + Standard_Integer aNbPB, aNbBlocks, k; BOPDS_ListIteratorOfListOfPaveBlock aItLPB; Handle(BOPDS_CommonBlock) aCB; - BOPDS_DataMapOfPaveBlockListOfPaveBlock aMBlocks(100, aAllocator); + BOPDS_DataMapOfIntegerListOfPaveBlock aMBlocks(100, aAllocator); // BOPAlgo_Tools::MakeBlocks(aMPBLPB, aMBlocks, aAllocator); // - aItMPBLPB.Initialize(aMBlocks); - for (; aItMPBLPB.More(); aItMPBLPB.Next()) { - const Handle(BOPDS_PaveBlock)& aPB=aItMPBLPB.Key(); - const BOPDS_ListOfPaveBlock& aLPB=aItMPBLPB.Value(); + aNbBlocks = aMBlocks.Extent(); + for (k=0; k1) { aCB=new BOPDS_CommonBlock; @@ -318,18 +306,17 @@ //function : PerformCommonBlocks //purpose : //======================================================================= - void BOPAlgo_Tools::PerformCommonBlocks(const BOPDS_DataMapOfPaveBlockListOfInteger& aMPBLI, + void BOPAlgo_Tools::PerformCommonBlocks(const BOPDS_IndexedDataMapOfPaveBlockListOfInteger& aMPBLI, Handle(NCollection_BaseAllocator)& )//aAllocator) { - Standard_Integer nF; - BOPDS_DataMapIteratorOfDataMapOfPaveBlockListOfInteger aItMPBLI; + Standard_Integer nF, i, aNb; BOPCol_ListIteratorOfListOfInteger aItLI; Handle(BOPDS_PaveBlock) aPB; Handle(BOPDS_CommonBlock) aCB; // - aItMPBLI.Initialize(aMPBLI); - for (; aItMPBLI.More(); aItMPBLI.Next()) { - aPB=aItMPBLI.Key(); + aNb=aMPBLI.Extent(); + for (i=1; i<=aNb; ++i) { + aPB=aMPBLI.FindKey(i); if (aPB->IsCommonBlock()) { aCB=aPB->CommonBlock(); } @@ -338,7 +325,7 @@ aCB->AddPaveBlock(aPB); } // - const BOPCol_ListOfInteger& aLI=aItMPBLI.Value(); + const BOPCol_ListOfInteger& aLI=aMPBLI.FindFromKey(aPB); aItLI.Initialize(aLI); for (; aItLI.More(); aItLI.Next()) { nF=aItLI.Value(); diff --git a/src/BOPAlgo/BOPAlgo_WireSplitter.cxx b/src/BOPAlgo/BOPAlgo_WireSplitter.cxx index d59f3cc6ef..a2ff1b90a9 100644 --- a/src/BOPAlgo/BOPAlgo_WireSplitter.cxx +++ b/src/BOPAlgo/BOPAlgo_WireSplitter.cxx @@ -148,20 +148,18 @@ void BOPAlgo_WireSplitter::MakeConnexityBlocks() { Standard_Boolean bRegular, bClosed; - Standard_Integer i, j, aNbV, aNbVS, aNbVP; + Standard_Integer i, j, aNbV, aNbVS, aNbVP, k; TopoDS_Iterator aItE; TopoDS_Shape aER; BOPCol_ListIteratorOfListOfShape aIt; BOPCol_MapIteratorOfMapOfShape aItM; // BOPCol_IndexedDataMapOfShapeListOfShape aMVE(100, myAllocator); - BOPCol_MapOfShape aMVP(100, myAllocator); - //modified by NIZHNY-EMV Wed Oct 06 10:17:57 2010 + BOPCol_IndexedMapOfShape aMVP(100, myAllocator); BOPCol_IndexedMapOfShape aMEC(100, myAllocator); - //modified by NIZHNY-EMV Wed Oct 06 10:18:02 2010 BOPCol_MapOfShape aMER(100, myAllocator); BOPCol_MapOfShape aMEP(100, myAllocator); - BOPCol_MapOfShape aMVAdd(100, myAllocator); + BOPCol_IndexedMapOfShape aMVAdd(100, myAllocator); BOPCol_MapOfShape aMVS(100, myAllocator); // myLCB.Clear(); @@ -202,16 +200,13 @@ // while(1) { aNbVP=aMVP.Extent(); - aItM.Initialize(aMVP); - for (; aItM.More(); aItM.Next()) { - const TopoDS_Shape& aVP=aItM.Value(); + for (k=1; k<=aNbVP; ++k) { + const TopoDS_Shape& aVP=aMVP(k); const BOPCol_ListOfShape& aLE=aMVE.FindFromKey(aVP); aIt.Initialize(aLE); for (; aIt.More(); aIt.Next()) { const TopoDS_Shape& aE=aIt.Value(); - //modified by NIZHNY-EMV Wed Oct 06 10:18:19 2010 if (aMEC.Add(aE)) { - //modified by NIZHNY-EMV Wed Oct 06 10:18:25 2010 aItE.Initialize(aE); for (; aItE.More(); aItE.Next()) { const TopoDS_Shape& aVE=aItE.Value(); @@ -230,9 +225,8 @@ // aMVP.Clear(); // - aItM.Initialize(aMVAdd); - for (; aItM.More(); aItM.Next()) { - const TopoDS_Shape& aVE=aItM.Value(); + for (k=1; k<=aNbVP; ++k) { + const TopoDS_Shape& aVE=aMVAdd(k); aMVP.Add(aVE); } aMVAdd.Clear(); @@ -245,11 +239,9 @@ BOPCol_IndexedDataMapOfShapeListOfShape aMVER(100, myAllocator); // bRegular=Standard_True; - //modified by NIZHNY-EMV Wed Oct 06 10:18:45 2010 Standard_Integer aNbCB = aMEC.Extent(); for (j = 1; j <= aNbCB; j++) { aER = aMEC(j); - //modified by NIZHNY-EMV Wed Oct 06 10:18:50 2010 // if (aMER.Contains(aER)) { aER.Orientation(TopAbs_FORWARD); diff --git a/src/BOPCol/BOPCol.cdl b/src/BOPCol/BOPCol.cdl index 9307635833..baa21e089c 100644 --- a/src/BOPCol/BOPCol.cdl +++ b/src/BOPCol/BOPCol.cdl @@ -50,6 +50,8 @@ is imported ListOfListOfShape from BOPCol; imported SequenceOfShape from BOPCol; imported SequenceOfPnt2d from BOPCol; - imported DataMapOfIntegerListOfShape from BOPCol; + imported DataMapOfIntegerListOfShape from BOPCol; + imported IndexedDataMapOfIntegerListOfInteger from BOPCol; + imported IndexedDataMapOfShapeInteger from BOPCol; end BOPCol; diff --git a/src/BOPCol/BOPCol_IndexedDataMapOfIntegerListOfInteger.hxx b/src/BOPCol/BOPCol_IndexedDataMapOfIntegerListOfInteger.hxx new file mode 100644 index 0000000000..d69d6685cb --- /dev/null +++ b/src/BOPCol/BOPCol_IndexedDataMapOfIntegerListOfInteger.hxx @@ -0,0 +1,33 @@ +// Created by: Peter KURNEV +// Copyright (c) 1999-2012 OPEN CASCADE SAS +// +// The content of this file is subject to the Open CASCADE Technology Public +// License Version 6.5 (the "License"). You may not use the content of this file +// except in compliance with the License. Please obtain a copy of the License +// at http://www.opencascade.org and read it completely before using this file. +// +// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its +// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. +// +// The Original Code and all software distributed under the License is +// distributed on an "AS IS" basis, without warranty of any kind, and the +// Initial Developer hereby disclaims all such warranties, including without +// limitation, any warranties of merchantability, fitness for a particular +// purpose or non-infringement. Please see the License for the specific terms +// and conditions governing the rights and limitations under the License. + + +#ifndef BOPCol_IndexedDataMapOfIntegerListOfInteger_HeaderFile +#define BOPCol_IndexedDataMapOfIntegerListOfInteger_HeaderFile + + +#include + +#include +#include + +typedef NCollection_IndexedDataMap BOPCol_IndexedDataMapOfIntegerListOfInteger; + +#undef _NCollection_MapHasher + +#endif diff --git a/src/BOPCol/BOPCol_IndexedDataMapOfShapeInteger.hxx b/src/BOPCol/BOPCol_IndexedDataMapOfShapeInteger.hxx new file mode 100644 index 0000000000..0e6c2e4a1d --- /dev/null +++ b/src/BOPCol/BOPCol_IndexedDataMapOfShapeInteger.hxx @@ -0,0 +1,39 @@ +// Created by: Peter KURNEV +// Copyright (c) 1999-2012 OPEN CASCADE SAS +// +// The content of this file is subject to the Open CASCADE Technology Public +// License Version 6.5 (the "License"). You may not use the content of this file +// except in compliance with the License. Please obtain a copy of the License +// at http://www.opencascade.org and read it completely before using this file. +// +// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its +// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. +// +// The Original Code and all software distributed under the License is +// distributed on an "AS IS" basis, without warranty of any kind, and the +// Initial Developer hereby disclaims all such warranties, including without +// limitation, any warranties of merchantability, fitness for a particular +// purpose or non-infringement. Please see the License for the specific terms +// and conditions governing the rights and limitations under the License. + + +#ifndef BOPCol_IndexedDataMapOfShapeInteger_HeaderFile +#define BOPCol_IndexedDataMapOfShapeInteger_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +#include +#include + +#include + +typedef NCollection_IndexedDataMap BOPCol_IndexedDataMapOfShapeInteger; + +#undef _NCollection_MapHasher + +#endif diff --git a/src/BOPCol/FILES b/src/BOPCol/FILES index 21f91fabff..f04b945f5c 100644 --- a/src/BOPCol/FILES +++ b/src/BOPCol/FILES @@ -26,3 +26,5 @@ BOPCol_BaseAllocator.hxx BOPCol_DataMapOfIntegerListOfShape.hxx BOPCol_SequenceOfReal.hxx BOPCol_DataMapOfIntegerShape.hxx +BOPCol_IndexedDataMapOfIntegerListOfInteger.hxx +BOPCol_IndexedDataMapOfShapeInteger.hxx \ No newline at end of file diff --git a/src/BOPDS/BOPDS.cdl b/src/BOPDS/BOPDS.cdl index 883c1dc30e..863f7bc3c6 100644 --- a/src/BOPDS/BOPDS.cdl +++ b/src/BOPDS/BOPDS.cdl @@ -85,6 +85,11 @@ is imported MapOfCommonBlock from BOPDS; imported VectorOfFaceInfo from BOPDS; imported MapOfPave from BOPDS; + imported IndexedDataMapOfPaveBlockListOfPaveBlock from BOPDS; + imported DataMapOfIntegerListOfPaveBlock from BOPDS; + imported IndexedMapOfPaveBlock from BOPDS; + imported IndexedDataMapOfPaveBlockListOfInteger from BOPDS; + imported IndexedDataMapOfShapeCoupleOfPaveBlocks from BOPDS; -- imported Interf from BOPDS; imported InterfVV from BOPDS; diff --git a/src/BOPDS/BOPDS_DS.cdl b/src/BOPDS/BOPDS_DS.cdl index db2a38a489..29a916c67c 100644 --- a/src/BOPDS/BOPDS_DS.cdl +++ b/src/BOPDS/BOPDS_DS.cdl @@ -55,9 +55,10 @@ uses VectorOfListOfPaveBlock from BOPDS, ListOfPaveBlock from BOPDS, ListOfPave from BOPDS, - PaveBlock from BOPDS, + PaveBlock from BOPDS, CommonBlock from BOPDS, MapOfPaveBlock from BOPDS, + IndexedMapOfPaveBlock from BOPDS, VectorOfFaceInfo from BOPDS, FaceInfo from BOPDS, -- @@ -322,7 +323,7 @@ is FaceInfoOn(me:out; theIndex:Integer from Standard; - theMPB:out MapOfPaveBlock from BOPDS; + theMPB:out IndexedMapOfPaveBlock from BOPDS; theMVP:out MapOfInteger from BOPCol); ---Purpose: --- Selector @@ -331,7 +332,7 @@ is FaceInfoIn(me:out; theIndex:Integer from Standard; - theMPB:out MapOfPaveBlock from BOPDS; + theMPB:out IndexedMapOfPaveBlock from BOPDS; theMVP:out MapOfInteger from BOPCol); ---Purpose: --- Selector diff --git a/src/BOPDS/BOPDS_DS.cxx b/src/BOPDS/BOPDS_DS.cxx index 880b3fcfd9..6adad0b03b 100644 --- a/src/BOPDS/BOPDS_DS.cxx +++ b/src/BOPDS/BOPDS_DS.cxx @@ -1058,7 +1058,7 @@ static iRef=aSI.Reference(); BOPDS_FaceInfo &aFI=myFaceInfoPool(iRef); // - BOPDS_MapOfPaveBlock& aMPBIn=aFI.ChangePaveBlocksIn(); + BOPDS_IndexedMapOfPaveBlock& aMPBIn=aFI.ChangePaveBlocksIn(); BOPCol_MapOfInteger& aMVIn=aFI.ChangeVerticesIn(); aMPBIn.Clear(); aMVIn.Clear(); @@ -1078,7 +1078,7 @@ static iRef=aSI.Reference(); BOPDS_FaceInfo &aFI=myFaceInfoPool(iRef); // - BOPDS_MapOfPaveBlock& aMPBOn=aFI.ChangePaveBlocksOn(); + BOPDS_IndexedMapOfPaveBlock& aMPBOn=aFI.ChangePaveBlocksOn(); BOPCol_MapOfInteger& aMVOn=aFI.ChangeVerticesOn(); aMPBOn.Clear(); aMVOn.Clear(); @@ -1090,7 +1090,7 @@ static //purpose : //======================================================================= void BOPDS_DS::FaceInfoOn(const Standard_Integer theF, - BOPDS_MapOfPaveBlock& theMPB, + BOPDS_IndexedMapOfPaveBlock& theMPB, BOPCol_MapOfInteger& theMI) { Standard_Integer nS, nSD, nV1, nV2; @@ -1135,7 +1135,7 @@ static //purpose : //======================================================================= void BOPDS_DS::FaceInfoIn(const Standard_Integer theF, - BOPDS_MapOfPaveBlock& theMPB, + BOPDS_IndexedMapOfPaveBlock& theMPB, BOPCol_MapOfInteger& theMI) { Standard_Integer i, aNbVF, aNbEF, nV, nE; @@ -1184,20 +1184,25 @@ static //======================================================================= void BOPDS_DS::RefineFaceInfoOn() { - Standard_Integer i, aNb, nF; - BOPDS_MapIteratorOfMapOfPaveBlock aIt; + Standard_Integer i, aNb, nF, aNbPB, j; + BOPDS_IndexedMapOfPaveBlock aMPB; // aNb=myFaceInfoPool.Extent(); for (i=0; iHasEdge()) { - aMPBOn.Remove(aPB); + BOPDS_IndexedMapOfPaveBlock& aMPBOn=aFI.ChangePaveBlocksOn(); + // + aMPB.Clear(); + aMPB.Assign(aMPBOn); + aMPBOn.Clear(); + // + aNbPB=aMPB.Extent(); + for (j=1; j<=aNbPB; ++j) { + const Handle(BOPDS_PaveBlock)& aPB=aMPB(j); + if (aPB->HasEdge()) { + aMPBOn.Add(aPB); } } } @@ -1220,7 +1225,7 @@ static const BOPDS_FaceInfo& aFI=FaceInfo(theI); // for (i=0; i<2; ++i) { - const BOPDS_MapOfPaveBlock& aMPB=(!i) ? aFI.PaveBlocksIn() : aFI.PaveBlocksSc(); + const BOPDS_IndexedMapOfPaveBlock& aMPB=(!i) ? aFI.PaveBlocksIn() : aFI.PaveBlocksSc(); aItMPB.Initialize(aMPB); for (; aItMPB.More(); aItMPB.Next()) { const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value(); @@ -1261,7 +1266,7 @@ static const BOPDS_FaceInfo& aFI1=FaceInfo(nF1); const BOPDS_FaceInfo& aFI2=FaceInfo(nF2); // - const BOPDS_MapOfPaveBlock& aMPBOn1=aFI1.PaveBlocksOn(); + const BOPDS_IndexedMapOfPaveBlock& aMPBOn1=aFI1.PaveBlocksOn(); aItMPB.Initialize(aMPBOn1); for (; aItMPB.More(); aItMPB.Next()) { const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value(); @@ -1271,7 +1276,7 @@ static aMI.Add(nV2); } // - const BOPDS_MapOfPaveBlock& aMPBIn1=aFI1.PaveBlocksIn(); + const BOPDS_IndexedMapOfPaveBlock& aMPBIn1=aFI1.PaveBlocksIn(); aItMPB.Initialize(aMPBIn1); for (; aItMPB.More(); aItMPB.Next()) { const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value(); @@ -1281,7 +1286,7 @@ static aMI.Add(nV2); } // - const BOPDS_MapOfPaveBlock& aMPBOn2=aFI2.PaveBlocksOn(); + const BOPDS_IndexedMapOfPaveBlock& aMPBOn2=aFI2.PaveBlocksOn(); aItMPB.Initialize(aMPBOn2); for (; aItMPB.More(); aItMPB.Next()) { const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value(); @@ -1291,7 +1296,7 @@ static aMI.Add(nV2); } // - const BOPDS_MapOfPaveBlock& aMPBIn2=aFI2.PaveBlocksIn(); + const BOPDS_IndexedMapOfPaveBlock& aMPBIn2=aFI2.PaveBlocksIn(); aItMPB.Initialize(aMPBIn2); for (; aItMPB.More(); aItMPB.Next()) { const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value(); diff --git a/src/BOPDS/BOPDS_DataMapOfIntegerListOfPaveBlock.hxx b/src/BOPDS/BOPDS_DataMapOfIntegerListOfPaveBlock.hxx new file mode 100644 index 0000000000..2b1d93e9b8 --- /dev/null +++ b/src/BOPDS/BOPDS_DataMapOfIntegerListOfPaveBlock.hxx @@ -0,0 +1,40 @@ +// Created by: Eugeny MALTCHIKOV +// Copyright (c) 1999-2012 OPEN CASCADE SAS +// +// The content of this file is subject to the Open CASCADE Technology Public +// License Version 6.5 (the "License"). You may not use the content of this file +// except in compliance with the License. Please obtain a copy of the License +// at http://www.opencascade.org and read it completely before using this file. +// +// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its +// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. +// +// The Original Code and all software distributed under the License is +// distributed on an "AS IS" basis, without warranty of any kind, and the +// Initial Developer hereby disclaims all such warranties, including without +// limitation, any warranties of merchantability, fitness for a particular +// purpose or non-infringement. Please see the License for the specific terms +// and conditions governing the rights and limitations under the License. + + +#ifndef BOPDS_DataMapOfIntegerListOfPaveBlock_HeaderFile +#define BOPDS_DataMapOfIntegerListOfPaveBlock_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +#define _NCollection_MapHasher +#include +#include +#include + +typedef NCollection_DataMap BOPDS_DataMapOfIntegerListOfPaveBlock; + +#undef _NCollection_MapHasher + + +#endif diff --git a/src/BOPDS/BOPDS_FaceInfo.cdl b/src/BOPDS/BOPDS_FaceInfo.cdl index b17be40b26..12f9ae2a68 100644 --- a/src/BOPDS/BOPDS_FaceInfo.cdl +++ b/src/BOPDS/BOPDS_FaceInfo.cdl @@ -28,7 +28,7 @@ class FaceInfo from BOPDS uses BaseAllocator from BOPCol, MapOfInteger from BOPCol, - MapOfPaveBlock from BOPDS + IndexedMapOfPaveBlock from BOPDS --raises @@ -70,7 +70,7 @@ is -- In -- PaveBlocksIn(me) - returns MapOfPaveBlock from BOPDS; + returns IndexedMapOfPaveBlock from BOPDS; ---C++: return const & ---C++: inline ---Purpose: @@ -79,7 +79,7 @@ is --- that have state In ChangePaveBlocksIn(me:out) - returns MapOfPaveBlock from BOPDS; + returns IndexedMapOfPaveBlock from BOPDS; ---C++: return & ---C++: inline ---Purpose: @@ -111,7 +111,7 @@ is -- On -- PaveBlocksOn(me) - returns MapOfPaveBlock from BOPDS; + returns IndexedMapOfPaveBlock from BOPDS; ---C++: return const & ---C++: inline ---Purpose: @@ -120,7 +120,7 @@ is --- that have state On ChangePaveBlocksOn(me:out) - returns MapOfPaveBlock from BOPDS; + returns IndexedMapOfPaveBlock from BOPDS; ---C++: return & ---C++: inline ---Purpose: @@ -151,7 +151,7 @@ is -- Sections -- PaveBlocksSc(me) - returns MapOfPaveBlock from BOPDS; + returns IndexedMapOfPaveBlock from BOPDS; ---C++: return const & ---C++: inline ---Purpose: @@ -160,7 +160,7 @@ is --- that are pave blocks of section edges ChangePaveBlocksSc(me:out) - returns MapOfPaveBlock from BOPDS; + returns IndexedMapOfPaveBlock from BOPDS; ---C++: return & ---C++: inline --- Selector/Modifier @@ -193,11 +193,11 @@ is fields myAllocator : BaseAllocator from BOPCol is protected; myIndex : Integer from Standard is protected; - myPaveBlocksIn: MapOfPaveBlock from BOPDS is protected; + myPaveBlocksIn: IndexedMapOfPaveBlock from BOPDS is protected; myVerticesIn : MapOfInteger from BOPCol is protected; - myPaveBlocksOn: MapOfPaveBlock from BOPDS is protected; + myPaveBlocksOn: IndexedMapOfPaveBlock from BOPDS is protected; myVerticesOn : MapOfInteger from BOPCol is protected; - myPaveBlocksSc: MapOfPaveBlock from BOPDS is protected; + myPaveBlocksSc: IndexedMapOfPaveBlock from BOPDS is protected; myVerticesSc : MapOfInteger from BOPCol is protected; end FaceInfo; diff --git a/src/BOPDS/BOPDS_FaceInfo.lxx b/src/BOPDS/BOPDS_FaceInfo.lxx index bccf835b45..137a98ac70 100644 --- a/src/BOPDS/BOPDS_FaceInfo.lxx +++ b/src/BOPDS/BOPDS_FaceInfo.lxx @@ -90,7 +90,7 @@ //function : PaveBlockIn //purpose : //======================================================================= - inline const BOPDS_MapOfPaveBlock& BOPDS_FaceInfo::PaveBlocksIn()const + inline const BOPDS_IndexedMapOfPaveBlock& BOPDS_FaceInfo::PaveBlocksIn()const { return myPaveBlocksIn; } @@ -98,7 +98,7 @@ //function : ChangePaveBlocksIn //purpose : //======================================================================= - inline BOPDS_MapOfPaveBlock& BOPDS_FaceInfo::ChangePaveBlocksIn() + inline BOPDS_IndexedMapOfPaveBlock& BOPDS_FaceInfo::ChangePaveBlocksIn() { return myPaveBlocksIn; } @@ -123,7 +123,7 @@ //function : PaveBlocksOn //purpose : //======================================================================= - inline const BOPDS_MapOfPaveBlock& BOPDS_FaceInfo::PaveBlocksOn()const + inline const BOPDS_IndexedMapOfPaveBlock& BOPDS_FaceInfo::PaveBlocksOn()const { return myPaveBlocksOn; } @@ -131,7 +131,7 @@ //function : ChangePaveBlocksOn //purpose : //======================================================================= - inline BOPDS_MapOfPaveBlock& BOPDS_FaceInfo::ChangePaveBlocksOn() + inline BOPDS_IndexedMapOfPaveBlock& BOPDS_FaceInfo::ChangePaveBlocksOn() { return myPaveBlocksOn; } @@ -156,7 +156,7 @@ //function : PaveBlocksSc //purpose : //======================================================================= - inline const BOPDS_MapOfPaveBlock& BOPDS_FaceInfo::PaveBlocksSc()const + inline const BOPDS_IndexedMapOfPaveBlock& BOPDS_FaceInfo::PaveBlocksSc()const { return myPaveBlocksSc; } @@ -164,7 +164,7 @@ //function : ChangePaveBlocksSc //purpose : //======================================================================= - inline BOPDS_MapOfPaveBlock& BOPDS_FaceInfo::ChangePaveBlocksSc() + inline BOPDS_IndexedMapOfPaveBlock& BOPDS_FaceInfo::ChangePaveBlocksSc() { return myPaveBlocksSc; } diff --git a/src/BOPDS/BOPDS_IndexedDataMapOfPaveBlockListOfInteger.hxx b/src/BOPDS/BOPDS_IndexedDataMapOfPaveBlockListOfInteger.hxx new file mode 100644 index 0000000000..cb77c091fe --- /dev/null +++ b/src/BOPDS/BOPDS_IndexedDataMapOfPaveBlockListOfInteger.hxx @@ -0,0 +1,33 @@ +// Created by: Peter KURNEV +// Copyright (c) 1999-2012 OPEN CASCADE SAS +// +// The content of this file is subject to the Open CASCADE Technology Public +// License Version 6.5 (the "License"). You may not use the content of this file +// except in compliance with the License. Please obtain a copy of the License +// at http://www.opencascade.org and read it completely before using this file. +// +// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its +// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. +// +// The Original Code and all software distributed under the License is +// distributed on an "AS IS" basis, without warranty of any kind, and the +// Initial Developer hereby disclaims all such warranties, including without +// limitation, any warranties of merchantability, fitness for a particular +// purpose or non-infringement. Please see the License for the specific terms +// and conditions governing the rights and limitations under the License. + + +#ifndef BOPDS_IndexedDataMapOfPaveBlockListOfInteger_HeaderFile +#define BOPDS_IndexedDataMapOfPaveBlockListOfInteger_HeaderFile + +#define _NCollection_MapHasher +#include +#include +#include + +typedef NCollection_IndexedDataMap BOPDS_IndexedDataMapOfPaveBlockListOfInteger; + +#undef _NCollection_MapHasher + + +#endif diff --git a/src/BOPDS/BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock.hxx b/src/BOPDS/BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock.hxx new file mode 100644 index 0000000000..1c1e582682 --- /dev/null +++ b/src/BOPDS/BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock.hxx @@ -0,0 +1,34 @@ +// Created by: Eugeny MALTCHIKOV +// Copyright (c) 1999-2012 OPEN CASCADE SAS +// +// The content of this file is subject to the Open CASCADE Technology Public +// License Version 6.5 (the "License"). You may not use the content of this file +// except in compliance with the License. Please obtain a copy of the License +// at http://www.opencascade.org and read it completely before using this file. +// +// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its +// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. +// +// The Original Code and all software distributed under the License is +// distributed on an "AS IS" basis, without warranty of any kind, and the +// Initial Developer hereby disclaims all such warranties, including without +// limitation, any warranties of merchantability, fitness for a particular +// purpose or non-infringement. Please see the License for the specific terms +// and conditions governing the rights and limitations under the License. + + +#ifndef BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock_HeaderFile +#define BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock_HeaderFile + +#define _NCollection_MapHasher +#include +#include +#include +#include + +typedef NCollection_IndexedDataMap BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock; + +#undef _NCollection_MapHasher + + +#endif diff --git a/src/BOPDS/BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks.hxx b/src/BOPDS/BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks.hxx new file mode 100644 index 0000000000..841bdb90a4 --- /dev/null +++ b/src/BOPDS/BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks.hxx @@ -0,0 +1,33 @@ +// Created by: Peter KURNEV +// Copyright (c) 1999-2012 OPEN CASCADE SAS +// +// The content of this file is subject to the Open CASCADE Technology Public +// License Version 6.5 (the "License"). You may not use the content of this file +// except in compliance with the License. Please obtain a copy of the License +// at http://www.opencascade.org and read it completely before using this file. +// +// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its +// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. +// +// The Original Code and all software distributed under the License is +// distributed on an "AS IS" basis, without warranty of any kind, and the +// Initial Developer hereby disclaims all such warranties, including without +// limitation, any warranties of merchantability, fitness for a particular +// purpose or non-infringement. Please see the License for the specific terms +// and conditions governing the rights and limitations under the License. + + +#ifndef BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks_HeaderFile +#define BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks_HeaderFile + +#include + +#define _NCollection_MapHasher +#include +#include + +typedef NCollection_IndexedDataMap BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks; +#undef _NCollection_MapHasher + + +#endif diff --git a/src/BOPDS/BOPDS_IndexedMapOfPaveBlock.hxx b/src/BOPDS/BOPDS_IndexedMapOfPaveBlock.hxx new file mode 100644 index 0000000000..8665f1a1ab --- /dev/null +++ b/src/BOPDS/BOPDS_IndexedMapOfPaveBlock.hxx @@ -0,0 +1,33 @@ +// Created by: Eugeny MALTCHIKOV +// Copyright (c) 1999-2012 OPEN CASCADE SAS +// +// The content of this file is subject to the Open CASCADE Technology Public +// License Version 6.5 (the "License"). You may not use the content of this file +// except in compliance with the License. Please obtain a copy of the License +// at http://www.opencascade.org and read it completely before using this file. +// +// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its +// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. +// +// The Original Code and all software distributed under the License is +// distributed on an "AS IS" basis, without warranty of any kind, and the +// Initial Developer hereby disclaims all such warranties, including without +// limitation, any warranties of merchantability, fitness for a particular +// purpose or non-infringement. Please see the License for the specific terms +// and conditions governing the rights and limitations under the License. + + +#ifndef BOPDS_IndexedMapOfPaveBlock_HeaderFile +#define BOPDS_IndexedMapOfPaveBlock_HeaderFile + +#define _NCollection_MapHasher +#include +#include +#include + +typedef NCollection_IndexedMap BOPDS_IndexedMapOfPaveBlock; + +#undef _NCollection_MapHasher + + +#endif diff --git a/src/BOPDS/FILES b/src/BOPDS/FILES index 5b86cddb77..383ebd1ce3 100644 --- a/src/BOPDS/FILES +++ b/src/BOPDS/FILES @@ -28,3 +28,8 @@ BOPDS_VectorOfCurve.hxx BOPDS_VectorOfPoint.hxx BOPDS_DataMapOfShapeCoupleOfPaveBlocks.hxx BOPDS_MapOfPave.hxx +BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock.hxx +BOPDS_DataMapOfIntegerListOfPaveBlock.hxx +BOPDS_IndexedMapOfPaveBlock.hxx +BOPDS_IndexedDataMapOfPaveBlockListOfInteger.hxx +BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks.hxx \ No newline at end of file diff --git a/src/BOPInt/BOPInt_ShrunkRange.cxx b/src/BOPInt/BOPInt_ShrunkRange.cxx index 5056acfd64..edbeb0d6dd 100644 --- a/src/BOPInt/BOPInt_ShrunkRange.cxx +++ b/src/BOPInt/BOPInt_ShrunkRange.cxx @@ -210,7 +210,7 @@ Standard_Real ddx=aTolE;//1.e-12; BndLib_Add3dCurve::Add (aBAC, t1C, t2C, ddx, myBndBox); - myErrorStatus=0;//6 + myErrorStatus=6;//0 return; } } @@ -312,8 +312,7 @@ if (pri==-3) { //modified by NIZHNY-EMV Mon Nov 28 14:55:00 2011 t1C = t1; - myErrorStatus=6; - //myErrorStatus=4; + myErrorStatus=4; //return; //modified by NIZHNY-EMV Mon Nov 28 14:55:03 2011 } @@ -409,8 +408,7 @@ if (pri==-3) { //modified by NIZHNY-EMV Mon Nov 28 14:55:32 2011 t2C = t2; - myErrorStatus=6; - //myErrorStatus=5; + myErrorStatus=5; //return; //modified by NIZHNY-EMV Mon Nov 28 14:55:34 2011 } diff --git a/src/BOPTools/BOPTools_AlgoTools.cxx b/src/BOPTools/BOPTools_AlgoTools.cxx index effc76fa4d..7874c76ac6 100644 --- a/src/BOPTools/BOPTools_AlgoTools.cxx +++ b/src/BOPTools/BOPTools_AlgoTools.cxx @@ -94,15 +94,15 @@ static const TopAbs_ShapeEnum theType2, BOPCol_ListOfShape& theLCB) { - Standard_Integer aNbF, aNbAdd1; + Standard_Integer aNbF, aNbAdd, aNbAdd1, i; BRep_Builder aBB; TopoDS_Compound aC; TopoDS_Iterator aIt; TopExp_Explorer aExp; - BOPCol_MapOfShape aMCB, aMAdd, aMAdd1, aMP; + BOPCol_MapOfShape aMP; + BOPCol_IndexedMapOfShape aMCB, aMAdd, aMAdd1; BOPCol_IndexedDataMapOfShapeListOfShape aMEF; BOPCol_ListIteratorOfListOfShape aItLF; - BOPCol_MapIteratorOfMapOfShape aItM;//, aItM1; // // 1. aMEF BOPTools::MapShapesAndAncestors(theS, theType1, theType2, aMEF); @@ -122,9 +122,9 @@ static while(1) { aMAdd1.Clear(); // - aItM.Initialize(aMAdd); - for (; aItM.More(); aItM.Next()) { - const TopoDS_Shape& aF=aItM.Key(); + aNbAdd = aMAdd.Extent(); + for (i=1; i<=aNbAdd; ++i) { + const TopoDS_Shape& aF=aMAdd(i); // aExp.Init(aF, theType1); for (; aExp.More(); aExp.Next()) { @@ -144,7 +144,7 @@ static } }//for (; aExp.More(); aExp.Next()){ aMCB.Add(aF); - }// for (; aItM.More(); aItM.Next()) { + }// for (i=1; i<=aNbAdd; ++i) { // aNbAdd1=aMAdd1.Extent(); if (!aNbAdd1) { @@ -152,9 +152,8 @@ static } // aMAdd.Clear(); - aItM.Initialize(aMAdd1); - for (; aItM.More(); aItM.Next()) { - const TopoDS_Shape& aFAdd=aItM.Key(); + for (i=1; i<=aNbAdd1; ++i) { + const TopoDS_Shape& aFAdd = aMAdd1(i); aMAdd.Add(aFAdd); } }//while(1) { @@ -163,9 +162,8 @@ static if (aNbF) { aBB.MakeCompound(aC); // - aItM.Initialize(aMCB); - for (; aItM.More(); aItM.Next()) { - const TopoDS_Shape& aF=aItM.Key(); + for (i=1; i<=aNbF; ++i) { + const TopoDS_Shape& aF=aMCB(i); aBB.Add(aC, aF); aMP.Add(aF); } @@ -334,14 +332,13 @@ static BOPCol_ListOfShape& theLCB, const Handle(NCollection_BaseAllocator)& theAllocator) { - Standard_Integer aNbF, aNbAdd1; + Standard_Integer aNbF, aNbAdd1, aNbAdd, i; TopExp_Explorer aExp; - BOPCol_MapIteratorOfMapOfShape aItM, aItM1; BOPCol_ListIteratorOfListOfShape aIt; // - BOPCol_MapOfShape aMCB(100, theAllocator); - BOPCol_MapOfShape aMAdd(100, theAllocator); - BOPCol_MapOfShape aMAdd1(100, theAllocator); + BOPCol_IndexedMapOfShape aMCB(100, theAllocator); + BOPCol_IndexedMapOfShape aMAdd(100, theAllocator); + BOPCol_IndexedMapOfShape aMAdd1(100, theAllocator); BOPCol_IndexedDataMapOfShapeListOfShape aMEF(100, theAllocator); // // 1. aMEF @@ -358,9 +355,9 @@ static // while(1) { aMAdd1.Clear(); - aItM.Initialize(aMAdd); - for (; aItM.More(); aItM.Next()) { - const TopoDS_Shape& aF=aItM.Key(); + aNbAdd = aMAdd.Extent(); + for (i=1; i<=aNbAdd; ++i) { + const TopoDS_Shape& aF=aMAdd(i); // //aMAdd1.Clear(); aExp.Init(aF, TopAbs_EDGE); @@ -384,7 +381,7 @@ static } }//for (; aExp.More(); aExp.Next()){ aMCB.Add(aF); - }// for (; aItM.More(); aItM.Next()) { + }// for (i=1; i<=aNbAdd; ++i) { // aNbAdd1=aMAdd1.Extent(); if (!aNbAdd1) { @@ -392,9 +389,8 @@ static } // aMAdd.Clear(); - aItM1.Initialize(aMAdd1); - for (; aItM1.More(); aItM1.Next()) { - const TopoDS_Shape& aFAdd=aItM1.Key(); + for (i=1; i<=aNbAdd1; ++i) { + const TopoDS_Shape& aFAdd=aMAdd1(i); aMAdd.Add(aFAdd); } // @@ -402,9 +398,8 @@ static // aNbF=aMCB.Extent(); - aItM.Initialize(aMCB); - for (; aItM.More(); aItM.Next()) { - const TopoDS_Shape& aF=aItM.Key(); + for (i=1; i<=aNbF; ++i) { + const TopoDS_Shape& aF=aMCB(i); theLCB.Append(aF); } } diff --git a/src/BRepFeat/BRepFeat_Builder.cxx b/src/BRepFeat/BRepFeat_Builder.cxx index 7f98b689c7..4a7c9f29fe 100755 --- a/src/BRepFeat/BRepFeat_Builder.cxx +++ b/src/BRepFeat/BRepFeat_Builder.cxx @@ -271,7 +271,7 @@ //======================================================================= void BRepFeat_Builder::RebuildFaces() { - Standard_Integer aNbS, i, iRank, nSp; + Standard_Integer aNbS, i, iRank, nSp, j; Standard_Boolean bIsClosed, bIsDegenerated, bToReverse, bRem, bIm, bFlagSD, bVInShapes; TopAbs_Orientation anOriF, anOriE; @@ -334,8 +334,8 @@ aFF=aF; aFF.Orientation(TopAbs_FORWARD); - const BOPDS_MapOfPaveBlock& aMPBIn=aFI.PaveBlocksIn(); - const BOPDS_MapOfPaveBlock& aMPBSc=aFI.PaveBlocksSc(); + const BOPDS_IndexedMapOfPaveBlock& aMPBIn=aFI.PaveBlocksIn(); + const BOPDS_IndexedMapOfPaveBlock& aMPBSc=aFI.PaveBlocksSc(); aLE.Clear(); @@ -378,15 +378,10 @@ } else { bRem = Standard_True; aME.Add(aS); - } + } } // - if (!bRem && !bIm) { - aLE.Append(aE); - continue; - } - // - if (bRem && !bIm) { + if (!bIm) { aLE.Append(aE); continue; } @@ -449,10 +444,13 @@ } } + Standard_Integer aNbPBIn, aNbPBSc; + aNbPBIn = aMPBIn.Extent(); + aNbPBSc = aMPBSc.Extent(); + // //in edges - aItMPB.Initialize(aMPBIn); - for (; aItMPB.More(); aItMPB.Next()) { - const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value(); + for (j=1; j<=aNbPBIn; ++j) { + const Handle(BOPDS_PaveBlock)& aPB=aMPBIn(j); nSp=aPB->Edge(); aSp=(*(TopoDS_Edge*)(&myDS->Shape(nSp))); if (myRemoved.Contains(aSp)) { @@ -465,9 +463,8 @@ aLE.Append(aSp); } //section edges - aItMPB.Initialize(aMPBSc); - for (; aItMPB.More(); aItMPB.Next()) { - const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value(); + for (j=1; j<=aNbPBSc; ++j) { + const Handle(BOPDS_PaveBlock)& aPB=aMPBSc(j); nSp=aPB->Edge(); aSp=(*(TopoDS_Edge*)(&myDS->Shape(nSp))); if (myRemoved.Contains(aSp)) { @@ -529,6 +526,7 @@ { Standard_Integer nE, nSp, nV1, nV2, nE1, nV, nVx, nVSD; Standard_Integer nV11, nV21; + Standard_Boolean bOld; Standard_Real aT11, aT21; Standard_Real aT1, aT2; TopoDS_Edge aSp, aE; @@ -629,6 +627,7 @@ // aItMPB.Initialize(aMPB); //check if it is the old pave block. + bOld = Standard_False; for (; aItMPB.More(); aItMPB.Next()) { const Handle(BOPDS_PaveBlock)& aPB1 = aItMPB.Value(); aPB1->Indices(nV11, nV21); @@ -637,9 +636,13 @@ aT1 == aT11 && aT2 == aT21) { const TopoDS_Shape& aEIm = myDS->Shape(aPB1->Edge()); aLIm.Append(aEIm); - continue; + bOld = Standard_True; + break; } } + if (bOld) { + continue; + } // aV1=(*(TopoDS_Vertex *)(&myDS->Shape(nV1))); aV1.Orientation(TopAbs_FORWARD); @@ -671,7 +674,6 @@ BOPTools_MapOfSet aMST; BOPCol_ListOfShape aLSImNew; BOPCol_MapOfShape aMS; - Standard_Boolean bRem; BOPCol_ListIteratorOfListOfShape aIt; TopExp_Explorer aExp, aExpF; Standard_Boolean bFlagSD; @@ -743,7 +745,7 @@ // Standard_Boolean bIsIN, bHasImage; Standard_Integer aNbS, aNbSolids, i, j, aNbFaces, aNbFP, aNbFPx, aNbFIN, aNbLIF, aNbEFP; - Standard_Integer iRank, aNbRem; + Standard_Integer aNbRem; TopAbs_ShapeEnum aType; TopAbs_State aState; TopoDS_Iterator aIt, aItF; diff --git a/tests/blend/buildevol/G1 b/tests/blend/buildevol/G1 index 254cf2c0af..b0776a4963 100644 --- a/tests/blend/buildevol/G1 +++ b/tests/blend/buildevol/G1 @@ -1,7 +1,3 @@ -puts "TODO OCC22817 All: exception.+There are no suitable edges" -puts "TODO OCC22817 All: \\*\\* Exception \\*\\*" -puts "TODO OCC22817 All: TEST INCOMPLETE" - pcylinder s1 3 10 pcylinder s2 4 16 trotate s2 0 0 0 1 0 0 80 @@ -14,4 +10,4 @@ mkevol result s updatevol s_2 0 0.3*SCALE1 1 0.5*SCALE1 2 0.3*SCALE1 buildevol -set square 0 +set square 20125.9 diff --git a/tests/blend/simple/K4 b/tests/blend/simple/K4 index d4297cb54a..492dd90d60 100644 --- a/tests/blend/simple/K4 +++ b/tests/blend/simple/K4 @@ -1,7 +1,3 @@ -puts "TODO OCC22817 All: exception.+There are no suitable edges" -puts "TODO OCC22817 All: \\*\\* Exception \\*\\*" -puts "TODO OCC22817 All: TEST INCOMPLETE" - pcylinder s1 3 10 pcylinder s2 4 16 trotate s2 0 0 0 1 0 0 80 @@ -12,4 +8,4 @@ tscale s 0 0 0 SCALE1 explode s e blend result s 0.5*SCALE1 s_2 -set square 0 +set square 19893.8 diff --git a/tests/boolean/bcommon_complex/C7 b/tests/boolean/bcommon_complex/C7 index 198df2b332..9ba26e47b4 100644 --- a/tests/boolean/bcommon_complex/C7 +++ b/tests/boolean/bcommon_complex/C7 @@ -5,4 +5,4 @@ restore [locate_data_file buc60290b.rle] sol2 bcommon result sol2 sol1 -set square 644559 +set square 667287 diff --git a/tests/boolean/bsection/A3 b/tests/boolean/bsection/A3 index 7e77e0995c..f64146901d 100644 --- a/tests/boolean/bsection/A3 +++ b/tests/boolean/bsection/A3 @@ -1,5 +1,5 @@ restore [locate_data_file a2] a restore [locate_data_file b2_bsect] b -bsection result a b +bsection result a b -n2d -set length 25.1327 +set length 48.4314 diff --git a/tests/caf/driver/B6 b/tests/caf/driver/B6 index 41f7e19a47..7087686b5d 100755 --- a/tests/caf/driver/B6 +++ b/tests/caf/driver/B6 @@ -61,7 +61,7 @@ GetShape D $Com1:2 Pr NewCommand D explode Pr E AddDriver D Attach Cyl -set Sel1 [AttachShape D Pr_5 ${Prism} ${Prism} 0]; ## set attachment +set Sel1 [AttachShape D Pr_6 ${Prism} ${Prism} 0]; ## set attachment set Cyl [AddCyl D 70 515 ${Sel1}] ComputeFun D $Cyl:1 GetShape D $Cyl:1:2 CylS diff --git a/tests/caf/driver/B7 b/tests/caf/driver/B7 index 765ba52ba6..2210375b28 100755 --- a/tests/caf/driver/B7 +++ b/tests/caf/driver/B7 @@ -61,7 +61,7 @@ GetShape D $Com1:2 Pr NewCommand D explode Pr E AddDriver D Attach Cyl -set Sel1 [AttachShape D Pr_5 ${Prism} ${Prism} 0]; ## set attachment +set Sel1 [AttachShape D Pr_6 ${Prism} ${Prism} 0]; ## set attachment set Cyl [AddCyl D 70 515 ${Sel1}] ComputeFun D $Cyl:1 GetShape D $Cyl:1:2 CylS diff --git a/tests/caf/named_shape/F6 b/tests/caf/named_shape/F6 index c51d62fe87..fef578823c 100755 --- a/tests/caf/named_shape/F6 +++ b/tests/caf/named_shape/F6 @@ -84,7 +84,7 @@ GetShape D $Com1:2 Pr NewCommand D explode Pr E AddDriver D Attach Cyl -set Sel1 [AttachShape D Pr_5 ${Prism} ${Prism} 0]; ## set attachment +set Sel1 [AttachShape D Pr_6 ${Prism} ${Prism} 0]; ## set attachment set Cyl [AddCyl D 70 515 ${Sel1}] ComputeFun D $Cyl:1 GetShape D $Cyl:1:2 CylS diff --git a/tests/caf/named_shape/F7 b/tests/caf/named_shape/F7 index 5949f8d2b2..323e520636 100644 --- a/tests/caf/named_shape/F7 +++ b/tests/caf/named_shape/F7 @@ -82,7 +82,7 @@ GetShape D $Com1:2 Pr NewCommand D explode Pr E AddDriver D Attach Cyl -set Sel1 [AttachShape D Pr_5 ${Prism} ${Prism} 0]; ## set attachment +set Sel1 [AttachShape D Pr_6 ${Prism} ${Prism} 0]; ## set attachment set Cyl [AddCyl D 70 515 ${Sel1}] ComputeFun D $Cyl:1 GetShape D $Cyl:1:2 CylS diff --git a/tests/feat/featprism/L6 b/tests/feat/featprism/L6 index a6fdae9be7..b3aa2801a5 100644 --- a/tests/feat/featprism/L6 +++ b/tests/feat/featprism/L6 @@ -6,9 +6,6 @@ mkplane cont cont puts "*" -puts "TODO OCC22810 ALL:Error in featperform" -puts "TODO OCC22810 ALL:Error : The feat can not be build" - restore [locate_data_file CFE900_cts21gbs.rle] base restore [locate_data_file cts21322_face.rle] wire @@ -24,4 +21,4 @@ if { [catch { featperform prism result } ] != 0 } { puts "Error in featperform" } -set square 0 +set square 683.581