mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +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:
@@ -22,9 +22,9 @@
|
||||
#include <GeomFill_SnglrFunc.hxx>
|
||||
#include <Extrema_ExtPC.hxx>
|
||||
#include <TColStd_HArray1OfBoolean.hxx>
|
||||
#include <SortTools_QuickSortOfReal.hxx>
|
||||
#include <TCollection_CompareOfReal.hxx>
|
||||
#include <TColgp_SequenceOfPnt2d.hxx>
|
||||
#include <NCollection_Array1.hxx>
|
||||
#include <algorithm>
|
||||
|
||||
static const Standard_Real NullTol = 1.e-10;
|
||||
static const Standard_Real MaxSingular = 1.e-5;
|
||||
@@ -211,11 +211,10 @@ Handle(GeomFill_TrihedronLaw) GeomFill_Frenet::Copy() const
|
||||
}
|
||||
// sorting
|
||||
if(SeqArray[i-1].Length() != 0) {
|
||||
TColStd_Array1OfReal anArray( 1, SeqArray[i-1].Length() );
|
||||
NCollection_Array1<Standard_Real> anArray( 1, SeqArray[i-1].Length() );
|
||||
for (j = 1; j <= anArray.Length(); j++)
|
||||
anArray(j) = SeqArray[i-1](j);
|
||||
TCollection_CompareOfReal Compar;
|
||||
SortTools_QuickSortOfReal::Sort( anArray, Compar);
|
||||
std::sort (anArray.begin(), anArray.end());
|
||||
for (j = 1; j <= anArray.Length(); j++)
|
||||
SeqArray[i-1](j) = anArray(j);
|
||||
}
|
||||
@@ -258,11 +257,10 @@ Handle(GeomFill_TrihedronLaw) GeomFill_Frenet::Copy() const
|
||||
|
||||
if(SnglSeq.Length() > 0) {
|
||||
// sorting
|
||||
TColStd_Array1OfReal anArray( 1, SnglSeq.Length() );
|
||||
NCollection_Array1<Standard_Real> anArray( 1, SnglSeq.Length() );
|
||||
for (i = 1; i <= SnglSeq.Length(); i++)
|
||||
anArray(i) = SnglSeq(i);
|
||||
TCollection_CompareOfReal Compar;
|
||||
SortTools_QuickSortOfReal::Sort( anArray, Compar );
|
||||
std::sort (anArray.begin(), anArray.end());
|
||||
for (i = 1; i <= SnglSeq.Length(); i++)
|
||||
SnglSeq(i) = anArray(i);
|
||||
|
||||
|
Reference in New Issue
Block a user