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 
33 VTK_ABI_NAMESPACE_BEGIN
34 class vtkGraphEdge;
35 
36 class VTKCOMMONDATAMODEL_EXPORT vtkOutEdgeIterator : public vtkObject
37 {
38 public:
40  vtkTypeMacro(vtkOutEdgeIterator, vtkObject);
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 
82 protected:
84  ~vtkOutEdgeIterator() override;
85 
90  virtual void SetGraph(vtkGraph* graph);
91 
97 
98 private:
99  vtkOutEdgeIterator(const vtkOutEdgeIterator&) = delete;
100  void operator=(const vtkOutEdgeIterator&) = delete;
101 };
102 
103 VTK_ABI_NAMESPACE_END
104 #endif
Representation of a single graph edge.
Definition: vtkGraphEdge.h:25
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:52
Iterates through all outgoing edges from a vertex.
const vtkOutEdgeType * End
virtual void SetGraph(vtkGraph *graph)
Protected method for setting the graph used by Initialize().
vtkGraphEdge * NextGraphEdge()
Just like Next(), but returns heavy-weight vtkGraphEdge object instead of the vtkEdgeType struct,...
const vtkOutEdgeType * Current
static vtkOutEdgeIterator * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
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