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;
25 
26 class VTKCOMMONCORE_EXPORT vtkCollectionIterator : public vtkObject
27 {
28 public:
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:
70  ~vtkCollectionIterator() override;
71 
72  // The collection over which we are iterating.
74 
75  // The current iterator position.
77 
78  vtkObject* GetObjectInternal();
79 
80 private:
82  void operator=(const vtkCollectionIterator&) = delete;
83 };
84 
85 VTK_ABI_NAMESPACE_END
86 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:51
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkCollectionElement * Element
a simple class to control print indentation
Definition: vtkIndent.h:28
iterator through a vtkCollection.
create and manipulate ordered lists of objects
Definition: vtkCollection.h:44
void InitTraversal()
Position the iterator at the first item in the collection.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...