VTK: Common/Core/vtkCollectionIterator.h Source File

| VTK 9.3.1

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;
24 class vtkCollectionElement;
25
26 class VTKCOMMONCORE_EXPORT vtkCollectionIterator : public vtkObject
27 {
28 public:
29 vtkTypeMacro(vtkCollectionIterator, vtkObject);
30 void PrintSelf(ostream& os, vtkIndent indent) override;
31 static vtkCollectionIterator* New();
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
60 int IsDoneWithTraversal();
61
66 vtkObject* GetCurrentObject();
67
68 protected:
69 vtkCollectionIterator();
70 ~vtkCollectionIterator() override;
71
72 // The collection over which we are iterating.
73 vtkCollection* Collection;
74
75 // The current iterator position.
76 vtkCollectionElement* Element;
77
78 vtkObject* GetObjectInternal();
79
80 private:
81 vtkCollectionIterator(const vtkCollectionIterator&) = delete;
82 void operator=(const vtkCollectionIterator&) = delete;
83 };
84
85 VTK_ABI_NAMESPACE_END
86 #endif
vtkCollectionElement
Definition: vtkCollection.h:30
vtkCollectionIterator
iterator through a vtkCollection.
Definition: vtkCollectionIterator.h:27
vtkCollectionIterator::InitTraversal
void InitTraversal()
Position the iterator at the first item in the collection.
Definition: vtkCollectionIterator.h:44
vtkCollectionIterator::~vtkCollectionIterator
~vtkCollectionIterator() override
vtkCollectionIterator::GetObjectInternal
vtkObject * GetObjectInternal()
vtkCollectionIterator::IsDoneWithTraversal
int IsDoneWithTraversal()
Test whether the iterator is currently positioned at a valid item.
vtkCollectionIterator::New
static vtkCollectionIterator * New()
vtkCollectionIterator::GetCurrentObject
vtkObject * GetCurrentObject()
Get the item at the current iterator position.
vtkCollectionIterator::GoToNextItem
void GoToNextItem()
Move the iterator to the next item in the collection.
vtkCollectionIterator::Collection
vtkCollection * Collection
Definition: vtkCollectionIterator.h:73
vtkCollectionIterator::vtkCollectionIterator
vtkCollectionIterator()
vtkCollectionIterator::SetCollection
virtual void SetCollection(vtkCollection *)
Set/Get the collection over which to iterate.
vtkCollectionIterator::GoToFirstItem
void GoToFirstItem()
Position the iterator at the first item in the collection.
vtkCollectionIterator::Element
vtkCollectionElement * Element
Definition: vtkCollectionIterator.h:76
vtkCollectionIterator::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkCollection
create and manipulate ordered lists of objects
Definition: vtkCollection.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkObject.h