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

dox/Common/vtkCollectionIterator.h

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