VTK  9.3.1
vtkAdjacentVertexIterator.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
21 #ifndef vtkAdjacentVertexIterator_h
22 #define vtkAdjacentVertexIterator_h
23 
24 #include "vtkCommonDataModelModule.h" // For export macro
25 #include "vtkObject.h"
26 
27 #include "vtkGraph.h" // For edge type definitions
28 
29 VTK_ABI_NAMESPACE_BEGIN
30 class vtkGraphEdge;
31 
32 class VTKCOMMONDATAMODEL_EXPORT vtkAdjacentVertexIterator : public vtkObject
33 {
34 public:
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
42  void Initialize(vtkGraph* g, vtkIdType v);
43 
45 
48  vtkGetObjectMacro(Graph, vtkGraph);
49  vtkGetMacro(Vertex, vtkIdType);
51 
53 
57  {
58  vtkOutEdgeType e = *this->Current;
59  ++this->Current;
60  return e.Target;
61  }
63 
67  bool HasNext() { return this->Current != this->End; }
68 
69 protected:
71  ~vtkAdjacentVertexIterator() override;
72 
77  virtual void SetGraph(vtkGraph* graph);
78 
83 
84 private:
86  void operator=(const vtkAdjacentVertexIterator&) = delete;
87 };
88 
89 VTK_ABI_NAMESPACE_END
90 #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.
Iterates through adjacent vertices in a 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.
Base class for graph data types.
Definition: vtkGraph.h:280
vtkIdType Next()
Returns the next edge in the graph.
a simple class to control print indentation
Definition: vtkIndent.h:28
vtkIdType Target
Definition: vtkGraph.h:253
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...