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

Common/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 =========================================================================*/
00027 #ifndef __vtkCollectionIterator_h
00028 #define __vtkCollectionIterator_h
00029 
00030 #include "vtkObject.h"
00031 
00032 class vtkCollection;
00033 class vtkCollectionElement;
00034 
00035 class VTK_COMMON_EXPORT vtkCollectionIterator : public vtkObject
00036 {
00037 public:
00038   vtkTypeRevisionMacro(vtkCollectionIterator,vtkObject);
00039   void PrintSelf(ostream& os, vtkIndent indent);
00040   static vtkCollectionIterator* New();
00041   
00043 
00044   virtual void SetCollection(vtkCollection*);
00045   vtkGetObjectMacro(Collection, vtkCollection);
00047   
00049   void InitTraversal() { this->GoToFirstItem(); }
00050   
00052   void GoToFirstItem();
00053   
00055   void GoToNextItem();
00056   
00059   int IsDoneWithTraversal();
00060   
00063   vtkObject* GetObject();
00064   
00065 protected:
00066   vtkCollectionIterator();
00067   ~vtkCollectionIterator();
00068   
00069   // The collection over which we are iterating.
00070   vtkCollection* Collection;
00071   
00072   // The current iterator position.
00073   vtkCollectionElement* Element;
00074   
00075 private:
00076   vtkCollectionIterator(const vtkCollectionIterator&); // Not implemented
00077   void operator=(const vtkCollectionIterator&); // Not implemented
00078 };
00079 
00080 #endif