VTK
dox/Filtering/vtkCompositeDataIterator.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkCompositeDataIterator.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00028 #ifndef __vtkCompositeDataIterator_h
00029 #define __vtkCompositeDataIterator_h
00030 
00031 #include "vtkObject.h"
00032 
00033 class vtkCompositeDataSet;
00034 class vtkCompositeDataSetInternals;
00035 class vtkCompositeDataSetIndex;
00036 class vtkDataObject;
00037 class vtkInformation;
00038 
00039 class VTK_FILTERING_EXPORT vtkCompositeDataIterator : public vtkObject
00040 {
00041 public:
00042   static vtkCompositeDataIterator* New();
00043   vtkTypeMacro(vtkCompositeDataIterator, vtkObject);
00044   void PrintSelf(ostream& os, vtkIndent indent);
00045 
00047 
00049   virtual void SetDataSet(vtkCompositeDataSet* ds);
00050   vtkGetObjectMacro(DataSet, vtkCompositeDataSet);
00052 
00054   virtual void InitTraversal();
00055 
00058   virtual void InitReverseTraversal();
00059 
00061   virtual void GoToFirstItem();
00062 
00064   virtual void GoToNextItem();
00065 
00069   virtual int IsDoneWithTraversal();
00070 
00073   virtual vtkDataObject* GetCurrentDataObject();
00074 
00079   virtual vtkInformation* GetCurrentMetaData();
00080 
00083   virtual int HasCurrentMetaData();
00084 
00086 
00094   vtkSetMacro(VisitOnlyLeaves, int);
00095   vtkGetMacro(VisitOnlyLeaves, int);
00096   vtkBooleanMacro(VisitOnlyLeaves, int);
00098 
00100 
00103   vtkSetMacro(TraverseSubTree, int);
00104   vtkGetMacro(TraverseSubTree, int);
00105   vtkBooleanMacro(TraverseSubTree, int);
00107 
00108 
00110 
00112   vtkSetMacro(SkipEmptyNodes, int);
00113   vtkGetMacro(SkipEmptyNodes, int);
00114   vtkBooleanMacro(SkipEmptyNodes, int);
00116 
00120   unsigned int GetCurrentFlatIndex();
00121 
00123 
00124   vtkGetMacro(Reverse, int);
00126 
00127 //BTX
00128 protected:
00129   vtkCompositeDataIterator();
00130   virtual ~vtkCompositeDataIterator();
00131 
00132   // Takes the current location to the next dataset. This traverses the tree in
00133   // preorder fashion.
00134   // If the current location is a composite dataset, next is its 1st child dataset.
00135   // If the current is not a composite dataset, then next is the next dataset.
00136   // This method gives no guarantees  whether the current dataset will be
00137   // non-null or leaf.
00138   void NextInternal();
00139 
00141   vtkCompositeDataSetIndex GetCurrentIndex();
00142 
00143   // Needs access to GetCurrentIndex().
00144   friend class vtkCompositeDataSet;
00145 
00146   unsigned int CurrentFlatIndex;
00147 
00148   int SkipEmptyNodes;
00149   int TraverseSubTree;
00150   int Reverse;
00151   int VisitOnlyLeaves;
00152   vtkCompositeDataSet* DataSet;
00153 private:
00154   vtkCompositeDataIterator(const vtkCompositeDataIterator&); // Not implemented.
00155   void operator=(const vtkCompositeDataIterator&); // Not implemented.
00156 
00157   class vtkInternals;
00158   vtkInternals* Internals;
00159   friend class vtkInternals;
00160 
00163   vtkCompositeDataSetInternals* GetInternals(vtkCompositeDataSet*);
00164 
00165   // Cannot be called when this->IsDoneWithTraversal() return 1.
00166   void UpdateLocation();
00167 //ETX
00168 };
00169 
00170 #endif
00171 
00172