VTK  9.4.20241221
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
41#ifndef vtkInEdgeIterator_h
42#define vtkInEdgeIterator_h
43
44#include "vtkCommonDataModelModule.h" // For export macro
45#include "vtkObject.h"
46
47#include "vtkGraph.h" // For edge type definitions
48
49VTK_ABI_NAMESPACE_BEGIN
50class vtkGraphEdge;
51
52class VTKCOMMONDATAMODEL_EXPORT vtkInEdgeIterator : public vtkObject
53{
54public:
57 void PrintSelf(ostream& os, vtkIndent indent) override;
58
63
65
68 vtkGetObjectMacro(Graph, vtkGraph);
69 vtkGetMacro(Vertex, vtkIdType);
71
73
77 {
78 vtkInEdgeType e = *this->Current;
79 ++this->Current;
80 return e;
81 }
83
92
96 bool HasNext() { return this->Current != this->End; }
97
98protected:
101
106 virtual void SetGraph(vtkGraph* graph);
107
113
114private:
115 vtkInEdgeIterator(const vtkInEdgeIterator&) = delete;
116 void operator=(const vtkInEdgeIterator&) = delete;
117};
118
119VTK_ABI_NAMESPACE_END
120#endif
Representation of a single graph edge.
Base class for graph data types.
Definition vtkGraph.h:340
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:108
abstract base class for most VTK objects
Definition vtkObject.h:162
int vtkIdType
Definition vtkType.h:315