VTK
dox/Common/DataModel/vtkOutEdgeIterator.h
Go to the documentation of this file.
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 "vtkCommonDataModelModule.h" // For export macro
00044 #include "vtkObject.h"
00045 
00046 #include "vtkGraph.h" // For edge type definitions
00047 
00048 class vtkGraphEdge;
00049 
00050 class VTKCOMMONDATAMODEL_EXPORT vtkOutEdgeIterator : public vtkObject
00051 {
00052 public:
00053   static vtkOutEdgeIterator *New();
00054   vtkTypeMacro(vtkOutEdgeIterator, vtkObject);
00055   void PrintSelf(ostream& os, vtkIndent indent);
00056 
00058   void Initialize(vtkGraph *g, vtkIdType v);
00059 
00061 
00062   vtkGetObjectMacro(Graph, vtkGraph);
00063   vtkGetMacro(Vertex, vtkIdType);
00065 
00066   //BTX
00068 
00069   inline vtkOutEdgeType Next()
00070   {
00071     vtkOutEdgeType e = *this->Current;
00072     ++this->Current;
00073     return e;
00074   }
00075   //ETX
00077 
00082   vtkGraphEdge *NextGraphEdge();
00083 
00085 
00086   bool HasNext()
00087   {
00088     return this->Current != this->End;
00089   }
00091 
00092 protected:
00093   vtkOutEdgeIterator();
00094   ~vtkOutEdgeIterator();
00095 
00097   virtual void SetGraph(vtkGraph *graph);
00098 
00099   vtkGraph            *Graph;
00100   const vtkOutEdgeType *Current;
00101   const vtkOutEdgeType *End;
00102   vtkIdType             Vertex;
00103   vtkGraphEdge        *GraphEdge;
00104 
00105 private:
00106   vtkOutEdgeIterator(const vtkOutEdgeIterator&);  // Not implemented.
00107   void operator=(const vtkOutEdgeIterator&);  // Not implemented.
00108 };
00109 
00110 #endif