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 
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) VTK_OVERRIDE;
44 
46 
49  void SetTree(vtkTree* graph);
50  vtkGetMacro(Tree, vtkTree*);
52 
54 
59  void SetStartVertex(vtkIdType vertex);
60  vtkGetMacro(StartVertex, vtkIdType);
62 
66  vtkIdType Next();
67 
71  bool HasNext();
72 
76  void Restart();
77 
78 protected:
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 
89 private:
90  vtkTreeIterator(const vtkTreeIterator &) VTK_DELETE_FUNCTION;
91  void operator=(const vtkTreeIterator &) VTK_DELETE_FUNCTION;
92 };
93 
94 #endif
Abstract class for iterator over a vtkTree.
abstract base class for most VTK objects
Definition: vtkObject.h:59
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int vtkIdType
Definition: vtkType.h:287
a simple class to control print indentation
Definition: vtkIndent.h:39
A rooted tree data structure.
Definition: vtkTree.h:60