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 =========================================================================*/
27 #ifndef __vtkCollectionIterator_h
28 #define __vtkCollectionIterator_h
29 
30 #include "vtkObject.h"
31 
32 class vtkCollection;
34 
36 {
37 public:
39  void PrintSelf(ostream& os, vtkIndent indent);
40  static vtkCollectionIterator* New();
41 
43 
44  virtual void SetCollection(vtkCollection*);
45  vtkGetObjectMacro(Collection, vtkCollection);
47 
49  void InitTraversal() { this->GoToFirstItem(); }
50 
52  void GoToFirstItem();
53 
55  void GoToNextItem();
56 
59  int IsDoneWithTraversal();
60 
63  vtkObject* GetCurrentObject();
64 
65 #ifdef VTK_WORKAROUND_WINDOWS_MANGLE
66 # define GetObjectA GetObject
67 # define GetObjectW GetObject
68 #endif
69 
72  VTK_LEGACY(vtkObject* GetObject());
73 
74 #ifdef VTK_WORKAROUND_WINDOWS_MANGLE
75 # undef GetObjectW
76 # undef GetObjectA
77  //BTX
78  VTK_LEGACY(vtkObject* GetObjectA());
79  VTK_LEGACY(vtkObject* GetObjectW());
80  //ETX
81 #endif
82 
83 protected:
86 
87  // The collection over which we are iterating.
89 
90  // The current iterator position.
92 
93  vtkObject* GetObjectInternal();
94 private:
95  vtkCollectionIterator(const vtkCollectionIterator&); // Not implemented
96  void operator=(const vtkCollectionIterator&); // Not implemented
97 };
98 
99 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkCollectionElement * Element
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:37
#define VTK_COMMON_EXPORT
iterator through a vtkCollection.
create and manipulate unsorted lists of objects
Definition: vtkCollection.h:51
static vtkObject * New()