Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkCollectionIterator.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkCollectionIterator.h,v $
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00037 #ifndef __vtkCollectionIterator_h
00038 #define __vtkCollectionIterator_h
00039 
00040 #include "vtkObject.h"
00041 
00042 class vtkCollection;
00043 class vtkCollectionElement;
00044 
00045 class VTK_COMMON_EXPORT vtkCollectionIterator : public vtkObject
00046 {
00047 public:
00048   vtkTypeRevisionMacro(vtkCollectionIterator,vtkObject);
00049   void PrintSelf(ostream& os, vtkIndent indent);
00050   static vtkCollectionIterator* New();
00051   
00053 
00054   virtual void SetCollection(vtkCollection*);
00055   vtkGetObjectMacro(Collection, vtkCollection);
00057   
00059   void InitTraversal() { this->GoToFirstItem(); }
00060   
00062   void GoToFirstItem();
00063   
00065   void GoToNextItem();
00066   
00069   int IsDoneWithTraversal();
00070   
00073   vtkObject* GetObject();
00074   
00075 protected:
00076   vtkCollectionIterator();
00077   ~vtkCollectionIterator();
00078   
00079   // The collection over which we are iterating.
00080   vtkCollection* Collection;
00081   
00082   // The current iterator position.
00083   vtkCollectionElement* Element;
00084   
00085 private:
00086   vtkCollectionIterator(const vtkCollectionIterator&); // Not implemented
00087   void operator=(const vtkCollectionIterator&); // Not implemented
00088 };
00089 
00090 #endif