VTK  9.1.0
vtkCollectionIterator.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkCollectionIterator.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
28#ifndef vtkCollectionIterator_h
29#define vtkCollectionIterator_h
30
31#include "vtkCommonCoreModule.h" // For export macro
32#include "vtkObject.h"
33
34class vtkCollection;
36
37class VTKCOMMONCORE_EXPORT vtkCollectionIterator : public vtkObject
38{
39public:
41 void PrintSelf(ostream& os, vtkIndent indent) override;
43
45
49 vtkGetObjectMacro(Collection, vtkCollection);
51
55 void InitTraversal() { this->GoToFirstItem(); }
56
61
66
72
78
79protected:
82
83 // The collection over which we are iterating.
85
86 // The current iterator position.
88
90
91private:
93 void operator=(const vtkCollectionIterator&) = delete;
94};
95
96#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
Definition: vtkCollection.h:53
a simple class to control print indentation
Definition: vtkIndent.h:113
abstract base class for most VTK objects
Definition: vtkObject.h:73