VTK  9.4.20250113
vtkAdjacentVertexIterator.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3// SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
40#ifndef vtkAdjacentVertexIterator_h
41#define vtkAdjacentVertexIterator_h
42
43#include "vtkCommonDataModelModule.h" // For export macro
44#include "vtkObject.h"
45
46#include "vtkGraph.h" // For edge type definitions
47
48VTK_ABI_NAMESPACE_BEGIN
49class vtkGraphEdge;
50
51class VTKCOMMONDATAMODEL_EXPORT vtkAdjacentVertexIterator : public vtkObject
52{
53public:
56 void PrintSelf(ostream& os, vtkIndent indent) override;
57
62
64
67 vtkGetObjectMacro(Graph, vtkGraph);
68 vtkGetMacro(Vertex, vtkIdType);
70
72
76 {
77 vtkOutEdgeType e = *this->Current;
78 ++this->Current;
79 return e.Target;
80 }
82
86 bool HasNext() { return this->Current != this->End; }
87
88protected:
91
96 virtual void SetGraph(vtkGraph* graph);
97
102
103private:
105 void operator=(const vtkAdjacentVertexIterator&) = delete;
106};
107
108VTK_ABI_NAMESPACE_END
109#endif
Iterates through adjacent vertices in a graph.
~vtkAdjacentVertexIterator() override
vtkIdType Next()
Returns the next edge in the graph.
bool HasNext()
Whether this iterator has more edges.
virtual void SetGraph(vtkGraph *graph)
Protected method for setting the graph used by Initialize().
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkAdjacentVertexIterator * New()
void Initialize(vtkGraph *g, vtkIdType v)
Initialize the iterator with a graph and vertex.
Representation of a single graph edge.
Base class for graph data types.
Definition vtkGraph.h:340
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
vtkIdType Target
Definition vtkGraph.h:312
int vtkIdType
Definition vtkType.h:315