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 =========================================================================*/
23 #ifndef vtkDataObjectTreeIterator_h
24 #define vtkDataObjectTreeIterator_h
25 
26 #include "vtkCommonDataModelModule.h" // For export macro
28 #include "vtkSmartPointer.h" //to store data sets
29 
30 class vtkDataObjectTree;
33 class vtkDataObject;
34 class vtkInformation;
35 
36 class VTKCOMMONDATAMODEL_EXPORT vtkDataObjectTreeIterator : public vtkCompositeDataIterator
37 {
38 public:
41  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
42 
46  void GoToFirstItem() VTK_OVERRIDE;
47 
51  void GoToNextItem() VTK_OVERRIDE;
52 
59  int IsDoneWithTraversal() VTK_OVERRIDE;
60 
64  vtkDataObject* GetCurrentDataObject() VTK_OVERRIDE;
65 
72  vtkInformation* GetCurrentMetaData() VTK_OVERRIDE;
73 
78  int HasCurrentMetaData() VTK_OVERRIDE;
79 
85  unsigned int GetCurrentFlatIndex() VTK_OVERRIDE;
86 
88 
98  vtkSetMacro(VisitOnlyLeaves, int);
99  vtkGetMacro(VisitOnlyLeaves, int);
100  vtkBooleanMacro(VisitOnlyLeaves, int);
102 
104 
109  vtkSetMacro(TraverseSubTree, int);
110  vtkGetMacro(TraverseSubTree, int);
111  vtkBooleanMacro(TraverseSubTree, int);
113 
114 protected:
116  ~vtkDataObjectTreeIterator() VTK_OVERRIDE;
117 
118  // Takes the current location to the next dataset. This traverses the tree in
119  // preorder fashion.
120  // If the current location is a composite dataset, next is its 1st child dataset.
121  // If the current is not a composite dataset, then next is the next dataset.
122  // This method gives no guarantees whether the current dataset will be
123  // non-null or leaf.
124  void NextInternal();
125 
129  vtkDataObjectTreeIndex GetCurrentIndex();
130 
131  // Needs access to GetCurrentIndex().
132  friend class vtkDataObjectTree;
133  friend class vtkMultiDataSetInternal;
134 
135  unsigned int CurrentFlatIndex;
136 
137 private:
138  vtkDataObjectTreeIterator(const vtkDataObjectTreeIterator&) VTK_DELETE_FUNCTION;
139  void operator=(const vtkDataObjectTreeIterator&) VTK_DELETE_FUNCTION;
140 
141  class vtkInternals;
142  vtkInternals* Internals;
143  friend class vtkInternals;
144 
145  int TraverseSubTree;
146  int VisitOnlyLeaves;
147 
152  vtkDataObjectTreeInternals* GetInternals(vtkDataObjectTree*);
153 
154  // Cannot be called when this->IsDoneWithTraversal() return 1.
155  void UpdateLocation();
156 
157 };
158 
159 #endif
provides implementation for most abstract methods in the superclass vtkCompositeDataSet ...
Store vtkAlgorithm input/output information.
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:33
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.
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:58