VTK  9.4.20250130
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
16#ifndef vtkCollectionIterator_h
17#define vtkCollectionIterator_h
18
19#include "vtkCommonCoreModule.h" // For export macro
20#include "vtkObject.h"
21
22VTK_ABI_NAMESPACE_BEGIN
23class vtkCollection;
25
26class VTKCOMMONCORE_EXPORT vtkCollectionIterator : public vtkObject
27{
28public:
30 void PrintSelf(ostream& os, vtkIndent indent) override;
32
34
38 vtkGetObjectMacro(Collection, vtkCollection);
40
44 void InitTraversal() { this->GoToFirstItem(); }
45
50
55
61
67
68protected:
71
72 // The collection over which we are iterating.
74
75 // The current iterator position.
77
79
80private:
82 void operator=(const vtkCollectionIterator&) = delete;
83};
84
85VTK_ABI_NAMESPACE_END
86#endif
iterator through a vtkCollection.
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.
vtkCollectionElement * Element
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
abstract base class for most VTK objects
Definition vtkObject.h:162