VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkDataObjectTreeIterator.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 =========================================================================*/ 00025 #ifndef __vtkDataObjectTreeIterator_h 00026 #define __vtkDataObjectTreeIterator_h 00027 00028 #include "vtkCommonDataModelModule.h" // For export macro 00029 #include "vtkCompositeDataIterator.h" 00030 #include "vtkSmartPointer.h" //to store data sets 00031 00032 class vtkDataObjectTree; 00033 class vtkDataObjectTreeInternals; 00034 class vtkDataObjectTreeIndex; 00035 class vtkDataObject; 00036 class vtkInformation; 00037 00038 class VTKCOMMONDATAMODEL_EXPORT vtkDataObjectTreeIterator : public vtkCompositeDataIterator 00039 { 00040 public: 00041 static vtkDataObjectTreeIterator* New(); 00042 vtkTypeMacro(vtkDataObjectTreeIterator, vtkCompositeDataIterator); 00043 void PrintSelf(ostream& os, vtkIndent indent); 00044 00046 virtual void GoToFirstItem(); 00047 00049 virtual void GoToNextItem(); 00050 00054 virtual int IsDoneWithTraversal(); 00055 00058 virtual vtkDataObject* GetCurrentDataObject(); 00059 00064 virtual vtkInformation* GetCurrentMetaData(); 00065 00068 virtual int HasCurrentMetaData(); 00069 00073 virtual unsigned int GetCurrentFlatIndex(); 00074 00076 00084 vtkSetMacro(VisitOnlyLeaves, int); 00085 vtkGetMacro(VisitOnlyLeaves, int); 00086 vtkBooleanMacro(VisitOnlyLeaves, int); 00088 00090 00093 vtkSetMacro(TraverseSubTree, int); 00094 vtkGetMacro(TraverseSubTree, int); 00095 vtkBooleanMacro(TraverseSubTree, int); 00097 00098 //BTX 00099 protected: 00100 vtkDataObjectTreeIterator(); 00101 virtual ~vtkDataObjectTreeIterator(); 00102 00103 // Takes the current location to the next dataset. This traverses the tree in 00104 // preorder fashion. 00105 // If the current location is a composite dataset, next is its 1st child dataset. 00106 // If the current is not a composite dataset, then next is the next dataset. 00107 // This method gives no guarantees whether the current dataset will be 00108 // non-null or leaf. 00109 void NextInternal(); 00110 00112 vtkDataObjectTreeIndex GetCurrentIndex(); 00113 00114 // Needs access to GetCurrentIndex(). 00115 friend class vtkDataObjectTree; 00116 friend class vtkMultiDataSetInternal; 00117 00118 unsigned int CurrentFlatIndex; 00119 00120 private: 00121 vtkDataObjectTreeIterator(const vtkDataObjectTreeIterator&); // Not implemented. 00122 void operator=(const vtkDataObjectTreeIterator&); // Not implemented. 00123 00124 class vtkInternals; 00125 vtkInternals* Internals; 00126 friend class vtkInternals; 00127 00128 int TraverseSubTree; 00129 int VisitOnlyLeaves; 00130 00133 vtkDataObjectTreeInternals* GetInternals(vtkDataObjectTree*); 00134 00135 // Cannot be called when this->IsDoneWithTraversal() return 1. 00136 void UpdateLocation(); 00137 //ETX 00138 }; 00139 00140 #endif