VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 =========================================================================*/
25 #ifndef __vtkDataObjectTreeIterator_h
26 #define __vtkDataObjectTreeIterator_h
27 
28 #include "vtkCommonDataModelModule.h" // For export macro
29 #include "vtkCompositeDataIterator.h"
30 #include "vtkSmartPointer.h" //to store data sets
31 
32 class vtkDataObjectTree;
33 class vtkDataObjectTreeInternals;
34 class vtkDataObjectTreeIndex;
35 class vtkDataObject;
36 class vtkInformation;
37 
38 class VTKCOMMONDATAMODEL_EXPORT vtkDataObjectTreeIterator : public vtkCompositeDataIterator
39 {
40 public:
41  static vtkDataObjectTreeIterator* New();
42  vtkTypeMacro(vtkDataObjectTreeIterator, vtkCompositeDataIterator);
43  void PrintSelf(ostream& os, vtkIndent indent);
44 
46  virtual void GoToFirstItem();
47 
49  virtual void GoToNextItem();
50 
54  virtual int IsDoneWithTraversal();
55 
58  virtual vtkDataObject* GetCurrentDataObject();
59 
64  virtual vtkInformation* GetCurrentMetaData();
65 
68  virtual int HasCurrentMetaData();
69 
73  virtual unsigned int GetCurrentFlatIndex();
74 
76 
84  vtkSetMacro(VisitOnlyLeaves, int);
85  vtkGetMacro(VisitOnlyLeaves, int);
86  vtkBooleanMacro(VisitOnlyLeaves, int);
88 
90 
93  vtkSetMacro(TraverseSubTree, int);
94  vtkGetMacro(TraverseSubTree, int);
95  vtkBooleanMacro(TraverseSubTree, int);
97 
98 //BTX
99 protected:
101  virtual ~vtkDataObjectTreeIterator();
102 
103  // Takes the current location to the next dataset. This traverses the tree in
104  // preorder fashion.
105  // If the current location is a composite dataset, next is its 1st child dataset.
106  // If the current is not a composite dataset, then next is the next dataset.
107  // This method gives no guarantees whether the current dataset will be
108  // non-null or leaf.
109  void NextInternal();
110 
112  vtkDataObjectTreeIndex GetCurrentIndex();
113 
114  // Needs access to GetCurrentIndex().
115  friend class vtkDataObjectTree;
116  friend class vtkMultiDataSetInternal;
117 
118  unsigned int CurrentFlatIndex;
119 
120 private:
121  vtkDataObjectTreeIterator(const vtkDataObjectTreeIterator&); // Not implemented.
122  void operator=(const vtkDataObjectTreeIterator&); // Not implemented.
123 
124  class vtkInternals;
125  vtkInternals* Internals;
126  friend class vtkInternals;
127 
128  int TraverseSubTree;
129  int VisitOnlyLeaves;
130 
133  vtkDataObjectTreeInternals* GetInternals(vtkDataObjectTree*);
134 
135  // Cannot be called when this->IsDoneWithTraversal() return 1.
136  void UpdateLocation();
137 //ETX
138 };
139 
140 #endif
Store vtkAlgorithm input/output information.
a simple class to control print indentation
Definition: vtkIndent.h:38
superclass for composite data iterators
general representation of visualization data
Definition: vtkDataObject.h:64