VTK
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;
42  static vtkCollectionIterator* New();
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 
71  int IsDoneWithTraversal();
72 
77  vtkObject* GetCurrentObject();
78 
79 protected:
81  ~vtkCollectionIterator() override;
82 
83  // The collection over which we are iterating.
85 
86  // The current iterator position.
88 
89  vtkObject* GetObjectInternal();
90 private:
92  void operator=(const vtkCollectionIterator&) = delete;
93 };
94 
95 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:59
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:39
iterator through a vtkCollection.
create and manipulate ordered lists of objects
Definition: vtkCollection.h:51
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...