VTK  9.3.0
vtkInEdgeIterator.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
22#ifndef vtkInEdgeIterator_h
23#define vtkInEdgeIterator_h
24
25#include "vtkCommonDataModelModule.h" // For export macro
26#include "vtkObject.h"
27
28#include "vtkGraph.h" // For edge type definitions
29
30VTK_ABI_NAMESPACE_BEGIN
31class vtkGraphEdge;
32
33class VTKCOMMONDATAMODEL_EXPORT vtkInEdgeIterator : public vtkObject
34{
35public:
38 void PrintSelf(ostream& os, vtkIndent indent) override;
39
44
46
49 vtkGetObjectMacro(Graph, vtkGraph);
50 vtkGetMacro(Vertex, vtkIdType);
52
54
58 {
59 vtkInEdgeType e = *this->Current;
60 ++this->Current;
61 return e;
62 }
64
73
77 bool HasNext() { return this->Current != this->End; }
78
79protected:
82
87 virtual void SetGraph(vtkGraph* graph);
88
94
95private:
96 vtkInEdgeIterator(const vtkInEdgeIterator&) = delete;
97 void operator=(const vtkInEdgeIterator&) = delete;
98};
99
100VTK_ABI_NAMESPACE_END
101#endif
Representation of a single graph edge.
Base class for graph data types.
Definition vtkGraph.h:281
Iterates through all incoming edges to a vertex.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void SetGraph(vtkGraph *graph)
Protected method for setting the graph used by Initialize().
vtkInEdgeType Next()
Returns the next edge in the graph.
void Initialize(vtkGraph *g, vtkIdType v)
Initialize the iterator with a graph and vertex.
static vtkInEdgeIterator * New()
bool HasNext()
Whether this iterator has more edges.
const vtkInEdgeType * End
vtkGraphEdge * NextGraphEdge()
Just like Next(), but returns heavy-weight vtkGraphEdge object instead of the vtkEdgeType struct,...
vtkGraphEdge * GraphEdge
~vtkInEdgeIterator() override
const vtkInEdgeType * Current
a simple class to control print indentation
Definition vtkIndent.h:29
abstract base class for most VTK objects
Definition vtkObject.h:49
int vtkIdType
Definition vtkType.h:315