VTK  9.1.0
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
37class vtkTree;
38
39class VTKCOMMONDATAMODEL_EXPORT vtkTreeIterator : public vtkObject
40{
41public:
42 vtkTypeMacro(vtkTreeIterator, vtkObject);
43 void PrintSelf(ostream& os, vtkIndent indent) override;
44
46
49 void SetTree(vtkTree* tree);
50 vtkGetMacro(Tree, vtkTree*);
52
54
60 vtkGetMacro(StartVertex, vtkIdType);
62
67
71 bool HasNext();
72
76 void Restart();
77
78protected:
80 ~vtkTreeIterator() override;
81
82 virtual void Initialize() = 0;
83 virtual vtkIdType NextInternal() = 0;
84
88
89private:
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:113
abstract base class for most VTK objects
Definition: vtkObject.h:73
Abstract class for iterator over a vtkTree.
void SetTree(vtkTree *tree)
Set/get the graph to iterate over.
vtkIdType Next()
The next vertex visited in the graph.
~vtkTreeIterator() override
vtkIdType StartVertex
bool HasNext()
Return true when all vertices have been visited.
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:164
int vtkIdType
Definition: vtkType.h:332