00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00026 #ifndef __vtkStructuredData_h
00027 #define __vtkStructuredData_h
00028
00029 #include "vtkObject.h"
00030
00031 class vtkIdList;
00032
00033 #define VTK_UNCHANGED 0
00034 #define VTK_SINGLE_POINT 1
00035 #define VTK_X_LINE 2
00036 #define VTK_Y_LINE 3
00037 #define VTK_Z_LINE 4
00038 #define VTK_XY_PLANE 5
00039 #define VTK_YZ_PLANE 6
00040 #define VTK_XZ_PLANE 7
00041 #define VTK_XYZ_GRID 8
00042 #define VTK_EMPTY 9
00043
00044 class VTK_COMMON_EXPORT vtkStructuredData : public vtkObject
00045 {
00046 public:
00047 vtkTypeRevisionMacro(vtkStructuredData,vtkObject);
00048
00050
00055 static int SetDimensions(int inDim[3], int dim[3]);
00056 static int SetExtent(int inExt[6], int ext[6]);
00058
00061 static int GetDataDescription(int dims[3]);
00062
00064 static int GetDataDimension(int dataDescription);
00065
00067
00068 static void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds,
00069 int dataDescription, int dim[3]);
00071
00073 static void GetPointCells(vtkIdType ptId, vtkIdList *cellIds, int dim[3]);
00074
00076
00078 static void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds,
00079 vtkIdList *cellIds, int dim[3]);
00081
00083
00085 static vtkIdType ComputePointIdForExtent(int extent[6], int ijk[3]) {
00086 vtkIdType ydim = static_cast<vtkIdType>(extent[3] - extent[2] + 1);
00087 vtkIdType xdim = static_cast<vtkIdType>(extent[1] - extent[0] + 1);
00088 return ((ijk[2] - extent[4])*ydim + (ijk[1] - extent[2]))*xdim
00089 + (ijk[0] - extent[0]); }
00091
00093
00095 static vtkIdType ComputeCellIdForExtent(int extent[6], int ijk[3]) {
00096 vtkIdType ydim = static_cast<vtkIdType>(extent[3] - extent[2] + 1);
00097 vtkIdType xdim = static_cast<vtkIdType>(extent[1] - extent[0] + 1);
00098 return ((ijk[2] - extent[4])*(ydim - 1) + (ijk[1] - extent[2]))*(xdim - 1)
00099 + (ijk[0] - extent[0]); }
00101
00103
00106 static vtkIdType ComputePointId(int dim[3], int ijk[3]) {
00107 return (ijk[2]*static_cast<vtkIdType>(dim[1]) + ijk[1])*dim[0] + ijk[0];}
00109
00111
00114 static vtkIdType ComputeCellId(int dim[3], int ijk[3]) {
00115 return (ijk[2]*static_cast<vtkIdType>(dim[1]-1) + ijk[1])*(dim[0]-1) + ijk[0];}
00117
00118 protected:
00119 vtkStructuredData() {};
00120 ~vtkStructuredData() {};
00121
00122 private:
00123 vtkStructuredData(const vtkStructuredData&);
00124 void operator=(const vtkStructuredData&);
00125 };
00126
00127
00128 #endif
00129