VTK  9.0.1
vtkTreeIterator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTreeIterator.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 
31 #ifndef vtkTreeIterator_h
32 #define vtkTreeIterator_h
33 
34 #include "vtkCommonDataModelModule.h" // For export macro
35 #include "vtkObject.h"
36 
37 class vtkTree;
38 
39 class VTKCOMMONDATAMODEL_EXPORT vtkTreeIterator : public vtkObject
40 {
41 public:
42  vtkTypeMacro(vtkTreeIterator, vtkObject);
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
46 
49  void SetTree(vtkTree* graph);
50  vtkGetMacro(Tree, vtkTree*);
52 
54 
59  void SetStartVertex(vtkIdType vertex);
60  vtkGetMacro(StartVertex, vtkIdType);
62 
67 
71  bool HasNext();
72 
76  void Restart();
77 
78 protected:
80  ~vtkTreeIterator() override;
81 
82  virtual void Initialize() = 0;
83  virtual vtkIdType NextInternal() = 0;
84 
88 
89 private:
90  vtkTreeIterator(const vtkTreeIterator&) = delete;
91  void operator=(const vtkTreeIterator&) = delete;
92 };
93 
94 #endif
a simple class to control print indentation
Definition: vtkIndent.h:34
abstract base class for most VTK objects
Definition: vtkObject.h:63
Abstract class for iterator over a vtkTree.
vtkIdType Next()
The next vertex visited in the graph.
~vtkTreeIterator() override
vtkIdType StartVertex
bool HasNext()
Return true when all vertices have been visited.
void SetTree(vtkTree *graph)
Set/get the graph to iterate over.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetStartVertex(vtkIdType vertex)
The start vertex of the traversal.
virtual vtkIdType NextInternal()=0
void Restart()
Reset the iterator to its start vertex.
virtual void Initialize()=0
A rooted tree data structure.
Definition: vtkTree.h:55
int vtkIdType
Definition: vtkType.h:338