VTK  9.3.20240329
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 
22 VTK_ABI_NAMESPACE_BEGIN
23 class vtkCollection;
25 
26 class VTKCOMMONCORE_EXPORT vtkCollectionIterator : public vtkObject
27 {
28 public:
30  void PrintSelf(ostream& os, vtkIndent indent) override;
32 
34 
37  virtual void SetCollection(vtkCollection*);
38  vtkGetObjectMacro(Collection, vtkCollection);
40 
44  void InitTraversal() { this->GoToFirstItem(); }
45 
49  void GoToFirstItem();
50 
54  void GoToNextItem();
55 
61 
67 
68 protected:
71 
72  // The collection over which we are iterating.
74 
75  // The current iterator position.
77 
79 
80 private:
82  void operator=(const vtkCollectionIterator&) = delete;
83 };
84 
85 VTK_ABI_NAMESPACE_END
86 #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:46
a simple class to control print indentation
Definition: vtkIndent.h:108
abstract base class for most VTK objects
Definition: vtkObject.h:162