1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0024859: Replace SortTools by STL equivalents

Package SortTools and its derived classes are removed; STL sort algorithms are used instead.
Comparator objects are mostly reimplemented as local classes.
This commit is contained in:
abv
2015-06-30 10:47:45 +03:00
parent b7c077b9ee
commit e35db4162b
47 changed files with 150 additions and 1374 deletions

View File

@@ -53,9 +53,6 @@
#include <Precision.hxx>
#include <AppDef_MyLineTool.hxx>
#include <SortTools_StraightInsertionSortOfReal.hxx>
#include <SortTools_ShellSortOfReal.hxx>
#include <TCollection_CompareOfReal.hxx>
#include <TColStd_HArray2OfInteger.hxx>
#include <TColStd_Array2OfInteger.hxx>
#include <TColStd_Array2OfReal.hxx>
@@ -69,6 +66,9 @@
#include <PLib_HermitJacobi.hxx>
#include <FEmTool_HAssemblyTable.hxx>
// Add this line:
#include <algorithm>
#if defined(WNT)
# include <stdio.h>
# include <stdarg.h>
@@ -1152,8 +1152,6 @@ void AppDef_Variational::TheMotor(
const Standard_Real BigValue = 1.e37, SmallValue = 1.e-6, SmallestValue = 1.e-9;
// SortTools_StraightInsertionSortOfReal Sort;
TCollection_CompareOfReal CompReal;
Handle(TColStd_HArray1OfReal) CurrentTi, NewTi, OldTi;
Handle(TColStd_HArray2OfInteger) Dependence;
Standard_Boolean lestim, lconst, ToOptim, iscut;
@@ -1294,8 +1292,9 @@ void AppDef_Variational::TheMotor(
if (lestim && isnear) {
// (1.7) Optimization of ti by ACR.
// Sort.Sort(CurrentTi->ChangeArray1(), CompReal);
SortTools_StraightInsertionSortOfReal::Sort(CurrentTi->ChangeArray1(), CompReal);
std::stable_sort (CurrentTi->begin(), CurrentTi->end());
Standard_Integer Decima = 4;
CCurrent->Length(0., 1., CBLONG);
@@ -1325,8 +1324,9 @@ void AppDef_Variational::TheMotor(
OldTi->ChangeArray1() = CurrentTi->Array1();
// (2.2) Optimization des ti by ACR.
// Sort.Sort(CurrentTi->ChangeArray1(), CompReal);
SortTools_StraightInsertionSortOfReal::Sort(CurrentTi->ChangeArray1(), CompReal);
std::stable_sort (CurrentTi->begin(), CurrentTi->end());
Standard_Integer Decima = 4;
CCurrent->Length(0., 1., CBLONG);
@@ -1412,8 +1412,8 @@ void AppDef_Variational::TheMotor(
// (3.2) On arrange les ti : Trie + recadrage sur (0,1)
// ---> On trie, afin d'assurer l'ordre par la suite.
// Sort.Sort(CurrentTi->ChangeArray1(), CompReal);
SortTools_StraightInsertionSortOfReal::Sort(CurrentTi->ChangeArray1(), CompReal);
std::stable_sort (CurrentTi->begin(), CurrentTi->end());
if ((CurrentTi->Value(1)!= 0.) ||
(CurrentTi->Value(NbrPnt)!= 1.)) {
@@ -1912,11 +1912,7 @@ void AppDef_Variational::SplitCurve(const Handle(FEmTool_Curve)& InCurve,
for(i = InKnots.Lower(); i <= InKnots.Upper(); i++) OutKnots(i) = InKnots(i);
for(i = NbElmOld + 1; i <= NbElm; i++) OutKnots(i + i0) = NewKnots(i);
// SortTools_ShellSortOfReal Sort;
TCollection_CompareOfReal CompReal;
// Sort.Sort(OutKnots, CompReal);
SortTools_ShellSortOfReal::Sort(OutKnots, CompReal);
std::sort (OutKnots.begin(), OutKnots.end());
}
else
iscut = Standard_False;