00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkOutEdgeIterator.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 -------------------------------------------------------------------------*/ 00040 #ifndef __vtkOutEdgeIterator_h 00041 #define __vtkOutEdgeIterator_h 00042 00043 #include "vtkObject.h" 00044 00045 #include "vtkGraph.h" // For edge type definitions 00046 00047 class vtkGraphEdge; 00048 00049 class VTK_FILTERING_EXPORT vtkOutEdgeIterator : public vtkObject 00050 { 00051 public: 00052 static vtkOutEdgeIterator *New(); 00053 vtkTypeMacro(vtkOutEdgeIterator, vtkObject); 00054 void PrintSelf(ostream& os, vtkIndent indent); 00055 00057 void Initialize(vtkGraph *g, vtkIdType v); 00058 00060 00061 vtkGetObjectMacro(Graph, vtkGraph); 00062 vtkGetMacro(Vertex, vtkIdType); 00064 00065 //BTX 00067 00068 inline vtkOutEdgeType Next() 00069 { 00070 vtkOutEdgeType e = *this->Current; 00071 ++this->Current; 00072 return e; 00073 } 00074 //ETX 00076 00081 vtkGraphEdge *NextGraphEdge(); 00082 00084 00085 bool HasNext() 00086 { 00087 return this->Current != this->End; 00088 } 00090 00091 protected: 00092 vtkOutEdgeIterator(); 00093 ~vtkOutEdgeIterator(); 00094 00096 virtual void SetGraph(vtkGraph *graph); 00097 00098 vtkGraph *Graph; 00099 const vtkOutEdgeType *Current; 00100 const vtkOutEdgeType *End; 00101 vtkIdType Vertex; 00102 vtkGraphEdge *GraphEdge; 00103 00104 private: 00105 vtkOutEdgeIterator(const vtkOutEdgeIterator&); // Not implemented. 00106 void operator=(const vtkOutEdgeIterator&); // Not implemented. 00107 }; 00108 00109 #endif