From 402bfe81c0cf58e141020cb0517f6a289e1feb27 Mon Sep 17 00:00:00 2001 From: pkv Date: Fri, 30 Jan 2015 14:02:21 +0300 Subject: [PATCH] 0025769: Replace BOPCol_Array1 with NCollection_Vector New features: 1. class NCollection_BaseVector method: void SetIncrement(const Standard_Integer aIncrement) has been added. The method allows to set the size of increment dynamically [ not in constructor ]. 2 class BOPCol_Array1 has been removed. Changes: 1. classes BOPDS_DS BOPDS_InterfFF BOPDS_Iterator BOPDS_VectorOfCurve BOPDS_VectorOfFaceInfo BOPDS_VectorOfIndexRange BOPDS_VectorOfInterfEE BOPDS_VectorOfInterfEF BOPDS_VectorOfInterfEZ BOPDS_VectorOfInterfFF BOPDS_VectorOfInterfFZ BOPDS_VectorOfInterfVE BOPDS_VectorOfInterfVF BOPDS_VectorOfInterfVV BOPDS_VectorOfInterfVZ BOPDS_VectorOfInterfZZ BOPDS_VectorOfListOfPassKeyBoolean BOPDS_VectorOfListOfPaveBlock BOPDS_VectorOfPoint BOPDS_VectorOfShapeInfo BOPAlgo_PaveFiller QANewModTopOpe_Tools have been modified to take into account New features: 1 and 2 2. class BOPTest_Chronometer has been modified to use the driver of the type OSD_Timer instead OSD_Chronometer --- src/BOPAlgo/BOPAlgo_PaveFiller_1.cxx | 8 +- src/BOPAlgo/BOPAlgo_PaveFiller_10.cxx | 30 +- src/BOPAlgo/BOPAlgo_PaveFiller_2.cxx | 7 +- src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx | 21 +- src/BOPAlgo/BOPAlgo_PaveFiller_4.cxx | 15 +- src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx | 23 +- src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx | 24 +- src/BOPCol/BOPCol.cdl | 9 +- src/BOPCol/BOPCol_Array1.hxx | 427 ------------------ src/BOPCol/FILES | 2 - src/BOPDS/BOPDS_DS.cxx | 91 ++-- src/BOPDS/BOPDS_Interf.hxx | 33 +- src/BOPDS/BOPDS_Iterator.cxx | 20 +- src/BOPDS/BOPDS_VectorOfCurve.hxx | 9 +- src/BOPDS/BOPDS_VectorOfFaceInfo.hxx | 8 +- src/BOPDS/BOPDS_VectorOfIndexRange.hxx | 4 +- src/BOPDS/BOPDS_VectorOfInterfEE.hxx | 6 +- src/BOPDS/BOPDS_VectorOfInterfEF.hxx | 7 +- src/BOPDS/BOPDS_VectorOfInterfEZ.hxx | 6 +- src/BOPDS/BOPDS_VectorOfInterfFF.hxx | 7 +- src/BOPDS/BOPDS_VectorOfInterfFZ.hxx | 6 +- src/BOPDS/BOPDS_VectorOfInterfVE.hxx | 6 +- src/BOPDS/BOPDS_VectorOfInterfVF.hxx | 6 +- src/BOPDS/BOPDS_VectorOfInterfVV.hxx | 6 +- src/BOPDS/BOPDS_VectorOfInterfVZ.hxx | 6 +- src/BOPDS/BOPDS_VectorOfInterfZZ.hxx | 6 +- .../BOPDS_VectorOfListOfPassKeyBoolean.hxx | 8 +- src/BOPDS/BOPDS_VectorOfListOfPaveBlock.hxx | 8 +- src/BOPDS/BOPDS_VectorOfPoint.hxx | 8 +- src/BOPDS/BOPDS_VectorOfShapeInfo.hxx | 8 +- src/BOPTest/BOPTest_Chronometer.hxx | 6 +- src/NCollection/NCollection_BaseVector.hxx | 8 + src/QANewModTopOpe/QANewModTopOpe_Tools.cxx | 5 + 33 files changed, 167 insertions(+), 677 deletions(-) delete mode 100755 src/BOPCol/BOPCol_Array1.hxx diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_1.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_1.cxx index 39a363e5e2..e918fc915a 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_1.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_1.cxx @@ -44,7 +44,7 @@ void BOPAlgo_PaveFiller::PerformVV() { Standard_Boolean bWithSubShape; - Standard_Integer n1, n2, iFlag, nX, n, aSize, i, j, iX, k, aNbBlocks; + Standard_Integer n1, n2, iFlag, nX, n, aSize, i, j, k, aNbBlocks; Handle(NCollection_IncAllocator) aAllocator; BOPCol_DataMapIteratorOfDataMapOfIntegerListOfInteger aItMILI; BOPCol_ListIteratorOfListOfInteger aItLI, aItLI2; @@ -62,9 +62,7 @@ aSIn.SetShapeType(TopAbs_VERTEX); BOPDS_VectorOfInterfVV& aVVs=myDS->InterfVV(); - aVVs.SetStartSize(aSize); aVVs.SetIncrement(aSize); - aVVs.Init(); // //-----------------------------------------------------scope f aAllocator=new NCollection_IncAllocator(); @@ -123,8 +121,8 @@ n2=aItLI2.Value(); // myDS->AddInterf(n1, n2); - iX=aVVs.Append()-1; - BOPDS_InterfVV& aVV=aVVs(iX); + BOPDS_InterfVV& aVV=aVVs.Append1(); + // aVV.SetIndices(n1, n2); aVV.SetIndexNew(n); } diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_10.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_10.cxx index 90787bfc0e..de5af544af 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_10.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_10.cxx @@ -39,7 +39,7 @@ void BOPAlgo_PaveFiller::PerformVZ() { Standard_Boolean bJustAdd; - Standard_Integer iSize, nV, nZ, i; + Standard_Integer iSize, nV, nZ; Standard_Real aTol; gp_Pnt aPV; TopAbs_State aState; @@ -53,9 +53,7 @@ void BOPAlgo_PaveFiller::PerformVZ() } // BOPDS_VectorOfInterfVZ& aVZs=myDS->InterfVZ(); - aVZs.SetStartSize(iSize); aVZs.SetIncrement(iSize); - aVZs.Init(); // for (; myIterator->More(); myIterator->Next()) { myIterator->Value(nV, nZ, bJustAdd); @@ -78,8 +76,7 @@ void BOPAlgo_PaveFiller::PerformVZ() // aState=aSC.State(); if (aState==TopAbs_IN) { - i=aVZs.Append()-1; - BOPDS_InterfVZ& aVZ=aVZs(i); + BOPDS_InterfVZ& aVZ=aVZs.Append1(); aVZ.SetIndices(nV, nZ); // myDS->AddInterf(nV, nZ); @@ -92,8 +89,8 @@ void BOPAlgo_PaveFiller::PerformVZ() //======================================================================= void BOPAlgo_PaveFiller::PerformEZ() { - Standard_Boolean bJustAdd, bHasInterf; - Standard_Integer iSize, nE, nZ, i; + Standard_Boolean bJustAdd, bHasInterf; + Standard_Integer iSize, nE, nZ; // myErrorStatus=0; // @@ -104,9 +101,7 @@ void BOPAlgo_PaveFiller::PerformEZ() } // BOPDS_VectorOfInterfEZ& aEZs=myDS->InterfEZ(); - aEZs.SetStartSize(iSize); aEZs.SetIncrement(iSize); - aEZs.Init(); // for (; myIterator->More(); myIterator->Next()) { myIterator->Value(nE, nZ, bJustAdd); @@ -124,8 +119,7 @@ void BOPAlgo_PaveFiller::PerformEZ() continue; } // - i=aEZs.Append()-1; - BOPDS_InterfEZ& aEZ=aEZs(i); + BOPDS_InterfEZ& aEZ=aEZs.Append1(); aEZ.SetIndices(nE, nZ); // myDS->AddInterf(nE, nZ); @@ -138,7 +132,7 @@ void BOPAlgo_PaveFiller::PerformEZ() void BOPAlgo_PaveFiller::PerformFZ() { Standard_Boolean bJustAdd, bHasInterf; - Standard_Integer iSize, nF, nZ, i; + Standard_Integer iSize, nF, nZ; // myErrorStatus=0; // @@ -149,9 +143,7 @@ void BOPAlgo_PaveFiller::PerformFZ() } // BOPDS_VectorOfInterfFZ& aFZs=myDS->InterfFZ(); - aFZs.SetStartSize(iSize); aFZs.SetIncrement(iSize); - aFZs.Init(); // for (; myIterator->More(); myIterator->Next()) { myIterator->Value(nF, nZ, bJustAdd); @@ -169,8 +161,7 @@ void BOPAlgo_PaveFiller::PerformFZ() continue; } // - i=aFZs.Append()-1; - BOPDS_InterfFZ& aFZ=aFZs(i); + BOPDS_InterfFZ& aFZ=aFZs.Append1(); aFZ.SetIndices(nF, nZ); // myDS->AddInterf(nF, nZ); @@ -183,7 +174,7 @@ void BOPAlgo_PaveFiller::PerformFZ() void BOPAlgo_PaveFiller::PerformZZ() { Standard_Boolean bJustAdd, bHasInterf, bFlag; - Standard_Integer iSize, nZ1, nZ, i; + Standard_Integer iSize, nZ1, nZ; // myErrorStatus=0; // @@ -194,9 +185,7 @@ void BOPAlgo_PaveFiller::PerformZZ() } // BOPDS_VectorOfInterfZZ& aZZs=myDS->InterfZZ(); - aZZs.SetStartSize(iSize); aZZs.SetIncrement(iSize); - aZZs.Init(); // bFlag=Standard_False; // @@ -214,8 +203,7 @@ void BOPAlgo_PaveFiller::PerformZZ() continue; } // - i=aZZs.Append()-1; - BOPDS_InterfZZ& aZZ=aZZs(i); + BOPDS_InterfZZ& aZZ=aZZs.Append1(); aZZ.SetIndices(nZ1, nZ); // myDS->AddInterf(nZ1, nZ); diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_2.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_2.cxx index 51c3ace97c..c0584d1964 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_2.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_2.cxx @@ -136,7 +136,7 @@ typedef BOPCol_TBBContextCnt void BOPAlgo_PaveFiller::PerformVE() { Standard_Boolean bJustAdd; - Standard_Integer iSize, nV, nE, nVSD, iFlag, nVx, i, k, aNbVE;; + Standard_Integer iSize, nV, nE, nVSD, iFlag, nVx, k, aNbVE; Standard_Real aT, aTolE, aTolV; BOPDS_Pave aPave; BOPDS_PassKey aPK; @@ -153,9 +153,7 @@ void BOPAlgo_PaveFiller::PerformVE() } // BOPDS_VectorOfInterfVE& aVEs=myDS->InterfVE(); - aVEs.SetStartSize(iSize); aVEs.SetIncrement(iSize); - aVEs.Init(); // for (; myIterator->More(); myIterator->Next()) { myIterator->Value(nV, nE, bJustAdd); @@ -213,8 +211,7 @@ void BOPAlgo_PaveFiller::PerformVE() const TopoDS_Vertex& aV=aVESolver.Vertex(); const TopoDS_Edge& aE=aVESolver.Edge(); // 1 - i=aVEs.Append()-1; - BOPDS_InterfVE& aVE=aVEs(i); + BOPDS_InterfVE& aVE=aVEs.Append1(); aVE.SetIndices(nV, nE); aVE.SetParameter(aT); // 2 diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx index d45b9367e8..c20af59375 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx @@ -298,9 +298,7 @@ void BOPAlgo_PaveFiller::PerformEE() BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks aMVCPB(100, aAllocator); // BOPDS_VectorOfInterfEE& aEEs=myDS->InterfEE(); - aEEs.SetStartSize(iSize); aEEs.SetIncrement(iSize); - aEEs.Init(); // for (; myIterator->More(); myIterator->Next()) { myIterator->Value(nE1, nE2, bJustAdd); @@ -489,10 +487,10 @@ void BOPAlgo_PaveFiller::PerformEE() continue; } } - + // // 1 - iX=aEEs.Append()-1; - BOPDS_InterfEE& aEE=aEEs(iX); + BOPDS_InterfEE& aEE=aEEs.Append1(); + iX=aEEs.Extent()-1; aEE.SetIndices(nE1, nE2); aEE.SetCommonPart(aCPart); // 2 @@ -517,8 +515,8 @@ void BOPAlgo_PaveFiller::PerformEE() break; } // 1 - iX=aEEs.Append()-1; - BOPDS_InterfEE& aEE=aEEs(iX); + BOPDS_InterfEE& aEE=aEEs.Append1(); + iX=aEEs.Extent()-1; aEE.SetIndices(nE1, nE2); aEE.SetCommonPart(aCPart); // 2 @@ -911,7 +909,7 @@ void BOPAlgo_PaveFiller::ForceInterfVE(const Standard_Integer nV, aNbPnt = aProjector.NbPoints(); if (aNbPnt) { Standard_Real aT, aDist; - Standard_Integer i; + //Standard_Integer i; BRep_Builder aBB; BOPDS_Pave aPave; // @@ -919,12 +917,7 @@ void BOPAlgo_PaveFiller::ForceInterfVE(const Standard_Integer nV, aT=aProjector.LowerDistanceParameter(); // BOPDS_VectorOfInterfVE& aVEs=myDS->InterfVE(); - if (aVEs.Extent() == 0) { - aVEs.Init(); - } - // - i=aVEs.Append()-1; - BOPDS_InterfVE& aVE=aVEs(i); + BOPDS_InterfVE& aVE=aVEs.Append1(); aVE.SetIndices(nV, nE); aVE.SetParameter(aT); // diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_4.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_4.cxx index 0cb860bfcc..5b92b5eb1c 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_4.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_4.cxx @@ -143,7 +143,7 @@ typedef BOPCol_TBBContextCnt void BOPAlgo_PaveFiller::PerformVF() { Standard_Boolean bJustAdd; - Standard_Integer iSize, nV, nF, nVSD, iFlag, nVx, i, aNbVF, k; + Standard_Integer iSize, nV, nF, nVSD, iFlag, nVx, aNbVF, k; Standard_Real aT1, aT2, aTolF, aTolV; BRep_Builder aBB; BOPAlgo_VectorOfVertexFace aVVF; @@ -155,9 +155,7 @@ void BOPAlgo_PaveFiller::PerformVF() if (iSize) { // BOPDS_VectorOfInterfVF& aVFs=myDS->InterfVF(); - aVFs.SetStartSize(iSize); aVFs.SetIncrement(iSize); - aVFs.Init(); // for (; myIterator->More(); myIterator->Next()) { myIterator->Value(nV, nF, bJustAdd); @@ -214,8 +212,7 @@ void BOPAlgo_PaveFiller::PerformVF() const TopoDS_Vertex& aV=aVertexFace.Vertex(); const TopoDS_Face& aF=aVertexFace.Face(); // 1 - i=aVFs.Append()-1; - BOPDS_InterfVF& aVF=aVFs(i); + BOPDS_InterfVF& aVF=aVFs.Append1(); aVF.SetIndices(nVx, nF); aVF.SetUV(aT1, aT2); // 2 @@ -238,9 +235,7 @@ void BOPAlgo_PaveFiller::PerformVF() else { iSize=10; BOPDS_VectorOfInterfVF& aVFs=myDS->InterfVF(); - aVFs.SetStartSize(iSize); aVFs.SetIncrement(iSize); - aVFs.Init(); } // TreatVerticesEE(); @@ -251,7 +246,7 @@ void BOPAlgo_PaveFiller::PerformVF() //======================================================================= void BOPAlgo_PaveFiller::TreatVerticesEE() { - Standard_Integer i, aNbS, aNbEEs, nF, nV, iFlag; + Standard_Integer i, aNbS,aNbEEs, nF, nV, iFlag; Standard_Real aT1, aT2; BOPCol_ListIteratorOfListOfInteger aItLI; Handle(NCollection_IncAllocator) aAllocator; @@ -315,8 +310,8 @@ void BOPAlgo_PaveFiller::TreatVerticesEE() iFlag=myContext->ComputeVF(aV, aF, aT1, aT2); if (!iFlag) { // 1 - i=aVFs.Append()-1; - BOPDS_InterfVF& aVF=aVFs(i); + BOPDS_InterfVF& aVF=aVFs.Append1(); + i=aVFs.Extent()-1; aVF.SetIndices(nV, nF); aVF.SetUV(aT1, aT2); // 2 diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx index 9b1b3207a8..b3f45d36ef 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx @@ -169,9 +169,7 @@ void BOPAlgo_PaveFiller::PerformEF() aDeflection=0.01; // BOPDS_VectorOfInterfEF& aEFs=myDS->InterfEF(); - aEFs.SetStartSize(iSize); aEFs.SetIncrement(iSize); - aEFs.Init(); // for (; myIterator->More(); myIterator->Next()) { myIterator->Value(nE, nF, bJustAdd); @@ -297,10 +295,10 @@ void BOPAlgo_PaveFiller::PerformEF() bV[0]=CheckFacePaves(nV[0], aMIFOn, aMIFIn); bV[1]=CheckFacePaves(nV[1], aMIFOn, aMIFIn); if (bV[0] && bV[1]) { - iX=aEFs.Append()-1; IntTools_CommonPrt aCP = aCPart; aCP.SetType(TopAbs_EDGE); - BOPDS_InterfEF& aEF=aEFs(iX); + BOPDS_InterfEF& aEF=aEFs.Append1(); + iX=aEFs.Extent()-1; aEF.SetIndices(nE, nF); aEF.SetCommonPart(aCP); myDS->AddInterf(nE, nF); @@ -344,8 +342,8 @@ void BOPAlgo_PaveFiller::PerformEF() // aMIEFC.Add(nF); // 1 - iX=aEFs.Append()-1; - BOPDS_InterfEF& aEF=aEFs(iX); + BOPDS_InterfEF& aEF=aEFs.Append1(); + iX=aEFs.Extent()-1; aEF.SetIndices(nE, nF); aEF.SetCommonPart(aCPart); // 2 @@ -363,8 +361,8 @@ void BOPAlgo_PaveFiller::PerformEF() aMIEFC.Add(nF); // // 1 - iX=aEFs.Append()-1; - BOPDS_InterfEF& aEF=aEFs(iX); + BOPDS_InterfEF& aEF=aEFs.Append1(); + iX=aEFs.Extent()-1; aEF.SetIndices(nE, nF); // bV[0]=CheckFacePaves(nV[0], aMIFOn, aMIFIn); @@ -637,16 +635,11 @@ Standard_Boolean BOPAlgo_PaveFiller::ForceInterfVF gp_Pnt2d aP2d(U, V); bRet = myContext->IsPointInFace (aF, aP2d); if (bRet) { - Standard_Integer i; + //Standard_Integer i; BRep_Builder aBB; // BOPDS_VectorOfInterfVF& aVFs=myDS->InterfVF(); - if (aVFs.Extent() == 0) { - aVFs.Init(); - } - // - i=aVFs.Append()-1; - BOPDS_InterfVF& aVF=aVFs(i); + BOPDS_InterfVF& aVF=aVFs.Append1(); aVF.SetIndices(nV, nF); aVF.SetUV(U, V); // diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx index 90f4aa3941..4e1c129fbd 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx @@ -195,7 +195,7 @@ void BOPAlgo_PaveFiller::PerformFF() // Standard_Boolean bJustAdd, bApp, bCompC2D1, bCompC2D2, bIsDone; Standard_Boolean bToSplit, bTangentFaces; - Standard_Integer nF1, nF2, aNbCurves, aNbPoints, iX, i, iP, iC, aNbLP; + Standard_Integer nF1, nF2, aNbCurves, aNbPoints, i, aNbLP; Standard_Integer aNbFaceFace, k; Standard_Real aApproxTol, aTolR3D, aTolR2D, aTolFF; BRepAdaptor_Surface aBAS1, aBAS2; @@ -203,9 +203,7 @@ void BOPAlgo_PaveFiller::PerformFF() BOPAlgo_VectorOfFaceFace aVFaceFace; // BOPDS_VectorOfInterfFF& aFFs=myDS->InterfFF(); - aFFs.SetStartSize(iSize); aFFs.SetIncrement(iSize); - aFFs.Init(); // bApp=mySectionAttribute.Approximation(); bCompC2D1=mySectionAttribute.PCurveOnS1(); @@ -241,8 +239,7 @@ void BOPAlgo_PaveFiller::PerformFF() bToIntersect = CheckPlanes(nF1, nF2); if (!bToIntersect) { myDS->AddInterf(nF1, nF2); - iX=aFFs.Append()-1; - BOPDS_InterfFF& aFF=aFFs(iX); + BOPDS_InterfFF& aFF=aFFs.Append1(); aFF.SetIndices(nF1, nF2); aFF.Init(0, 0); continue; @@ -304,8 +301,7 @@ void BOPAlgo_PaveFiller::PerformFF() myDS->AddInterf(nF1, nF2); } // - iX=aFFs.Append()-1; - BOPDS_InterfFF& aFF=aFFs(iX); + BOPDS_InterfFF& aFF=aFFs.Append1(); aFF.SetIndices(nF1, nF2); // aFF.SetTolR3D(aTolR3D); @@ -324,8 +320,7 @@ void BOPAlgo_PaveFiller::PerformFF() const Handle(Geom_Curve)& aC3D= aIC.Curve(); bValid=IntTools_Tools::CheckCurve(aC3D, aTolR3D, aBox); if (bValid) { - iC=aVNC.Append()-1; - BOPDS_Curve& aNC=aVNC(iC); + BOPDS_Curve& aNC=aVNC.Append1(); aNC.SetCurve(aIC); aNC.SetBox(aBox); } @@ -337,15 +332,13 @@ void BOPAlgo_PaveFiller::PerformFF() const IntTools_PntOn2Faces& aPi=aPntsX(i); const gp_Pnt& aP=aPi.P1().Pnt(); // - iP=aVNP.Append()-1; - BOPDS_Point& aNP=aVNP(iP); + BOPDS_Point& aNP=aVNP.Append1(); aNP.SetPnt(aP); } //}// if (aNbCs || aNbPs) }// if (bIsDone) { else {// 904/L1 - iX=aFFs.Append()-1; - BOPDS_InterfFF& aFF=aFFs(iX); + BOPDS_InterfFF& aFF=aFFs.Append1(); aFF.SetIndices(nF1, nF2); aNbCurves=0; aNbPoints=0; @@ -2050,9 +2043,10 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC, BOPCol_DataMapOfShapeInteger& aMVI, BOPDS_VectorOfCurve& aVC) { - Standard_Integer nV1, nV2; + Standard_Integer nV1, nV2, iC; // - Standard_Integer iC=aVC.Append()-1; + aVC.Append1(); + iC=aVC.Extent()-1; BOPDS_ListOfPaveBlock& aLPBC = aVC(iC).ChangePaveBlocks(); aLPBC.Append(aPB); // diff --git a/src/BOPCol/BOPCol.cdl b/src/BOPCol/BOPCol.cdl index 0204c52454..05654dc891 100644 --- a/src/BOPCol/BOPCol.cdl +++ b/src/BOPCol/BOPCol.cdl @@ -14,10 +14,10 @@ package BOPCol - ---Purpose: - -- The package contains collection classes - -- that are used by - -- partition and boolean operation algorithms + ---Purpose: + -- The package contains collection classes + -- that are used by + -- partition and boolean operation algorithms uses TCollection @@ -37,7 +37,6 @@ is imported DataMapOfShapeAddress from BOPCol; imported DataMapOfTransientAddress from BOPCol; imported PListOfInteger from BOPCol; - imported VectorOfInteger from BOPCol; imported MapOfShape from BOPCol; imported DataMapOfShapeShape from BOPCol; imported DataMapOfShapeListOfShape from BOPCol; diff --git a/src/BOPCol/BOPCol_Array1.hxx b/src/BOPCol/BOPCol_Array1.hxx deleted file mode 100755 index 1fea94da33..0000000000 --- a/src/BOPCol/BOPCol_Array1.hxx +++ /dev/null @@ -1,427 +0,0 @@ -// Created by: Peter KURNEV -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef BOPCol_Array1_HeaderFile -#define BOPCol_Array1_HeaderFile - -#include -#include -#include - -/** -* Class BOPCol_Array1 (dynamic array of objects) -* -* 1. The Array1 uses the allocator (in terms of NCollection_BaseAllocator) -* to allocate the memory. -* 2. The memory is allocated as a list of memory blocks. The size of the first -* block is myStartSize. The size of the other blocks is myIncrement -* 3 The Array1 is created with 0 length. -* 4. The Array1 must be initiated by invoke the method Init(). -* Init() allocates the memory block for initial myStartSize elements. -* 5. The elements can be added by the method Append(theElement). the method -* Append(theElement) arranges theElement in -* a) previously allocated memory block (if it is possible) -* b) new allocated memory block (otherwise). The size of new blocks to -* allocate can be set [once only] by the method SetIncrement(theSize). -* 6. The contents of the element with index "i" can be queried or modified -* by the methods -* SetValue(i, theElement), Value(i), ChangeValue(i), operator()(i) -*/ - -//======================================================================= -//class : MemBlock -// -//======================================================================= -template class BOPCol_MemBlock { - - public: - // Ctor - BOPCol_MemBlock(const Handle(NCollection_BaseAllocator)& theAllocator) { - myI1=0; - myI2=0; - mySize=0; - myData=NULL; - myAllocator=theAllocator; - myNext=NULL; - } - // ~ - ~BOPCol_MemBlock(){ - Clear(); - } - // Clear - void Clear() { - if (myData) { - //Standard_Integer i; - Standard_Size i; - // - for (i=0; iFree(myData); - // - myData=NULL; - mySize=0; - myNext=NULL; - } - } - // Allocate - void Allocate(const Standard_Size theSize) { - //Standard_Integer i; - Standard_Size i; - // - Clear(); - mySize=theSize; - myData=(Type*)myAllocator->Allocate(theSize*sizeof(Type)); - for (i=0; i=myI1 && theIndex<=myI2); - } - // SetValue - void SetValue(const Standard_Integer theIndex, - const Type& theValue) { - *(myData+theIndex-myI1)=theValue; - } - // Value - const Type& Value(const Standard_Integer theIndex)const { - return *(myData+theIndex-myI1); - } - // ChangeValue - Type& ChangeValue(const Standard_Integer theIndex) { - return *(myData+theIndex-myI1); - } - // SetNext - void SetNext(BOPCol_MemBlock* pNext) { - myNext=pNext; - } - // Next - BOPCol_MemBlock* Next() { - return myNext; - } - // - public: - BOPCol_MemBlock* myNext; - protected: - Standard_Integer myI1; - Standard_Integer myI2; - Standard_Size mySize; - Type *myData; - Handle(NCollection_BaseAllocator) myAllocator; -}; - -//======================================================================= -//class : BOPCol_Array1 -// -//======================================================================= -template class BOPCol_Array1 { - - public: - typedef BOPCol_MemBlock* BOPCol_PMemBlock; - typedef BOPCol_MemBlock BOPCol_XMemBlock; - //========= - // Ctor - BOPCol_Array1(const Handle(NCollection_BaseAllocator)& theAllocator=0L) { - myStartSize=32; - myIncrement=8; - myExtent=0; - myPBlock=NULL; - myPBlock1=NULL; - // - if (theAllocator.IsNull()) { - myAllocator = NCollection_BaseAllocator::CommonBaseAllocator(); - } - else { - myAllocator=theAllocator; - } - } - // ~ - ~BOPCol_Array1() { - Clear(); - } - //=========== - // Clear - void Clear() { - BOPCol_PMemBlock pBlock, pNext; - // - pBlock=myPBlock1; - while(pBlock) { - pNext=pBlock->Next(); - // - pBlock->~BOPCol_XMemBlock(); - myAllocator->Free(pBlock); - // - pBlock=pNext; - } - myPBlock1=NULL; - myPBlock=NULL; - myExtent=0; - } - // SetStartSize - void SetStartSize(const Standard_Integer theSize) { - if (theSize>0) { - myStartSize=theSize; - } - } - // SetIncrement - void SetIncrement(const Standard_Integer theSize){ - if (theSize>0) { - myIncrement=theSize; - } - } - // Increment - Standard_Integer Increment()const { - return myIncrement; - } - // Extent - Standard_Integer Extent()const { - return myExtent; - } - // Size - Standard_Integer Size()const { - return myExtent; - } - // Size - Standard_Integer Length()const { - return myExtent; - } - // Init - void Init(); - // Append(const Type& theValue) - Standard_Integer Append(const Type& theValue); - // Append() - Standard_Integer Append(); - // SetValue - void SetValue(const Standard_Integer theIndex, - const Type& theValue); - // Value - const Type& operator()(const Standard_Integer theIndex)const; - // - const Type& Value(const Standard_Integer theIndex)const; - // ChangeValue - Type& operator()(const Standard_Integer theIndex); - // - Type& ChangeValue(const Standard_Integer theIndex); - // - // protected - protected: - //=========== - //FindBlock - Standard_Boolean FindBlock(const Standard_Integer theIndex)const ; - //Copy ctor - BOPCol_Array1(const BOPCol_Array1&); - //Assign operator - BOPCol_Array1& operator =(const BOPCol_Array1& theOther); - //========== - // fields - protected: - Standard_Integer myStartSize; - Standard_Integer myIncrement; - Standard_Integer myExtent; - Type myDfltItem; - BOPCol_MemBlock * myPBlock; - BOPCol_MemBlock * myPBlock1; - Handle(NCollection_BaseAllocator) myAllocator; -}; -// -//======================================================================= -//function : Init -//purpose : -//======================================================================= -template - void BOPCol_Array1::Init() { - BOPCol_PMemBlock pBlock; - // - pBlock=(BOPCol_PMemBlock)myAllocator->Allocate(sizeof(BOPCol_MemBlock)); - new (pBlock) BOPCol_MemBlock(myAllocator); - // - pBlock->Allocate(myStartSize); - pBlock->SetRange(0, myStartSize-1); - myPBlock1=pBlock; - myPBlock=pBlock; - } -//======================================================================= -//function : Append -//purpose : -//======================================================================= -template - Standard_Integer BOPCol_Array1::Append(const Type& theValue) { - BOPCol_PMemBlock pBlock, pNext; - // - pBlock=myPBlock1; - for(;;) { - pNext=pBlock->myNext; - if(!pNext) { - myPBlock=pBlock; - break; - } - pBlock=pNext; - } - // - if (!myPBlock->Contains(myExtent)) { - // - pBlock=(BOPCol_PMemBlock)myAllocator->Allocate(sizeof(BOPCol_MemBlock)); - new (pBlock) BOPCol_MemBlock(myAllocator); - // - pBlock->Allocate(myIncrement); - pBlock->SetRange(myExtent, myExtent+myIncrement-1); - // - myPBlock->myNext=pBlock; - // - myPBlock=pBlock; - } - // - myPBlock->SetValue(myExtent, theValue); - // - ++myExtent; - // - return myExtent; - } -//======================================================================= -//function : Append -//purpose : -//======================================================================= -template - Standard_Integer BOPCol_Array1::Append() { - BOPCol_PMemBlock pBlock, pNext; - // - pBlock=myPBlock1; - for(;;) { - pNext=pBlock->myNext; - if(!pNext) { - myPBlock=pBlock; - break; - } - pBlock=pNext; - } - // - if (!myPBlock->Contains(myExtent)) { - // - pBlock=(BOPCol_PMemBlock)myAllocator->Allocate(sizeof(BOPCol_MemBlock)); - new (pBlock) BOPCol_MemBlock(myAllocator); - // - pBlock->Allocate(myIncrement); - pBlock->SetRange(myExtent, myExtent+myIncrement-1); - // - myPBlock->myNext=pBlock; - // - myPBlock=pBlock; - } - ++myExtent; - // - return myExtent; - } -//======================================================================= -//function : SetValue -//purpose : -//======================================================================= -template - void BOPCol_Array1::SetValue(const Standard_Integer theIndex, - const Type& theValue) { - if (FindBlock(theIndex)) { - myPBlock->SetValue(theIndex, theValue); - } - } -//======================================================================= -//function : operator() -//purpose : -//======================================================================= -template - const Type& BOPCol_Array1::operator()(const Standard_Integer theIndex)const { - if (FindBlock(theIndex)) { - return myPBlock->Value(theIndex); - } - return myDfltItem; - } -//======================================================================= -//function : Value -//purpose : -//======================================================================= -template - const Type& BOPCol_Array1::Value(const Standard_Integer theIndex)const { - return operator()(theIndex); - } -//======================================================================= -//function : operator -//purpose : -//======================================================================= -template - Type& BOPCol_Array1::operator()(const Standard_Integer theIndex) { - if (FindBlock(theIndex)) { - return myPBlock->ChangeValue(theIndex); - } - return myDfltItem; - } -//======================================================================= -//function : ChangeValue -//purpose : -//======================================================================= -template - Type& BOPCol_Array1::ChangeValue(const Standard_Integer theIndex) { - return operator()(theIndex); - } -//======================================================================= -//function : FindBlock -//purpose : -//======================================================================= -template - Standard_Boolean BOPCol_Array1::FindBlock(const Standard_Integer theIndex)const { - Standard_Boolean bRet; - // - bRet=myPBlock->Contains(theIndex); - if(bRet) { - return bRet; - } - // - Standard_Integer i1, i2; - BOPCol_PMemBlock pBlock, *xPBlock; - // - xPBlock=(BOPCol_PMemBlock*)&myPBlock; - pBlock=myPBlock1; - // - i1=0; - i2=myStartSize-1; - do { - if (theIndex>=i1 && theIndex<=i2) { - *xPBlock=pBlock; - return !bRet; - } - // - i1=i2+1; - i2=i1+myIncrement-1; - pBlock=pBlock->myNext; - } while(pBlock); - // - return bRet; - } - -#endif diff --git a/src/BOPCol/FILES b/src/BOPCol/FILES index fde2995766..412ba9952d 100644 --- a/src/BOPCol/FILES +++ b/src/BOPCol/FILES @@ -1,4 +1,3 @@ -BOPCol_Array1.hxx BOPCol_DataMapOfShapeInteger.hxx BOPCol_DataMapOfShapeReal.hxx BOPCol_MapOfInteger.hxx @@ -14,7 +13,6 @@ BOPCol_ListOfShape.hxx BOPCol_DataMapOfShapeAddress.hxx BOPCol_DataMapOfTransientAddress.hxx BOPCol_PListOfInteger.hxx -BOPCol_VectorOfInteger.hxx BOPCol_MapOfShape.hxx BOPCol_DataMapOfShapeShape.hxx BOPCol_DataMapOfShapeListOfShape.hxx diff --git a/src/BOPDS/BOPDS_DS.cxx b/src/BOPDS/BOPDS_DS.cxx index c0df289fbe..f4e133a7cc 100644 --- a/src/BOPDS/BOPDS_DS.cxx +++ b/src/BOPDS/BOPDS_DS.cxx @@ -91,24 +91,24 @@ BOPDS_DS::BOPDS_DS() : myAllocator(NCollection_BaseAllocator::CommonBaseAllocator()), myArguments(myAllocator), - myRanges(myAllocator), - myLines(myAllocator), + myRanges(0,myAllocator), + myLines(0, myAllocator), myMapShapeIndex(100, myAllocator), - myPaveBlocksPool(myAllocator), + myPaveBlocksPool(0,myAllocator), myMapPBCB(100, myAllocator), - myFaceInfoPool(myAllocator), + myFaceInfoPool(0, myAllocator), myShapesSD(100, myAllocator), myInterfTB(100, myAllocator), - myInterfVV(myAllocator), - myInterfVE(myAllocator), - myInterfVF(myAllocator), - myInterfEE(myAllocator), - myInterfEF(myAllocator), - myInterfFF(myAllocator), - myInterfVZ(myAllocator), - myInterfEZ(myAllocator), - myInterfFZ(myAllocator), - myInterfZZ(myAllocator), + myInterfVV(0, myAllocator), + myInterfVE(0, myAllocator), + myInterfVF(0, myAllocator), + myInterfEE(0, myAllocator), + myInterfEF(0, myAllocator), + myInterfFF(0, myAllocator), + myInterfVZ(0, myAllocator), + myInterfEZ(0, myAllocator), + myInterfFZ(0, myAllocator), + myInterfZZ(0, myAllocator), myFuzzyValue(0.), myToleranceMap(100, myAllocator) { @@ -123,24 +123,24 @@ BOPDS_DS::BOPDS_DS(const Handle(NCollection_BaseAllocator)& theAllocator) : myAllocator(theAllocator), myArguments(myAllocator), - myRanges(myAllocator), - myLines(myAllocator), + myRanges(0, myAllocator), + myLines(0, myAllocator), myMapShapeIndex(100, myAllocator), - myPaveBlocksPool(myAllocator), + myPaveBlocksPool(0, myAllocator), myMapPBCB(100, myAllocator), - myFaceInfoPool(myAllocator), + myFaceInfoPool(0, myAllocator), myShapesSD(100, myAllocator), myInterfTB(100, myAllocator), - myInterfVV(myAllocator), - myInterfVE(myAllocator), - myInterfVF(myAllocator), - myInterfEE(myAllocator), - myInterfEF(myAllocator), - myInterfFF(myAllocator), - myInterfVZ(myAllocator), - myInterfEZ(myAllocator), - myInterfFZ(myAllocator), - myInterfZZ(myAllocator), + myInterfVV(0, myAllocator), + myInterfVE(0, myAllocator), + myInterfVF(0, myAllocator), + myInterfEE(0, myAllocator), + myInterfEF(0, myAllocator), + myInterfFF(0, myAllocator), + myInterfVZ(0, myAllocator), + myInterfEZ(0, myAllocator), + myInterfFZ(0, myAllocator), + myInterfZZ(0, myAllocator), myFuzzyValue(0.), myToleranceMap(100, myAllocator) { @@ -277,8 +277,9 @@ Standard_Integer BOPDS_DS::Append(const BOPDS_ShapeInfo& theSI) { Standard_Integer iX; // - iX=myLines.Append()-1; - myLines(iX)=theSI; + myLines.Append1()=theSI; + iX=myLines.Extent()-1; + // return iX; } //======================================================================= @@ -289,8 +290,8 @@ Standard_Integer BOPDS_DS::Append(const TopoDS_Shape& theS) { Standard_Integer iX; // - iX=myLines.Append()-1; - myLines(iX).SetShape(theS); + myLines.Append1().SetShape(theS); + iX=myLines.Extent()-1; return iX; } //======================================================================= @@ -320,6 +321,7 @@ BOPDS_ShapeInfo& BOPDS_DS::ChangeShapeInfo(const Standard_Integer theI) //======================================================================= const TopoDS_Shape& BOPDS_DS::Shape(const Standard_Integer theI)const { + const TopoDS_Shape& aS=ShapeInfo(theI).Shape(); return aS; } @@ -360,8 +362,7 @@ void BOPDS_DS::Init() return; } // - myRanges.SetStartSize(aNb); - myRanges.Init(); + myRanges.SetIncrement(aNb); // aIt.Initialize(myArguments); for (; aIt.More(); aIt.Next()) { @@ -379,10 +380,7 @@ void BOPDS_DS::Init() aNbS=aNbS+aNbSx; } // - myLines.SetStartSize(2*aNbS); - myLines.SetIncrement(aNbS); - myLines.Init(); - // + myLines.SetIncrement(2*aNbS); //-----------------------------------------------------scope_1 f aAllocator=new NCollection_IncAllocator(); // @@ -651,17 +649,10 @@ void BOPDS_DS::Init() aMI.Clear(); aAllocator.Nullify(); //-----------------------------------------------------scope_1 t - // // 3 myPaveBlocksPool - myPaveBlocksPool.SetStartSize(aNbE); - myPaveBlocksPool.SetIncrement(aNbE); - myPaveBlocksPool.Init(); - // // 4. myFaceInfoPool - myFaceInfoPool.SetStartSize(aNbF); + myPaveBlocksPool.SetIncrement(aNbE); myFaceInfoPool.SetIncrement(aNbF); - myFaceInfoPool.Init(); - // } //======================================================================= //function : InitShape @@ -934,8 +925,8 @@ void BOPDS_DS::InitPaveBlocks(const Standard_Integer theI) } } // - iRef = myPaveBlocksPool.Append() - 1; - BOPDS_ListOfPaveBlock &aLPB=myPaveBlocksPool(iRef); + BOPDS_ListOfPaveBlock &aLPB=myPaveBlocksPool.Append1(); + iRef=myPaveBlocksPool.Extent()-1; // aPB->Update(aLPB, Standard_False); aSI.SetReference(iRef); @@ -1265,8 +1256,8 @@ void BOPDS_DS::InitFaceInfo(const Standard_Integer theI) Standard_Integer iRef; // BOPDS_ShapeInfo& aSI=ChangeShapeInfo(theI); - iRef=myFaceInfoPool.Append()-1; - BOPDS_FaceInfo &aFI=myFaceInfoPool(iRef); + BOPDS_FaceInfo &aFI=myFaceInfoPool.Append1(); + iRef=myFaceInfoPool.Extent()-1; aSI.SetReference(iRef); // aFI.SetIndex(theI); diff --git a/src/BOPDS/BOPDS_Interf.hxx b/src/BOPDS/BOPDS_Interf.hxx index 1ad97975d8..5fc69d3c74 100644 --- a/src/BOPDS/BOPDS_Interf.hxx +++ b/src/BOPDS/BOPDS_Interf.hxx @@ -496,27 +496,11 @@ class BOPDS_InterfFF : public BOPDS_Interf { myTangentFaces(Standard_False), myTolR3D(1.e-7), myTolR2D(1.e-7), - myCurves(myAllocator), - myPoints(myAllocator) { + myCurves(0, myAllocator), + myPoints(0, myAllocator) + { } // - /** - * Constructor - * @param theAllocator - * allocator to manage the memory - */ - /* - BOPDS_InterfFF(const Handle(NCollection_BaseAllocator)& theAllocator) - : - BOPDS_Interf(theAllocator), - myTangentFaces(Standard_False), - myTolR3D(1.e-7), - myTolR2D(1.e-7), - myCurves(myAllocator), - myPoints(myAllocator) { - } - */ - // /** * Destructor */ @@ -530,8 +514,17 @@ class BOPDS_InterfFF : public BOPDS_Interf { * @param theNbPoints * number of intersection points */ + void Init(const Standard_Integer theNbCurves, const Standard_Integer theNbPoints) { + //modified by NIZNHY-PKV Mon Jan 26 09:01:06 2015f + if (theNbCurves>0) { + myCurves.SetIncrement(theNbCurves); + } + if (theNbPoints>0) { + myPoints.SetIncrement(theNbPoints); + } + /* if (theNbCurves>0) { myCurves.SetStartSize(theNbCurves); myCurves.SetIncrement(theNbCurves); @@ -542,6 +535,8 @@ class BOPDS_InterfFF : public BOPDS_Interf { myPoints.SetIncrement(theNbPoints); myPoints.Init(); } + */ + //modified by NIZNHY-PKV Mon Jan 26 09:01:12 2015t } /** * Modifier diff --git a/src/BOPDS/BOPDS_Iterator.cxx b/src/BOPDS/BOPDS_Iterator.cxx index 5b240f9e11..29237d34e8 100644 --- a/src/BOPDS/BOPDS_Iterator.cxx +++ b/src/BOPDS/BOPDS_Iterator.cxx @@ -84,11 +84,16 @@ BOPDS_Iterator::BOPDS_Iterator() myAllocator(NCollection_BaseAllocator::CommonBaseAllocator()), myRunParallel(Standard_False) { + Standard_Integer i, aNb; + // myDS=NULL; myLength=0; // - myLists.SetStartSize(BOPDS_DS::NbInterfTypes()); - myLists.Init(); + aNb=BOPDS_DS::NbInterfTypes(); + myLists.SetIncrement(aNb); + for (i=0; i +#include #include -#define BOPCol_Array1_Use_Allocator - -typedef BOPCol_Array1 BOPDS_VectorOfCurve; - -#undef BOPCol_Array1_Use_Allocator - +typedef BOPCol_NCVector BOPDS_VectorOfCurve; #endif diff --git a/src/BOPDS/BOPDS_VectorOfFaceInfo.hxx b/src/BOPDS/BOPDS_VectorOfFaceInfo.hxx index 1b09deb1e1..a7f49dd500 100644 --- a/src/BOPDS/BOPDS_VectorOfFaceInfo.hxx +++ b/src/BOPDS/BOPDS_VectorOfFaceInfo.hxx @@ -15,13 +15,9 @@ #ifndef BOPDS_VectorOfFaceInfo_HeaderFile #define BOPDS_VectorOfFaceInfo_HeaderFile -#include +#include #include -#define BOPCol_Array1_Use_Allocator - -typedef BOPCol_Array1 BOPDS_VectorOfFaceInfo; - -#undef BOPCol_Array1_Use_Allocator +typedef BOPCol_NCVector BOPDS_VectorOfFaceInfo; #endif diff --git a/src/BOPDS/BOPDS_VectorOfIndexRange.hxx b/src/BOPDS/BOPDS_VectorOfIndexRange.hxx index 23e694a9a3..4dcfc40063 100644 --- a/src/BOPDS/BOPDS_VectorOfIndexRange.hxx +++ b/src/BOPDS/BOPDS_VectorOfIndexRange.hxx @@ -15,9 +15,9 @@ #ifndef BOPDS_VectorOfIndexRange_HeaderFile #define BOPDS_VectorOfIndexRange_HeaderFile -#include +#include #include -typedef BOPCol_Array1 BOPDS_VectorOfIndexRange; +typedef BOPCol_NCVector BOPDS_VectorOfIndexRange; #endif diff --git a/src/BOPDS/BOPDS_VectorOfInterfEE.hxx b/src/BOPDS/BOPDS_VectorOfInterfEE.hxx index 4bb181b6a6..16237b7820 100644 --- a/src/BOPDS/BOPDS_VectorOfInterfEE.hxx +++ b/src/BOPDS/BOPDS_VectorOfInterfEE.hxx @@ -15,11 +15,9 @@ #ifndef BOPDS_VectorOfInterfEE_HeaderFile #define BOPDS_VectorOfInterfEE_HeaderFile -#include +#include #include -#define BOPCol_Array1_Use_Allocator -typedef BOPCol_Array1 BOPDS_VectorOfInterfEE; -#undef BOPCol_Array1_Use_Allocator +typedef BOPCol_NCVector BOPDS_VectorOfInterfEE; #endif diff --git a/src/BOPDS/BOPDS_VectorOfInterfEF.hxx b/src/BOPDS/BOPDS_VectorOfInterfEF.hxx index 606357e393..103d289971 100644 --- a/src/BOPDS/BOPDS_VectorOfInterfEF.hxx +++ b/src/BOPDS/BOPDS_VectorOfInterfEF.hxx @@ -15,12 +15,9 @@ #ifndef BOPDS_VectorOfInterfEF_HeaderFile #define BOPDS_VectorOfInterfEF_HeaderFile -#include +#include #include -#define BOPCol_Array1_Use_Allocator -typedef BOPCol_Array1 BOPDS_VectorOfInterfEF; -#undef BOPCol_Array1_Use_Allocator - +typedef BOPCol_NCVector BOPDS_VectorOfInterfEF; #endif diff --git a/src/BOPDS/BOPDS_VectorOfInterfEZ.hxx b/src/BOPDS/BOPDS_VectorOfInterfEZ.hxx index 4fbb61438f..e1dbfa2fa1 100644 --- a/src/BOPDS/BOPDS_VectorOfInterfEZ.hxx +++ b/src/BOPDS/BOPDS_VectorOfInterfEZ.hxx @@ -16,11 +16,9 @@ #ifndef BOPDS_VectorOfInterfEZ_HeaderFile #define BOPDS_VectorOfInterfEZ_HeaderFile -#include +#include #include -#define BOPCol_Array1_Use_Allocator -typedef BOPCol_Array1 BOPDS_VectorOfInterfEZ; -#undef BOPCol_Array1_Use_Allocator +typedef BOPCol_NCVector BOPDS_VectorOfInterfEZ; #endif diff --git a/src/BOPDS/BOPDS_VectorOfInterfFF.hxx b/src/BOPDS/BOPDS_VectorOfInterfFF.hxx index cb8830177e..2b49fb3c2c 100644 --- a/src/BOPDS/BOPDS_VectorOfInterfFF.hxx +++ b/src/BOPDS/BOPDS_VectorOfInterfFF.hxx @@ -15,12 +15,9 @@ #ifndef BOPDS_VectorOfInterfFF_HeaderFile #define BOPDS_VectorOfInterfFF_HeaderFile -#include +#include #include -#define BOPCol_Array1_Use_Allocator -typedef BOPCol_Array1 BOPDS_VectorOfInterfFF; -#undef BOPCol_Array1_Use_Allocator - +typedef BOPCol_NCVector BOPDS_VectorOfInterfFF; #endif diff --git a/src/BOPDS/BOPDS_VectorOfInterfFZ.hxx b/src/BOPDS/BOPDS_VectorOfInterfFZ.hxx index 9261e6fe9b..cf2e470d7f 100644 --- a/src/BOPDS/BOPDS_VectorOfInterfFZ.hxx +++ b/src/BOPDS/BOPDS_VectorOfInterfFZ.hxx @@ -16,11 +16,9 @@ #ifndef BOPDS_VectorOfInterfFZ_HeaderFile #define BOPDS_VectorOfInterfFZ_HeaderFile -#include +#include #include -#define BOPCol_Array1_Use_Allocator -typedef BOPCol_Array1 BOPDS_VectorOfInterfFZ; -#undef BOPCol_Array1_Use_Allocator +typedef BOPCol_NCVector BOPDS_VectorOfInterfFZ; #endif diff --git a/src/BOPDS/BOPDS_VectorOfInterfVE.hxx b/src/BOPDS/BOPDS_VectorOfInterfVE.hxx index a8f2fb78fc..fe2a890d10 100644 --- a/src/BOPDS/BOPDS_VectorOfInterfVE.hxx +++ b/src/BOPDS/BOPDS_VectorOfInterfVE.hxx @@ -15,11 +15,9 @@ #ifndef BOPDS_VectorOfInterfVE_HeaderFile #define BOPDS_VectorOfInterfVE_HeaderFile -#include +#include #include -#define BOPCol_Array1_Use_Allocator -typedef BOPCol_Array1 BOPDS_VectorOfInterfVE; -#undef BOPCol_Array1_Use_Allocator +typedef BOPCol_NCVector BOPDS_VectorOfInterfVE; #endif diff --git a/src/BOPDS/BOPDS_VectorOfInterfVF.hxx b/src/BOPDS/BOPDS_VectorOfInterfVF.hxx index bcac147d3d..91545078ae 100644 --- a/src/BOPDS/BOPDS_VectorOfInterfVF.hxx +++ b/src/BOPDS/BOPDS_VectorOfInterfVF.hxx @@ -15,11 +15,9 @@ #ifndef BOPDS_VectorOfInterfVF_HeaderFile #define BOPDS_VectorOfInterfVF_HeaderFile -#include +#include #include -#define BOPCol_Array1_Use_Allocator -typedef BOPCol_Array1 BOPDS_VectorOfInterfVF; -#undef BOPCol_Array1_Use_Allocator +typedef BOPCol_NCVector BOPDS_VectorOfInterfVF; #endif diff --git a/src/BOPDS/BOPDS_VectorOfInterfVV.hxx b/src/BOPDS/BOPDS_VectorOfInterfVV.hxx index fe0dea2d7b..772ae84670 100644 --- a/src/BOPDS/BOPDS_VectorOfInterfVV.hxx +++ b/src/BOPDS/BOPDS_VectorOfInterfVV.hxx @@ -15,11 +15,9 @@ #ifndef BOPDS_VectorOfInterfVV_HeaderFile #define BOPDS_VectorOfInterfVV_HeaderFile -#include +#include #include -#define BOPCol_Array1_Use_Allocator -typedef BOPCol_Array1 BOPDS_VectorOfInterfVV; -#undef BOPCol_Array1_Use_Allocator +typedef BOPCol_NCVector BOPDS_VectorOfInterfVV; #endif diff --git a/src/BOPDS/BOPDS_VectorOfInterfVZ.hxx b/src/BOPDS/BOPDS_VectorOfInterfVZ.hxx index 206b79ce7e..f2f3dad6b6 100644 --- a/src/BOPDS/BOPDS_VectorOfInterfVZ.hxx +++ b/src/BOPDS/BOPDS_VectorOfInterfVZ.hxx @@ -16,11 +16,9 @@ #ifndef BOPDS_VectorOfInterfVZ_HeaderFile #define BOPDS_VectorOfInterfVZ_HeaderFile -#include +#include #include -#define BOPCol_Array1_Use_Allocator -typedef BOPCol_Array1 BOPDS_VectorOfInterfVZ; -#undef BOPCol_Array1_Use_Allocator +typedef BOPCol_NCVector BOPDS_VectorOfInterfVZ; #endif diff --git a/src/BOPDS/BOPDS_VectorOfInterfZZ.hxx b/src/BOPDS/BOPDS_VectorOfInterfZZ.hxx index c4128649a9..82928b1776 100644 --- a/src/BOPDS/BOPDS_VectorOfInterfZZ.hxx +++ b/src/BOPDS/BOPDS_VectorOfInterfZZ.hxx @@ -16,11 +16,9 @@ #ifndef BOPDS_VectorOfInterfZZ_HeaderFile #define BOPDS_VectorOfInterfZZ_HeaderFile -#include +#include #include -#define BOPCol_Array1_Use_Allocator -typedef BOPCol_Array1 BOPDS_VectorOfInterfZZ; -#undef BOPCol_Array1_Use_Allocator +typedef BOPCol_NCVector BOPDS_VectorOfInterfZZ; #endif diff --git a/src/BOPDS/BOPDS_VectorOfListOfPassKeyBoolean.hxx b/src/BOPDS/BOPDS_VectorOfListOfPassKeyBoolean.hxx index 4a058be5c4..e2644e1cf6 100644 --- a/src/BOPDS/BOPDS_VectorOfListOfPassKeyBoolean.hxx +++ b/src/BOPDS/BOPDS_VectorOfListOfPassKeyBoolean.hxx @@ -15,13 +15,9 @@ #ifndef BOPDS_VectorOfListOfPassKeyBoolean_HeaderFile #define BOPDS_VectorOfListOfPassKeyBoolean_HeaderFile -#include +#include #include -#define BOPCol_Array1_Use_Allocator - -typedef BOPCol_Array1 BOPDS_VectorOfListOfPassKeyBoolean; - -#undef BOPCol_Array1_Use_Allocator +typedef BOPCol_NCVector BOPDS_VectorOfListOfPassKeyBoolean; #endif diff --git a/src/BOPDS/BOPDS_VectorOfListOfPaveBlock.hxx b/src/BOPDS/BOPDS_VectorOfListOfPaveBlock.hxx index fc5245cec4..39389a6968 100644 --- a/src/BOPDS/BOPDS_VectorOfListOfPaveBlock.hxx +++ b/src/BOPDS/BOPDS_VectorOfListOfPaveBlock.hxx @@ -15,14 +15,10 @@ #ifndef BOPDS_VectorOfListOfPaveBlock_HeaderFile #define BOPDS_VectorOfListOfPaveBlock_HeaderFile -#include +#include #include #include -#define BOPCol_Array1_Use_Allocator - -typedef BOPCol_Array1 BOPDS_VectorOfListOfPaveBlock; - -#undef BOPCol_Array1_Use_Allocator +typedef BOPCol_NCVector BOPDS_VectorOfListOfPaveBlock; #endif diff --git a/src/BOPDS/BOPDS_VectorOfPoint.hxx b/src/BOPDS/BOPDS_VectorOfPoint.hxx index 504f0c7bda..2bbe1f3ddd 100644 --- a/src/BOPDS/BOPDS_VectorOfPoint.hxx +++ b/src/BOPDS/BOPDS_VectorOfPoint.hxx @@ -15,14 +15,10 @@ #ifndef BOPDS_VectorOfPnt_HeaderFile #define BOPDS_VectorOfPnt_HeaderFile -#include +#include #include -#define BOPCol_Array1_Use_Allocator - -typedef BOPCol_Array1 BOPDS_VectorOfPoint; - -#undef BOPCol_Array1_Use_Allocator +typedef BOPCol_NCVector BOPDS_VectorOfPoint; #endif diff --git a/src/BOPDS/BOPDS_VectorOfShapeInfo.hxx b/src/BOPDS/BOPDS_VectorOfShapeInfo.hxx index c32e0e0f76..236a14d75b 100644 --- a/src/BOPDS/BOPDS_VectorOfShapeInfo.hxx +++ b/src/BOPDS/BOPDS_VectorOfShapeInfo.hxx @@ -15,13 +15,9 @@ #ifndef BOPDS_VectorOfShapeInfo_HeaderFile #define BOPDS_VectorOfShapeInfo_HeaderFile -#include +#include #include -#define BOPCol_Array1_Use_Allocator - -typedef BOPCol_Array1 BOPDS_VectorOfShapeInfo; - -#undef BOPCol_Array1_Use_Allocator +typedef BOPCol_NCVector BOPDS_VectorOfShapeInfo; #endif diff --git a/src/BOPTest/BOPTest_Chronometer.hxx b/src/BOPTest/BOPTest_Chronometer.hxx index 16821d061e..ba88bf0351 100644 --- a/src/BOPTest/BOPTest_Chronometer.hxx +++ b/src/BOPTest/BOPTest_Chronometer.hxx @@ -15,7 +15,7 @@ #ifndef BOPTest_Chronometer_HeaderFile #define BOPTest_Chronometer_HeaderFile // -#include +#include //======================================================================= //class : BOPTest_Chronometer //purpose : @@ -35,7 +35,7 @@ class BOPTest_Chronometer { // void Stop() { myChronometer.Stop(); - myChronometer.Show(myTime); + myTime=myChronometer.ElapsedTime(); } // double Time() const{ @@ -43,7 +43,7 @@ class BOPTest_Chronometer { }; // protected: - OSD_Chronometer myChronometer; + OSD_Timer myChronometer; double myTime; }; diff --git a/src/NCollection/NCollection_BaseVector.hxx b/src/NCollection/NCollection_BaseVector.hxx index eefdd2ae8f..7e8be304c8 100755 --- a/src/NCollection/NCollection_BaseVector.hxx +++ b/src/NCollection/NCollection_BaseVector.hxx @@ -200,6 +200,14 @@ public: //! @name public API //! Empty the vector of its objects Standard_EXPORT void Clear(); + // to set the size of increment dynamically + void SetIncrement(const Standard_Integer aIncrement) { + if (aIncrement > 0) { + if (!myIncrement) { + myIncrement=aIncrement; + } + } + } protected: //! @name Protected fields diff --git a/src/QANewModTopOpe/QANewModTopOpe_Tools.cxx b/src/QANewModTopOpe/QANewModTopOpe_Tools.cxx index aece47ca11..6470325ed8 100644 --- a/src/QANewModTopOpe/QANewModTopOpe_Tools.cxx +++ b/src/QANewModTopOpe/QANewModTopOpe_Tools.cxx @@ -453,6 +453,11 @@ Standard_Boolean QANewModTopOpe_Tools::EdgeSectionAncestors(const BOPAlgo_PPaveF nb = pDS->NbSourceShapes(); nE = pDS->Index(theEdge); + // + if (nE<0) { + return Standard_False; + } + // const BOPDS_ListOfPaveBlock& aLPB1 = pDS->PaveBlocks(nE); if (!aLPB1.Extent()) { return Standard_False;