VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/Common/DataModel/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 "vtkCommonDataModelModule.h" // For export macro
00041 #include "vtkObject.h"
00042 
00043 #include "vtkGraph.h" // For edge type definitions
00044 
00045 class vtkGraphEdge;
00046 
00047 class VTKCOMMONDATAMODEL_EXPORT vtkInEdgeIterator : public vtkObject
00048 {
00049 public:
00050   static vtkInEdgeIterator *New();
00051   vtkTypeMacro(vtkInEdgeIterator, vtkObject);
00052   void PrintSelf(ostream& os, vtkIndent indent);
00053 
00055   void Initialize(vtkGraph *g, vtkIdType v);
00056 
00058 
00059   vtkGetObjectMacro(Graph, vtkGraph);
00060   vtkGetMacro(Vertex, vtkIdType);
00062 
00063   //BTX
00065 
00066   inline vtkInEdgeType Next()
00067   {
00068     vtkInEdgeType e = *this->Current;
00069     ++this->Current;
00070     return e;
00071   }
00072   //ETX
00074 
00079   vtkGraphEdge *NextGraphEdge();
00080 
00082 
00083   bool HasNext()
00084   {
00085     return this->Current != this->End;
00086   }
00088 
00089 protected:
00090   vtkInEdgeIterator();
00091   ~vtkInEdgeIterator();
00092 
00094   virtual void SetGraph(vtkGraph *graph);
00095 
00096   vtkGraph           *Graph;
00097   const vtkInEdgeType *Current;
00098   const vtkInEdgeType *End;
00099   vtkIdType            Vertex;
00100   vtkGraphEdge       *GraphEdge;
00101 
00102 private:
00103   vtkInEdgeIterator(const vtkInEdgeIterator&);  // Not implemented.
00104   void operator=(const vtkInEdgeIterator&);  // Not implemented.
00105 };
00106 
00107 #endif