View Issue Details

IDProjectCategoryView StatusLast Update
0024859Open CASCADEOCCT:Codingpublic2016-04-20 15:48
ReporterabvAssigned Toabv 
PrioritynormalSeverityfeature 
Status closedResolutionfixed 
Product Version6.7.1 
Target Version7.0.0Fixed in Version7.0.0 
Summary0024859: Replace SortTools by STL equivalents
DescriptionPackage SortTools implements several standard sort algorithms as generic classes. In context of effort to get rid of CDL (0024487), as well as for conversion of instances of TCollection classes to NCollection templates (0024750), it is desirable to convert these to normal C++ classes.

Actually we do not need to keep these algorithms in OCCT since these are provided by standard C++ library coming with all modern compilers. This replacement will be possible for NCollection classes as soon as improvement 0024831 is implemented. When TCollection classes are converted to templates, it will be easy to use STL algorithms in all cases.

Here is preliminary analysis of use of classes from SortTools:

1. StraightInsertionSort: has two instances in SortTools, used only for Reals in two places:
   - Adaptor3d_CurveOnSurface.cxx: this use is eliminated in context of 0024742
   - AppDef_Variational.cxx (on local array)

   It can be replaced by std::stable_sort()

2. ShellSort: has two instances in SortTools, used only for Reals in two places:
   - AppDef_Variational.cxx
   - BRepMesh_FastDiscretFace.cxx (on local array)


   It can be replaced by std::sort()

3. HeapSort: has two instances in SortTools (not used) and two instances in BRepMesh

   It can be replaced by either std::make_heap()/sort_heap() or by std::sort()

4. QuickSort: has several instaniations, used in ~ 10 places

   It can be replaced by std::sort()

It is desirable to check how performance is affected by switching to use of STL algorithms.
TagsNo tags attached.
Test case number

Relationships

parent of 0024831 closedapn Make iterators of NCollection classes STL-compatible 
related to 0024447 closedbugmaster Includes of ixx and jxx files should be replaced by their content 
child of 0024487 closedabv Getting rid of generic CDL classes 
child of 0024750 closedabv Replace instantiations of TCollection generic classes by NCollection templates 

Activities

abv

2014-05-07 16:16

manager   ~0029230

Note that NCollection package has classes Comparator and QuickSort which are also to be replaced (unless they have some unique features).

dbp

2014-05-28 16:04

developer   ~0029579

Dear abv,

OCCT sort tools were replaced on STL algorithms (using C++ comments).

abv

2014-06-03 07:43

manager   ~0029639

Fix completed and pushed to CR24859

git

2015-06-02 22:32

administrator   ~0041873

Branch CR24859_4 has been created by abv.

SHA-1: 459cbeb6ae1cc3c13ec12a085adeb3b3c6aca81f


Detailed log of new commits:

Author: abv
Date: Mon Jun 2 09:55:19 2014 +0400

    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.

Author: abv
Date: Mon Jun 2 09:08:25 2014 +0300

    0024750: Replace instantiations of TCollection generic classes by NCollection templates -- manual changes
    
    Forward declaration of TCollection instances as classes are replaced by inclusion of corresponding header.
    Cyclic dependencies between declaration of collection class and its item are resolved by forward declaring a class in collection header.

Author: abv
Date: Sat May 30 15:55:13 2015 +0300

    Automatic upgrade of code by command "occt_upgrade -tcollection"

abv

2015-07-22 07:42

manager   ~0043259

Integrated to master

git

2015-07-22 07:42

administrator   ~0043260

Branch CR24859_4 has been deleted by abv.

SHA-1: 459cbeb6ae1cc3c13ec12a085adeb3b3c6aca81f

git

2015-07-27 14:18

administrator   ~0043572

Branch CR24859 has been deleted by kgv.

SHA-1: 374443708cb611d059dd766d34af13ba9aa48821

Related Changesets

occt: master e35db416

2015-06-30 07:47:45

abv


