VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkUniformGrid.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 =========================================================================*/ 00022 #ifndef __vtkUniformGrid_h 00023 #define __vtkUniformGrid_h 00024 00025 #include "vtkImageData.h" 00026 00027 class vtkEmptyCell; 00028 class vtkStructuredVisibilityConstraint; 00029 class vtkUnsignedCharArray; 00030 class vtkAMRBox; 00031 00032 class VTK_FILTERING_EXPORT vtkUniformGrid : public vtkImageData 00033 { 00034 public: 00036 00037 static vtkUniformGrid *New(); 00038 vtkTypeMacro(vtkUniformGrid,vtkImageData); 00039 void PrintSelf(ostream& os, vtkIndent indent); 00041 00044 virtual void CopyStructure(vtkDataSet *ds); 00045 00047 virtual int GetDataObjectType() {return VTK_UNIFORM_GRID;}; 00048 00050 00051 virtual vtkCell *GetCell(vtkIdType cellId); 00052 virtual void GetCell(vtkIdType cellId, vtkGenericCell *cell); 00053 virtual vtkIdType FindCell( 00054 double x[3], vtkCell *cell, vtkIdType cellId, double tol2, 00055 int& subId, double pcoords[3], double *weights); 00056 virtual vtkIdType FindCell( 00057 double x[3], vtkCell *cell, vtkGenericCell *gencell, 00058 vtkIdType cellId, double tol2, int& subId, 00059 double pcoords[3], double *weights); 00060 virtual vtkCell *FindAndGetCell( 00061 double x[3], vtkCell *cell, vtkIdType cellId, 00062 double tol2, int& subId, double pcoords[3], 00063 double *weights); 00064 virtual int GetCellType(vtkIdType cellId); 00065 virtual void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds) 00066 {vtkStructuredData::GetCellPoints(cellId,ptIds,this->DataDescription, 00067 this->GetDimensions());} 00068 virtual void GetPointCells(vtkIdType ptId, vtkIdList *cellIds) 00069 {vtkStructuredData::GetPointCells(ptId,cellIds,this->GetDimensions());} 00070 virtual void Initialize(); 00071 virtual int GetMaxCellSize() {return 8;}; //voxel is the largest 00073 00074 //BTX 00076 00080 int Initialize(const vtkAMRBox *def); 00081 // Description: 00082 // Initialize from the definition in the given box, with ghost cell 00083 // arrays nGhosts cells thick in all directions. The box is expetced 00084 // to be 3D, if you have 2D data the set the third dimensions 0. 00085 // eg. (X,X,0)(X,X,0) 00086 // Returns 0 if the initialization failed. 00087 int Initialize(const vtkAMRBox *def, int nGhosts); 00088 // Description: 00089 // Initialize from the definition in the given box, with ghost cell 00090 // arrays of the thickness given in each direction by "nGhosts" array. 00091 // The box and ghost array are expected to be 3D, if you have 2D data 00092 // the set the third dimensions 0. eg. (X,X,0)(X,X,0) 00093 // Returns 0 if the initialization failed. 00094 int Initialize(const vtkAMRBox *def, const int nGhosts[3]); 00095 // Description: 00096 // Construct a uniform grid, from the definition in the given box 00097 // "def", with ghost cell arrays of the thickness given in each 00098 // direction by "nGhosts*". The box and ghost array are expected 00099 // to be 3D, if you have 2D data the set the third dimensions 0. eg. 00100 // (X,X,0)(X,X,0) 00101 // Returns 0 if the initialization failed. 00102 int Initialize(const vtkAMRBox *def,int nGhostsI,int nGhostsJ,int nGhostsK); 00103 //ETX 00105 00107 00108 virtual void ShallowCopy(vtkDataObject *src); 00109 virtual void DeepCopy(vtkDataObject *src); 00111 00113 00117 virtual void BlankPoint(vtkIdType ptId); 00118 virtual void UnBlankPoint(vtkIdType ptId); 00120 00122 00125 virtual void BlankCell(vtkIdType ptId); 00126 virtual void UnBlankCell(vtkIdType ptId); 00128 00130 virtual vtkUnsignedCharArray *GetPointVisibilityArray(); 00131 00135 virtual void SetPointVisibilityArray(vtkUnsignedCharArray *pointVisibility); 00136 00138 virtual vtkUnsignedCharArray *GetCellVisibilityArray(); 00139 00143 virtual void SetCellVisibilityArray(vtkUnsignedCharArray *pointVisibility); 00144 00147 virtual unsigned char IsPointVisible(vtkIdType ptId); 00148 00151 virtual unsigned char IsCellVisible(vtkIdType cellId); 00152 00155 virtual unsigned char GetPointBlanking(); 00156 00159 virtual unsigned char GetCellBlanking(); 00160 00161 virtual vtkImageData* NewImageDataCopy(); 00162 00163 //BTX 00165 00166 static vtkUniformGrid* GetData(vtkInformation* info); 00167 static vtkUniformGrid* GetData(vtkInformationVector* v, int i=0); 00168 //ETX 00170 00171 protected: 00172 vtkUniformGrid(); 00173 ~vtkUniformGrid(); 00174 00176 virtual void ComputeScalarRange(); 00177 00178 vtkStructuredVisibilityConstraint* PointVisibility; 00179 00180 void SetPointVisibility(vtkStructuredVisibilityConstraint *pointVisibility); 00181 vtkGetObjectMacro(PointVisibility, vtkStructuredVisibilityConstraint); 00182 00183 vtkStructuredVisibilityConstraint* CellVisibility; 00184 00185 void SetCellVisibility(vtkStructuredVisibilityConstraint *cellVisibility); 00186 vtkGetObjectMacro(CellVisibility, vtkStructuredVisibilityConstraint); 00187 00188 vtkEmptyCell *EmptyCell; 00189 00190 private: 00191 vtkUniformGrid(const vtkUniformGrid&); // Not implemented. 00192 void operator=(const vtkUniformGrid&); // Not implemented. 00193 }; 00194 00195 00196 #endif 00197 00198 00199