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
31#ifndef vtkInEdgeIterator_h
32#define vtkInEdgeIterator_h
33
34#include "vtkCommonDataModelModule.h" // For export macro
35#include "vtkObject.h"
36
37#include "vtkGraph.h" // For edge type definitions
38
39VTK_ABI_NAMESPACE_BEGIN
40class vtkGraphEdge;
41
42class VTKCOMMONDATAMODEL_EXPORT vtkInEdgeIterator : public vtkObject
43{
44public:
47 void PrintSelf(ostream& os, vtkIndent indent) override;
48
53
55
58 vtkGetObjectMacro(Graph, vtkGraph);
59 vtkGetMacro(Vertex, vtkIdType);
61
63
67 {
68 vtkInEdgeType e = *this->Current;
69 ++this->Current;
70 return e;
71 }
73
82
86 bool HasNext() { return this->Current != this->End; }
87
88protected:
91
96 virtual void SetGraph(vtkGraph* graph);
97
103
104private:
105 vtkInEdgeIterator(const vtkInEdgeIterator&) = delete;
106 void operator=(const vtkInEdgeIterator&) = delete;
107};
108
109VTK_ABI_NAMESPACE_END
110#endif
Representation of a single graph edge.
Base class for graph data types.
Definition vtkGraph.h:290
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:38
abstract base class for most VTK objects
Definition vtkObject.h:58
int vtkIdType
Definition vtkType.h:315