Committer: abv Details Diff
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.
Affected Issues
0024859
mod - adm/UDLIST Diff File
mod - src/AppDef/AppDef_Variational.cxx Diff File
mod - src/BRepMesh/BRepMesh_FastDiscret.cxx Diff File
mod - src/BRepMesh/BRepMesh_FastDiscret.hxx Diff File
mod - src/BRepMesh/BRepMesh_FastDiscretFace.cxx Diff File
mod - src/Hermit/Hermit.cxx Diff File
mod - src/IntTools/IntTools.cdl Diff File
mod - src/IntTools/IntTools.cxx Diff File
rm - src/IntTools/IntTools_Compare.cdl Diff File
rm - src/IntTools/IntTools_Compare.cxx Diff File
rm - src/IntTools/IntTools_CompareRange.cdl Diff File
rm - src/IntTools/IntTools_CompareRange.cxx Diff File
mod - src/IntTools/IntTools_EdgeFace.cxx Diff File
mod - src/math/FILES Diff File
mod - src/math/math.cdl Diff File
rm - src/math/math_CompareOfValueAndWeight.cdl Diff File
rm - src/math/math_CompareOfValueAndWeight.cxx Diff File
mod - src/math/math_ComputeGaussPointsAndWeights.cxx Diff File
mod - src/math/math_ComputeKronrodPointsAndWeights.cxx Diff File
rm - src/math/math_ValueAndWeight.cdl Diff File
rm - src/math/math_ValueAndWeight.cxx Diff File
add - src/math/math_ValueAndWeight.hxx Diff File
mod - src/Resource/Resource.cdl Diff File
mod - src/Resource/Resource_Manager.cxx Diff File
mod - src/SelectMgr/FILES Diff File
mod - src/SelectMgr/SelectMgr.cdl Diff File
rm - src/SelectMgr/SelectMgr_CompareResults.hxx Diff File
mod - src/SelectMgr/SelectMgr_ViewerSelector.cxx Diff File
rm - src/SortTools/SortTools.cdl Diff File
rm - src/SortTools/SortTools_HeapSort.cdl Diff File
rm - src/SortTools/SortTools_HeapSort.gxx Diff File
rm - src/SortTools/SortTools_QuickSort.cdl Diff File
rm - src/SortTools/SortTools_QuickSort.gxx Diff File
rm - src/SortTools/SortTools_ShellSort.cdl Diff File
rm - src/SortTools/SortTools_ShellSort.gxx Diff File
rm - src/SortTools/SortTools_StraightInsertionSort.cdl Diff File
rm - src/SortTools/SortTools_StraightInsertionSort.gxx Diff File
mod - src/TCollection/FILES Diff File
mod - src/TCollection/TCollection.cdl Diff File
rm - src/TCollection/TCollection_CMPLRS.edl Diff File
rm - src/TCollection/TCollection_Compare.cdl Diff File
rm - src/TCollection/TCollection_Compare.gxx Diff File
rm - src/TCollection/TCollection_CompareOfInteger.cdl Diff File
rm - src/TCollection/TCollection_CompareOfInteger.cxx Diff File
rm - src/TCollection/TCollection_CompareOfReal.cdl Diff File
rm - src/TCollection/TCollection_CompareOfReal.cxx Diff File
mod - src/TKernel/PACKAGES Diff File

Issue History

Date Modified Username Field Change
2014-04-18 17:14 abv New Issue
2014-04-18 17:14 abv Assigned To => kgv
2014-04-18 17:15 abv Relationship added child of 0024487
2014-04-18 17:15 abv Relationship added child of 0024750
2014-04-18 17:16 abv Relationship added parent of 0024831
2014-04-18 17:16 abv Severity minor => feature
2014-04-18 17:16 abv Description Updated
2014-04-18 19:00 abv Assigned To kgv => dbp
2014-04-18 19:00 abv Status new => assigned
2014-05-07 16:16 abv Note Added: 0029230
2014-05-28 16:04 dbp Note Added: 0029579
2014-05-28 16:04 dbp Assigned To dbp => abv
2014-05-28 16:04 dbp Status assigned => feedback
2014-06-03 07:39 abv Relationship added related to 0024447
2014-06-03 07:43 abv Note Added: 0029639
2014-06-03 07:43 abv Status feedback => resolved
2014-09-11 10:49 abv Target Version 6.8.0 => 7.0.0
2015-06-02 22:32 git Note Added: 0041873
2015-07-22 07:42 abv Note Added: 0043259
2015-07-22 07:42 abv Assigned To abv => bugmaster
2015-07-22 07:42 abv Status resolved => reviewed
2015-07-22 07:42 git Note Added: 0043260
2015-07-23 11:55 abv Changeset attached => occt master e35db416
2015-07-23 11:55 abv Assigned To bugmaster => abv
2015-07-23 11:55 abv Status reviewed => verified
2015-07-23 11:55 abv Resolution open => fixed
2015-07-27 14:18 git Note Added: 0043572
2016-04-20 15:44 aiv Fixed in Version => 7.0.0
2016-04-20 15:48 aiv Status verified => closed