1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

0024831: Make iterators of NCollection classes STL-compatible

STL-compatible iterators returned methods begin() and end() are provided in collection classes from NCollection package.
NCollection_Array1::Iterator is redesigned to use pointer instead of index.
Iterators of Sequence, Array, and Vector are extended by new methods to iterate backwards.

Use of SortTools_QuickSortOfReal is replaced by std::sort() in a few places (where possible).
This commit is contained in:
dbp
2014-04-23 09:38:58 +04:00
committed by apn
parent 574d723693
commit 79a35943dd
25 changed files with 1988 additions and 173 deletions

View File

@@ -1356,7 +1356,7 @@ QANewModTopOpe_Glue::SectionInsideFace(const TopoDS_Face& theFace,
// check if vertices of aSEdge contacts edges of aFace
TopoDS_Iterator aIter (aSEdge, Standard_False);
for (; aIter.More(); aIter.Next()) {
const TopoDS_Vertex& aSVer = TopoDS::Vertex (aIter.Value());
TopoDS_Vertex aSVer = TopoDS::Vertex (aIter.Value());
if (aSVer.Orientation() != TopAbs_FORWARD &&
aSVer.Orientation() != TopAbs_REVERSED) continue;

View File

@@ -31,9 +31,6 @@
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_DataMapOfIntegerShape.hxx>
#include <TCollection_CompareOfReal.hxx>
#include <SortTools_QuickSortOfReal.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_IndexedMapOfReal.hxx>
#include <TColStd_ListOfInteger.hxx>
@@ -48,6 +45,9 @@
#include <BOPDS_CommonBlock.hxx>
#include <BOPTools_AlgoTools3D.hxx>
#include <NCollection_Array1.hxx>
#include <algorithm>
static Standard_Boolean AddShapeToHistoryMap(const TopoDS_Shape& theOldShape,
const TopoDS_Shape& theNewShape,
TopTools_IndexedDataMapOfShapeListOfShape& theHistoryMap);
@@ -815,7 +815,7 @@ void SortVertexOnEdge(const TopoDS_Edge& theEdge,
mapiv.Bind(iv,v);
}
Standard_Integer nv = mapiv.Extent();
TColStd_Array1OfReal tabpar(1,nv);
NCollection_Array1<Standard_Real> tabpar(1,nv);
Standard_Integer i = 0;
for ( i = 1; i <= nv; i++) {
@@ -823,8 +823,7 @@ void SortVertexOnEdge(const TopoDS_Edge& theEdge,
tabpar.SetValue(i,p);
}
theListOfVertexSorted.Clear();
TCollection_CompareOfReal compare;
SortTools_QuickSortOfReal::Sort(tabpar, compare);
std::sort (tabpar.begin(), tabpar.end());
for (i = 1; i <= nv; i++) {
Standard_Real par = tabpar.Value(i);