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) VTK_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:
81  ~vtkCollectionIterator() VTK_OVERRIDE;
82 
83  // The collection over which we are iterating.
84  vtkCollection* Collection;
85 
86  // The current iterator position.
88 
89  vtkObject* GetObjectInternal();
90 private:
91  vtkCollectionIterator(const vtkCollectionIterator&) VTK_DELETE_FUNCTION;
92  void operator=(const vtkCollectionIterator&) VTK_DELETE_FUNCTION;
93 };
94 
95 #endif
vtkCollectionIterator::IsDoneWithTraversal
int IsDoneWithTraversal()
Test whether the iterator is currently positioned at a valid item.
vtkCollectionIterator::SetCollection
virtual void SetCollection(vtkCollection *)
Set/Get the collection over which to iterate.
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkCollectionIterator::GoToFirstItem
void GoToFirstItem()
Position the iterator at the first item in the collection.
vtkCollectionIterator::vtkCollectionIterator
vtkCollectionIterator()
vtkCollectionIterator::~vtkCollectionIterator
~vtkCollectionIterator() override
vtkCollection
create and manipulate unsorted lists of objects
Definition: vtkCollection.h:52
vtkCollectionIterator::InitTraversal
void InitTraversal()
Position the iterator at the first item in the collection.
Definition: vtkCollectionIterator.h:55
vtkCollectionIterator
iterator through a vtkCollection.
Definition: vtkCollectionIterator.h:38
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
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.
vtkObject.h
vtkCollectionIterator::New
static vtkCollectionIterator * New()
vtkCollectionElement
Definition: vtkCollection.h:41
vtkCollectionIterator::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.