VTK  9.3.0
vtkOutEdgeIterator.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
25#ifndef vtkOutEdgeIterator_h
26#define vtkOutEdgeIterator_h
27
28#include "vtkCommonDataModelModule.h" // For export macro
29#include "vtkObject.h"
30
31#include "vtkGraph.h" // For edge type definitions
32
33VTK_ABI_NAMESPACE_BEGIN
34class vtkGraphEdge;
35
36class VTKCOMMONDATAMODEL_EXPORT vtkOutEdgeIterator : public vtkObject
37{
38public:
41 void PrintSelf(ostream& os, vtkIndent indent) override;
42
47
49
52 vtkGetObjectMacro(Graph, vtkGraph);
53 vtkGetMacro(Vertex, vtkIdType);
55
57
61 {
62 vtkOutEdgeType e = *this->Current;
63 ++this->Current;
64 return e;
65 }
67
76
80 bool HasNext() { return this->Current != this->End; }
81
82protected:
85
90 virtual void SetGraph(vtkGraph* graph);
91
97
98private:
100 void operator=(const vtkOutEdgeIterator&) = delete;
101};
102
103VTK_ABI_NAMESPACE_END
104#endif
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
Iterates through all outgoing edges from a vertex.
const vtkOutEdgeType * End
static vtkOutEdgeIterator * New()
virtual void SetGraph(vtkGraph *graph)
Protected method for setting the graph used by Initialize().
const vtkOutEdgeType * Current
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkGraphEdge * NextGraphEdge()
Just like Next(), but returns heavy-weight vtkGraphEdge object instead of the vtkEdgeType struct,...
bool HasNext()
Whether this iterator has more edges.
~vtkOutEdgeIterator() override
vtkOutEdgeType Next()
Returns the next edge in the graph.
void Initialize(vtkGraph *g, vtkIdType v)
Initialize the iterator with a graph and vertex.
vtkGraphEdge * GraphEdge
int vtkIdType
Definition vtkType.h:315