[vtk-developers] RFC: STL algos and C++11 for-range syntax with vtkDataArrays

Allie Vacanti allison.vacanti at kitware.com
Fri Nov 9 06:00:37 EST 2018

On Fri, Nov 9, 2018, 2:07 AM Elvis Stansvik <elvis.stansvik at orexplore.com

> Any plans for something similar for vtkCollection*?

Not currently, but that would be a very useful feature indeed. I think it'd
be more than worthwhile to add a template that just translates the VTK
iteration convention (InitTraversal, GoToNextItem, IsDoneWithTraversal) to
a set of STL iterators/range objects. This would allow it to work with
quite a few different iterables in VTK.

It'd have a similarly usage as the array iterators:

vtk[...]Collection *myCollection = ...;
for (auto item : vtk::Range(myCollection)) { ... }

I'll put this on my list to look at in my spare cycles.  Good suggestion!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtk-developers/attachments/20181109/a1105ae2/attachment.html>

More information about the vtk-developers mailing list