VTK
dox/Filtering/vtkVertexListIterator.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkVertexListIterator.h
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 =========================================================================*/
00015 /*-------------------------------------------------------------------------
00016   Copyright 2008 Sandia Corporation.
00017   Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00018   the U.S. Government retains certain rights in this software.
00019 -------------------------------------------------------------------------*/
00036 #ifndef __vtkVertexListIterator_h
00037 #define __vtkVertexListIterator_h
00038 
00039 #include "vtkObject.h"
00040 
00041 #include "vtkGraph.h" // For edge type definitions
00042 
00043 class vtkGraphEdge;
00044 
00045 class VTK_FILTERING_EXPORT vtkVertexListIterator : public vtkObject
00046 {
00047 public:
00048   static vtkVertexListIterator *New();
00049   vtkTypeMacro(vtkVertexListIterator, vtkObject);
00050   void PrintSelf(ostream& os, vtkIndent indent);
00051 
00053   virtual void SetGraph(vtkGraph *graph);  
00054 
00056 
00057   vtkGetObjectMacro(Graph, vtkGraph);
00059   
00061 
00062   vtkIdType Next()
00063   {
00064     vtkIdType v = this->Current;
00065     ++this->Current;
00066     return v;
00067   }
00069 
00071 
00072   bool HasNext()
00073   {
00074     return this->Current != this->End;
00075   }
00077 
00078 protected:
00079   vtkVertexListIterator();
00080   ~vtkVertexListIterator();
00081 
00082   vtkGraph *Graph;
00083   vtkIdType  Current;
00084   vtkIdType  End;
00085 
00086 private:
00087   vtkVertexListIterator(const vtkVertexListIterator&);  // Not implemented.
00088   void operator=(const vtkVertexListIterator&);  // Not implemented.
00089 };
00090 
00091 #endif