VTK
dox/Filtering/vtkInEdgeIterator.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkInEdgeIterator.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 -------------------------------------------------------------------------*/
00037 #ifndef __vtkInEdgeIterator_h
00038 #define __vtkInEdgeIterator_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 vtkInEdgeIterator : public vtkObject
00047 {
00048 public:
00049   static vtkInEdgeIterator *New();
00050   vtkTypeMacro(vtkInEdgeIterator, 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 vtkInEdgeType Next()
00066   {
00067     vtkInEdgeType 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   vtkInEdgeIterator();
00090   ~vtkInEdgeIterator();
00091 
00093   virtual void SetGraph(vtkGraph *graph);  
00094 
00095   vtkGraph           *Graph;
00096   const vtkInEdgeType *Current;
00097   const vtkInEdgeType *End;
00098   vtkIdType            Vertex;
00099   vtkGraphEdge       *GraphEdge;
00100 
00101 private:
00102   vtkInEdgeIterator(const vtkInEdgeIterator&);  // Not implemented.
00103   void operator=(const vtkInEdgeIterator&);  // Not implemented.
00104 };
00105 
00106 #endif