VTK  9.6.20260215
vtkCollectionIterator.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
15
16#ifndef vtkCollectionIterator_h
17#define vtkCollectionIterator_h
18
19#include "vtkCommonCoreModule.h" // For export macro
20#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_7_0
21#include "vtkObject.h"
22
23VTK_ABI_NAMESPACE_BEGIN
24class vtkCollection;
25
26class VTK_DEPRECATED_IN_9_7_0("Use vtk::Range instead.") VTKCOMMONCORE_EXPORT vtkCollectionIterator
27 : public vtkObject
28{
29public:
31 void PrintSelf(ostream& os, vtkIndent indent) override;
33
35
39 vtkGetObjectMacro(Collection, vtkCollection);
41
45 void InitTraversal() { this->GoToFirstItem(); }
46
51
56
62
68
69protected:
72
73 // The collection over which we are iterating.
75
77
78private:
79 // The current iterator position.
80 std::vector<vtkObject*>::iterator Iterator;
81
83 void operator=(const vtkCollectionIterator&) = delete;
84};
85
86VTK_ABI_NAMESPACE_END
87#endif
void InitTraversal()
Position the iterator at the first item in the collection.
static vtkCollectionIterator * New()
~vtkCollectionIterator() override
int IsDoneWithTraversal()
Test whether the iterator is currently positioned at a valid item.
vtkObject * GetObjectInternal()
void GoToNextItem()
Move the iterator to the next item in the collection.
vtkObject * GetCurrentObject()
Get the item at the current iterator position.
virtual void SetCollection(vtkCollection *)
Set/Get the collection over which to iterate.
void GoToFirstItem()
Position the iterator at the first item in the collection.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
create and manipulate ordered lists of objects
a simple class to control print indentation
Definition vtkIndent.h:108
#define VTK_DEPRECATED_IN_9_7_0(reason)