VTK  9.2.6
vtkDataObjectTreeIterator.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkDataObjectTreeIterator.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=========================================================================*/
35#ifndef vtkDataObjectTreeIterator_h
36#define vtkDataObjectTreeIterator_h
37
38#include "vtkCommonDataModelModule.h" // For export macro
40#include "vtkSmartPointer.h" //to store data sets
41
45class vtkDataObject;
46class vtkInformation;
47
48class VTKCOMMONDATAMODEL_EXPORT vtkDataObjectTreeIterator : public vtkCompositeDataIterator
49{
50public:
53 void PrintSelf(ostream& os, vtkIndent indent) override;
54
58 void GoToFirstItem() override;
59
63 void GoToNextItem() override;
64
71 int IsDoneWithTraversal() override;
72
77
85
90 int HasCurrentMetaData() override;
91
97 unsigned int GetCurrentFlatIndex() override;
98
100
110 vtkSetMacro(VisitOnlyLeaves, vtkTypeBool);
111 vtkGetMacro(VisitOnlyLeaves, vtkTypeBool);
112 vtkBooleanMacro(VisitOnlyLeaves, vtkTypeBool);
114
116
121 vtkSetMacro(TraverseSubTree, vtkTypeBool);
122 vtkGetMacro(TraverseSubTree, vtkTypeBool);
123 vtkBooleanMacro(TraverseSubTree, vtkTypeBool);
125
126protected:
129
130 // Use the macro to ensure MTime is updated:
131 vtkSetMacro(CurrentFlatIndex, unsigned int);
132
133 // Takes the current location to the next dataset. This traverses the tree in
134 // preorder fashion.
135 // If the current location is a composite dataset, next is its 1st child dataset.
136 // If the current is not a composite dataset, then next is the next dataset.
137 // This method gives no guarantees whether the current dataset will be
138 // non-null or leaf.
140
145
146 // Needs access to GetCurrentIndex().
147 friend class vtkDataObjectTree;
148 friend class vtkMultiDataSetInternal;
149
150 unsigned int CurrentFlatIndex;
151
152private:
154 void operator=(const vtkDataObjectTreeIterator&) = delete;
155
156 class vtkInternals;
157 vtkInternals* Internals;
158 friend class vtkInternals;
159
160 vtkTypeBool TraverseSubTree;
161 vtkTypeBool VisitOnlyLeaves;
162
168
169 // Cannot be called when this->IsDoneWithTraversal() return 1.
170 void UpdateLocation();
171};
172
173#endif
superclass for composite data iterators
superclass for composite data iterators
vtkDataObject * GetCurrentDataObject() override
Returns the current item.
int IsDoneWithTraversal() override
Test whether the iterator is finished with the traversal.
vtkInformation * GetCurrentMetaData() override
Returns the meta-data associated with the current item.
int HasCurrentMetaData() override
Returns if the a meta-data information object is present for the current item.
void GoToFirstItem() override
Move the iterator to the beginning of the collection.
~vtkDataObjectTreeIterator() override
void GoToNextItem() override
Move the iterator to the next item in the collection.
vtkDataObjectTreeIndex GetCurrentIndex()
Returns the index for the current data object.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
unsigned int GetCurrentFlatIndex() override
Flat index is an index obtained by traversing the tree in preorder.
static vtkDataObjectTreeIterator * New()
provides implementation for most abstract methods in the superclass vtkCompositeDataSet
general representation of visualization data
a simple class to control print indentation
Definition vtkIndent.h:49
Store vtkAlgorithm input/output information.
int vtkTypeBool
Definition vtkABI.h:69