VTK
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) VTK_OVERRIDE;
44
46
49 void SetTree(vtkTree* graph);
50 vtkGetMacro(Tree, vtkTree*);
52
54
60 vtkGetMacro(StartVertex, vtkIdType);
62
67
71 bool HasNext();
72
76 void Restart();
77
78protected:
80 ~vtkTreeIterator() VTK_OVERRIDE;
81
82 virtual void Initialize() = 0;
83 virtual vtkIdType NextInternal() = 0;
84
85 vtkTree* Tree;
86 vtkIdType StartVertex;
87 vtkIdType NextId;
88
89private:
90 vtkTreeIterator(const vtkTreeIterator &) VTK_DELETE_FUNCTION;
91 void operator=(const vtkTreeIterator &) VTK_DELETE_FUNCTION;
92};
93
94#endif
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract base class for most VTK objects
Definition: vtkObject.h:60
Abstract class for iterator over a vtkTree.
vtkIdType Next()
The next vertex visited in the graph.
~vtkTreeIterator() override
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.
void Restart()
Reset the iterator to its start vertex.
A rooted tree data structure.
Definition: vtkTree.h:61
int vtkIdType
Definition: vtkType.h:287