VTK: Common/DataModel/vtkInEdgeIterator.h Source File

| VTK 9.3.1

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
39 VTK_ABI_NAMESPACE_BEGIN
40 class vtkGraphEdge;
41
42 class VTKCOMMONDATAMODEL_EXPORT vtkInEdgeIterator : public vtkObject
43 {
44 public:
45 static vtkInEdgeIterator* New();
46 vtkTypeMacro(vtkInEdgeIterator, vtkObject);
47 void PrintSelf(ostream& os, vtkIndent indent) override;
48
52 void Initialize(vtkGraph* g, vtkIdType v);
53
55
58 vtkGetObjectMacro(Graph, vtkGraph);
59 vtkGetMacro(Vertex, vtkIdType);
61
63
66 inline vtkInEdgeType Next()
67 {
68 vtkInEdgeType e = *this->Current;
69 ++this->Current;
70 return e;
71 }
73
81 vtkGraphEdge* NextGraphEdge();
82
86 bool HasNext() { return this->Current != this->End; }
87
88 protected:
89 vtkInEdgeIterator();
90 ~vtkInEdgeIterator() override;
91
96 virtual void SetGraph(vtkGraph* graph);
97
98 vtkGraph* Graph;
99 const vtkInEdgeType* Current;
100 const vtkInEdgeType* End;
101 vtkIdType Vertex;
102 vtkGraphEdge* GraphEdge;
103
104 private:
105 vtkInEdgeIterator(const vtkInEdgeIterator&) = delete;
106 void operator=(const vtkInEdgeIterator&) = delete;
107 };
108
109 VTK_ABI_NAMESPACE_END
110 #endif
vtkGraphEdge
Representation of a single graph edge.
Definition: vtkGraphEdge.h:25
vtkGraph
Base class for graph data types.
Definition: vtkGraph.h:290
vtkInEdgeIterator
Iterates through all incoming edges to a vertex.
Definition: vtkInEdgeIterator.h:43
vtkInEdgeIterator::vtkInEdgeIterator
vtkInEdgeIterator()
vtkInEdgeIterator::Vertex
vtkIdType Vertex
Definition: vtkInEdgeIterator.h:101
vtkInEdgeIterator::Graph
vtkGraph * Graph
Definition: vtkInEdgeIterator.h:98
vtkInEdgeIterator::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkInEdgeIterator::SetGraph
virtual void SetGraph(vtkGraph *graph)
Protected method for setting the graph used by Initialize().
vtkInEdgeIterator::New
static vtkInEdgeIterator * New()
vtkInEdgeIterator::Next
vtkInEdgeType Next()
Returns the next edge in the graph.
Definition: vtkInEdgeIterator.h:66
vtkInEdgeIterator::Initialize
void Initialize(vtkGraph *g, vtkIdType v)
Initialize the iterator with a graph and vertex.
vtkInEdgeIterator::HasNext
bool HasNext()
Whether this iterator has more edges.
Definition: vtkInEdgeIterator.h:86
vtkInEdgeIterator::End
const vtkInEdgeType * End
Definition: vtkInEdgeIterator.h:100
vtkInEdgeIterator::NextGraphEdge
vtkGraphEdge * NextGraphEdge()
Just like Next(), but returns heavy-weight vtkGraphEdge object instead of the vtkEdgeType struct,...
vtkInEdgeIterator::GraphEdge
vtkGraphEdge * GraphEdge
Definition: vtkInEdgeIterator.h:102
vtkInEdgeIterator::~vtkInEdgeIterator
~vtkInEdgeIterator() override
vtkInEdgeIterator::Current
const vtkInEdgeType * Current
Definition: vtkInEdgeIterator.h:99
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkInEdgeType
Definition: vtkGraph.h:266
vtkGraph.h
vtkObject.h
vtkIdType
int vtkIdType
Definition: vtkType.h:315