VTK
vtkCompositeDataIterator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCompositeDataIterator.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 =========================================================================*/
28 #ifndef __vtkCompositeDataIterator_h
29 #define __vtkCompositeDataIterator_h
30 
31 #include "vtkObject.h"
32 
36 class vtkDataObject;
37 class vtkInformation;
38 
40 {
41 public:
42  static vtkCompositeDataIterator* New();
44  void PrintSelf(ostream& os, vtkIndent indent);
45 
47 
49  virtual void SetDataSet(vtkCompositeDataSet* ds);
50  vtkGetObjectMacro(DataSet, vtkCompositeDataSet);
52 
54  virtual void InitTraversal();
55 
58  virtual void InitReverseTraversal();
59 
61  virtual void GoToFirstItem();
62 
64  virtual void GoToNextItem();
65 
69  virtual int IsDoneWithTraversal();
70 
73  virtual vtkDataObject* GetCurrentDataObject();
74 
79  virtual vtkInformation* GetCurrentMetaData();
80 
83  virtual int HasCurrentMetaData();
84 
86 
94  vtkSetMacro(VisitOnlyLeaves, int);
95  vtkGetMacro(VisitOnlyLeaves, int);
96  vtkBooleanMacro(VisitOnlyLeaves, int);
98 
100 
103  vtkSetMacro(TraverseSubTree, int);
104  vtkGetMacro(TraverseSubTree, int);
105  vtkBooleanMacro(TraverseSubTree, int);
107 
108 
110 
112  vtkSetMacro(SkipEmptyNodes, int);
113  vtkGetMacro(SkipEmptyNodes, int);
114  vtkBooleanMacro(SkipEmptyNodes, int);
116 
120  unsigned int GetCurrentFlatIndex();
121 
123 
124  vtkGetMacro(Reverse, int);
126 
127 //BTX
128 protected:
130  virtual ~vtkCompositeDataIterator();
131 
132  // Takes the current location to the next dataset. This traverses the tree in
133  // preorder fashion.
134  // If the current location is a composite dataset, next is its 1st child dataset.
135  // If the current is not a composite dataset, then next is the next dataset.
136  // This method gives no guarantees whether the current dataset will be
137  // non-null or leaf.
138  void NextInternal();
139 
141  vtkCompositeDataSetIndex GetCurrentIndex();
142 
143  // Needs access to GetCurrentIndex().
144  friend class vtkCompositeDataSet;
145 
146  unsigned int CurrentFlatIndex;
147 
150  int Reverse;
153 private:
154  vtkCompositeDataIterator(const vtkCompositeDataIterator&); // Not implemented.
155  void operator=(const vtkCompositeDataIterator&); // Not implemented.
156 
157  class vtkInternals;
158  vtkInternals* Internals;
159  friend class vtkInternals;
160 
164 
165  // Cannot be called when this->IsDoneWithTraversal() return 1.
166  void UpdateLocation();
167 //ETX
168 };
169 
170 #endif
171 
172