VTK  9.1.20211115
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 
34 class vtkCollection;
36 
37 class VTKCOMMONCORE_EXPORT vtkCollectionIterator : public vtkObject
38 {
39 public:
41  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
45 
48  virtual void SetCollection(vtkCollection*);
49  vtkGetObjectMacro(Collection, vtkCollection);
51 
55  void InitTraversal() { this->GoToFirstItem(); }
56 
60  void GoToFirstItem();
61 
65  void GoToNextItem();
66 
72 
78 
79 protected:
82 
83  // The collection over which we are iterating.
85 
86  // The current iterator position.
88 
90 
91 private:
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.
~vtkCollectionIterator() override
vtkObject * GetObjectInternal()
int IsDoneWithTraversal()
Test whether the iterator is currently positioned at a valid item.
static vtkCollectionIterator * New()
vtkObject * GetCurrentObject()
Get the item at the current iterator position.
void GoToNextItem()
Move the iterator to the next item in the collection.
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:82