VTK  9.3.0
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
21#ifndef vtkAdjacentVertexIterator_h
22#define vtkAdjacentVertexIterator_h
23
24#include "vtkCommonDataModelModule.h" // For export macro
25#include "vtkObject.h"
26
27#include "vtkGraph.h" // For edge type definitions
28
29VTK_ABI_NAMESPACE_BEGIN
30class vtkGraphEdge;
31
32class VTKCOMMONDATAMODEL_EXPORT vtkAdjacentVertexIterator : public vtkObject
33{
34public:
37 void PrintSelf(ostream& os, vtkIndent indent) override;
38
43
45
48 vtkGetObjectMacro(Graph, vtkGraph);
49 vtkGetMacro(Vertex, vtkIdType);
51
53
57 {
58 vtkOutEdgeType e = *this->Current;
59 ++this->Current;
60 return e.Target;
61 }
63
67 bool HasNext() { return this->Current != this->End; }
68
69protected:
72
77 virtual void SetGraph(vtkGraph* graph);
78
83
84private:
86 void operator=(const vtkAdjacentVertexIterator&) = delete;
87};
88
89VTK_ABI_NAMESPACE_END
90#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:281
a simple class to control print indentation
Definition vtkIndent.h:29
abstract base class for most VTK objects
Definition vtkObject.h:49
vtkIdType Target
Definition vtkGraph.h:253
int vtkIdType
Definition vtkType.h:315