VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkHierarchicalBoxDataSet.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 =========================================================================*/ 00042 #ifndef __vtkHierarchicalBoxDataSet_h 00043 #define __vtkHierarchicalBoxDataSet_h 00044 00045 #include "vtkCompositeDataSet.h" 00046 00047 class vtkAMRBox; 00048 class vtkInformationIdTypeKey; 00049 class vtkInformationIntegerKey; 00050 class vtkInformationIntegerVectorKey; 00051 class vtkUniformGrid; 00052 00053 class VTK_FILTERING_EXPORT vtkHierarchicalBoxDataSet : public vtkCompositeDataSet 00054 { 00055 public: 00056 static vtkHierarchicalBoxDataSet *New(); 00057 vtkTypeMacro(vtkHierarchicalBoxDataSet,vtkCompositeDataSet); 00058 void PrintSelf(ostream& os, vtkIndent indent); 00059 00061 virtual vtkCompositeDataIterator* NewIterator(); 00062 00064 virtual int GetDataObjectType() {return VTK_HIERARCHICAL_BOX_DATA_SET;} 00065 00068 void SetNumberOfLevels(unsigned int numLevels); 00069 00071 unsigned int GetNumberOfLevels(); 00072 00074 void SetNumberOfDataSets(unsigned int level, unsigned int numdatasets); 00075 00077 unsigned int GetNumberOfDataSets(unsigned int level); 00078 00080 00084 virtual void SetDataSet(vtkCompositeDataIterator* iter, vtkDataObject* dataObj) 00085 { this->Superclass::SetDataSet(iter, dataObj); } 00087 00089 00092 void SetDataSet(unsigned int level, unsigned int id, 00093 int LoCorner[3], int HiCorner[3], vtkUniformGrid* dataSet); 00094 //BTX 00095 // Description: 00096 // Set the dataset pointer for a given node. This will resize the number of 00097 // levels and the number of datasets in the level to fit level, id requested. 00098 // The information carried by the vtkAMRBox is redundant with the extent 00099 // of the vtkUniformGrid. However, in case of parallel computation, the 00100 // vtkAMRBox is defined on each processor whereas the vtkUniformGrid is 00101 // defined only on the processor that owns it. 00102 void SetDataSet(unsigned int level, unsigned int id, 00103 vtkAMRBox& box, vtkUniformGrid* dataSet); 00105 00107 00110 vtkUniformGrid* GetDataSet(unsigned int level, 00111 unsigned int id, 00112 vtkAMRBox& box); 00114 00116 vtkAMRBox GetAMRBox(vtkCompositeDataIterator* iter); 00117 00118 //ETX 00119 00121 00124 vtkInformation* GetLevelMetaData(unsigned int level) 00125 { return this->GetChildMetaData(level); } 00127 00129 00130 int HasLevelMetaData(unsigned int level) 00131 { return this->HasChildMetaData(level); } 00133 00137 vtkInformation* GetMetaData(unsigned int level, unsigned int index); 00138 00140 int HasMetaData(unsigned int level, unsigned int index); 00141 00148 void SetRefinementRatio(unsigned int level, int refRatio); 00149 00151 int GetRefinementRatio(unsigned int level); 00152 00155 int GetRefinementRatio(vtkCompositeDataIterator* iter); 00156 00158 void GenerateVisibilityArrays(); 00159 00160 static vtkInformationIntegerVectorKey* BOX(); 00161 static vtkInformationIntegerKey* BOX_DIMENSIONALITY(); 00162 static vtkInformationIntegerKey* REFINEMENT_RATIO(); 00163 static vtkInformationIdTypeKey* NUMBER_OF_BLANKED_POINTS(); 00164 00165 //BTX 00167 00168 static vtkHierarchicalBoxDataSet* GetData(vtkInformation* info); 00169 static vtkHierarchicalBoxDataSet* GetData(vtkInformationVector* v, int i=0); 00170 //ETX 00172 00174 virtual void GetScalarRange(double range[]); 00175 00177 virtual double *GetScalarRange(); 00178 00180 00181 virtual vtkDataObject* GetDataSet(vtkCompositeDataIterator* iter) 00182 { return this->Superclass::GetDataSet(iter); } 00184 00186 00187 virtual vtkInformation* GetMetaData(vtkCompositeDataIterator* iter) 00188 { return this->Superclass::GetMetaData(iter); } 00190 00191 00193 00194 virtual int HasMetaData(vtkCompositeDataIterator* iter) 00195 { return this->Superclass::HasMetaData(iter); } 00197 00200 unsigned int GetFlatIndex(unsigned int level, unsigned int index); 00201 00202 protected: 00203 vtkHierarchicalBoxDataSet(); 00204 ~vtkHierarchicalBoxDataSet(); 00205 00208 virtual void ComputeScalarRange(); 00209 00210 // Cached scalar range 00211 double ScalarRange[2]; 00212 // Time at which scalar range is computed 00213 vtkTimeStamp ScalarRangeComputeTime; 00214 00215 private: 00216 vtkHierarchicalBoxDataSet(const vtkHierarchicalBoxDataSet&); // Not implemented. 00217 void operator=(const vtkHierarchicalBoxDataSet&); // Not implemented. 00218 }; 00219 00220 #endif 00221