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
22 #ifndef vtkInEdgeIterator_h
23 #define vtkInEdgeIterator_h
24 
25 #include "vtkCommonDataModelModule.h" // For export macro
26 #include "vtkObject.h"
27 
28 #include "vtkGraph.h" // For edge type definitions
29 
30 VTK_ABI_NAMESPACE_BEGIN
31 class vtkGraphEdge;
32 
33 class VTKCOMMONDATAMODEL_EXPORT vtkInEdgeIterator : public vtkObject
34 {
35 public:
36  static vtkInEdgeIterator* New();
37  vtkTypeMacro(vtkInEdgeIterator, vtkObject);
38  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
43  void Initialize(vtkGraph* g, vtkIdType v);
44 
46 
49  vtkGetObjectMacro(Graph, vtkGraph);
50  vtkGetMacro(Vertex, vtkIdType);
52 
54 
58  {
59  vtkInEdgeType e = *this->Current;
60  ++this->Current;
61  return e;
62  }
64 
72  vtkGraphEdge* NextGraphEdge();
73 
77  bool HasNext() { return this->Current != this->End; }
78 
79 protected:
81  ~vtkInEdgeIterator() override;
82 
87  virtual void SetGraph(vtkGraph* graph);
88 
94 
95 private:
96  vtkInEdgeIterator(const vtkInEdgeIterator&) = delete;
97  void operator=(const vtkInEdgeIterator&) = delete;
98 };
99 
100 VTK_ABI_NAMESPACE_END
101 #endif
vtkInEdgeType Next()
Returns the next edge in the graph.
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.
Representation of a single graph edge.
Definition: vtkGraphEdge.h:24
bool HasNext()
Whether this iterator has more edges.
int vtkIdType
Definition: vtkType.h:315
vtkGraphEdge * GraphEdge
Base class for graph data types.
Definition: vtkGraph.h:280
a simple class to control print indentation
Definition: vtkIndent.h:28
Iterates through all incoming edges to a vertex.
const vtkInEdgeType * End
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
const vtkInEdgeType * Current