X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=blobdiff_plain;f=src%2FBOPDS%2FBOPDS_DS.cxx;h=fc8ee91556817791ae5321300bbcbc124d2042fa;hb=7a76337e897a8c0343f6de9160da414249cfb640;hpb=5a89733fd434aa1e8438f6709f608c5141a42774 diff --git a/src/BOPDS/BOPDS_DS.cxx b/src/BOPDS/BOPDS_DS.cxx index b9495103ed..fc8ee91556 100644 --- a/src/BOPDS/BOPDS_DS.cxx +++ b/src/BOPDS/BOPDS_DS.cxx @@ -14,6 +14,8 @@ #include // +#include +// #include #include @@ -40,6 +42,7 @@ #include #include #include +#include #include #include @@ -48,6 +51,8 @@ #include #include +#include + // static inline void ResetShape(const TopoDS_Shape& aS); @@ -62,8 +67,6 @@ static static Standard_Real ComputeParameter(const TopoDS_Vertex& aV, const TopoDS_Edge& aE); -static - void SortShell(const int n, BOPDS_Pave *a); //======================================================================= //function : @@ -1752,36 +1755,41 @@ void BOPDS_DS::Paves(const Standard_Integer theEdge, BOPDS_ListOfPave& theLP) { Standard_Integer aNb, i; - BOPDS_Pave *pPaves; BOPDS_ListIteratorOfListOfPaveBlock aIt; BOPDS_MapOfPave aMP; // const BOPDS_ListOfPaveBlock& aLPB = PaveBlocks(theEdge); - aNb = aLPB.Extent(); - aNb = (aNb==0) ? 0 : (aNb+1); - // - pPaves=(BOPDS_Pave *)myAllocator->Allocate(aNb*sizeof(BOPDS_Pave)); - for (i=0; iPave1())){ - pPaves[i] = aPB->Pave1(); + const BOPDS_Pave& aPave1 = aPB->Pave1(); + const BOPDS_Pave& aPave2 = aPB->Pave2(); + // + if (aMP.Add(aPave1)){ + pPaves(i) = aPave1; ++i; } - if (aMP.Add(aPB->Pave2())){ - pPaves[i] = aPB->Pave2(); + // + if (aMP.Add(aPave2)){ + pPaves(i) = aPave2; ++i; } } // - SortShell(aNb, pPaves); + Standard_ASSERT_VOID(aNb == aMP.Extent(), "Abnormal number of paves"); + // + std::sort(pPaves.begin(), pPaves.end()); // - for (i = 0; i < aNb; ++i) { - theLP.Append(pPaves[i]); + for (i = 1; i <= aNb; ++i) { + theLP.Append(pPaves(i)); } } @@ -1905,37 +1913,6 @@ Standard_Real ComputeParameter(const TopoDS_Vertex& aV, return aTRet; } //======================================================================= -// function: SortShell -// purpose : -//======================================================================= -void SortShell(const int n, BOPDS_Pave *a) -{ - int nd, i, j, l, d=1; - BOPDS_Pave x; - // - while(d<=n) { - d*=2; - } - // - while (d) { - d=(d-1)/2; - // - nd=n-d; - for (i=0; i -1) goto m30; - }//if (a[l] < a[j]){ - }//for (i=0; i