VTK  9.3.1
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:
39  static vtkOutEdgeIterator* New();
40  vtkTypeMacro(vtkOutEdgeIterator, vtkObject);
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
46  void Initialize(vtkGraph* g, vtkIdType v);
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 
75  vtkGraphEdge* NextGraphEdge();
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
abstract base class for most VTK objects
Definition: vtkObject.h:51
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkOutEdgeType Next()
Returns the next edge in the graph.
Representation of a single graph edge.
Definition: vtkGraphEdge.h:24
int vtkIdType
Definition: vtkType.h:315
bool HasNext()
Whether this iterator has more edges.
const vtkOutEdgeType * Current
Base class for graph data types.
Definition: vtkGraph.h:280
a simple class to control print indentation
Definition: vtkIndent.h:28
const vtkOutEdgeType * End
Iterates through all outgoing edges from a vertex.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkGraphEdge * GraphEdge