VTK
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 =========================================================================*/
29 #ifndef vtkDataObjectTreeIterator_h
30 #define vtkDataObjectTreeIterator_h
31 
32 #include "vtkCommonDataModelModule.h" // For export macro
34 #include "vtkSmartPointer.h" //to store data sets
35 
36 class vtkDataObjectTree;
39 class vtkDataObject;
40 class vtkInformation;
41 
42 class VTKCOMMONDATAMODEL_EXPORT vtkDataObjectTreeIterator : public vtkCompositeDataIterator
43 {
44 public:
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
52  void GoToFirstItem() override;
53 
57  void GoToNextItem() override;
58 
65  int IsDoneWithTraversal() override;
66 
71 
79 
84  int HasCurrentMetaData() override;
85 
91  unsigned int GetCurrentFlatIndex() override;
92 
94 
104  vtkSetMacro(VisitOnlyLeaves, int);
105  vtkGetMacro(VisitOnlyLeaves, int);
106  vtkBooleanMacro(VisitOnlyLeaves, int);
108 
110 
115  vtkSetMacro(TraverseSubTree, int);
116  vtkGetMacro(TraverseSubTree, int);
117  vtkBooleanMacro(TraverseSubTree, int);
119 
120 protected:
122  ~vtkDataObjectTreeIterator() override;
123 
124  // Takes the current location to the next dataset. This traverses the tree in
125  // preorder fashion.
126  // If the current location is a composite dataset, next is its 1st child dataset.
127  // If the current is not a composite dataset, then next is the next dataset.
128  // This method gives no guarantees whether the current dataset will be
129  // non-null or leaf.
130  void NextInternal();
131 
135  vtkDataObjectTreeIndex GetCurrentIndex();
136 
137  // Needs access to GetCurrentIndex().
138  friend class vtkDataObjectTree;
139  friend class vtkMultiDataSetInternal;
140 
141  unsigned int CurrentFlatIndex;
142 
143 private:
145  void operator=(const vtkDataObjectTreeIterator&) = delete;
146 
147  class vtkInternals;
148  vtkInternals* Internals;
149  friend class vtkInternals;
150 
151  int TraverseSubTree;
152  int VisitOnlyLeaves;
153 
159 
160  // Cannot be called when this->IsDoneWithTraversal() return 1.
161  void UpdateLocation();
162 
163 };
164 
165 #endif
virtual int IsDoneWithTraversal()=0
Test whether the iterator is finished with the traversal.
provides implementation for most abstract methods in the superclass vtkCompositeDataSet ...
Store vtkAlgorithm input/output information.
virtual vtkInformation * GetCurrentMetaData()=0
Returns the meta-data associated with the current item.
virtual int HasCurrentMetaData()=0
Returns if the a meta-data information object is present for the current item.
virtual void GoToNextItem()=0
Move the iterator to the next item in the collection.
superclass for composite data iterators
virtual void GoToFirstItem()=0
Move the iterator to the beginning of the collection.
a simple class to control print indentation
Definition: vtkIndent.h:39
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
virtual vtkDataObject * GetCurrentDataObject()=0
Returns the current item.
superclass for composite data iterators
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
general representation of visualization data
Definition: vtkDataObject.h:64
virtual unsigned int GetCurrentFlatIndex()=0
Flat index is an index to identify the data in a composite data structure.