Refactor vtkCollection to use std::vector instead of a linked list#
vtkCollection now uses an std::vector instead of a linked list, improving runtime performance.
Its public API and behaviour have not changed at all, except:
The class
vtkCollectionElement, being a representation of a linked list node, has been removed, without any deprecation period. Although it appeared invtkCollection.h, it wasn’t exactly public API, and no uses of it could be found in various open source consumers of VTK (ParaView, Slicer, ITK, Horos).Two
protectedmember functions (RemoveElement and DeleteElement) and severalprotectedmember variables were removed. All of these involvedvtkCollectionElementand thus could not be deprecated. This may affect subclassers. All of VTK’s own subclasses have been updated.A new
Sort()member function was added. It takes anstd::functionand sorts itself using that. VTK subclasses (vtkActor2DCollectionandvtkImageSliceCollection) that did their own sorting were updated to use this new mechanism.The
NewIterator()member function was deprecated sincevtkCollectionIteratoritself is now deprecated. Usevtk::Rangefor range-based for loops instead.The default and
protectedconstructors of the classCollectionIterator, defined invtkCollectionRange.h, have been removed. Use the new constructor which properly initializes its newIteratormember.GetNextPathis tagged withVTK_MARSHAL_EXCLUDE_REASON_NOT_SUPPORTED.