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