32 #ifndef vtkStructuredData_h 33 #define vtkStructuredData_h 35 #include "vtkCommonDataModelModule.h" 40 #define VTK_UNCHANGED 0 41 #define VTK_SINGLE_POINT 1 45 #define VTK_XY_PLANE 5 46 #define VTK_YZ_PLANE 6 47 #define VTK_XZ_PLANE 7 48 #define VTK_XYZ_GRID 8 64 static int SetDimensions(
int inDim[3],
int dim[3]);
65 static int SetExtent(
int inExt[6],
int ext[6]);
73 static int GetDataDescription(
int dims[3]);
74 static int GetDataDescriptionFromExtent(
int ext[6] );
81 static int GetDataDimension(
int dataDescription);
82 static int GetDataDimension(
int ext[6] );
104 static void GetCellExtentFromPointExtent(
105 int pntExtent[6],
int cellExtent[6],
int dataDescription=
VTK_EMPTY );
111 static void GetDimensionsFromExtent(
112 int ext[6],
int dims[3],
int dataDescription=
VTK_EMPTY );
120 static void GetCellDimensionsFromExtent(
121 int ext[6],
int celldims[3],
int dataDescription=
VTK_EMPTY );
128 static void GetCellDimensionsFromPointDimensions(
129 int pntdims[3],
int cellDims[3] );
137 static void GetLocalStructuredCoordinates(
138 int ijk[3],
int ext[6],
int lijk[3],
int dataDescription=
VTK_EMPTY );
145 static void GetGlobalStructuredCoordinates(
146 int lijk[3],
int ext[6],
int ijk[3],
int dataDescription=
VTK_EMPTY );
152 int dataDescription,
int dim[3]);
166 vtkIdList *cellIds,
int dim[3],
int seedLoc[3]);
191 int dim[3],
int ijk[3],
int dataDescription=
VTK_EMPTY );
200 int dim[3],
int ijk[3],
int dataDescription=
VTK_EMPTY );
208 static void ComputeCellStructuredCoordsForExtent(
209 const vtkIdType cellIdx,
int ext[6],
int ijk[3],
217 static void ComputeCellStructuredCoords(
218 const vtkIdType cellId,
int dim[3],
int ijk[3],
226 static void ComputePointStructuredCoordsForExtent(
227 const vtkIdType ptId,
int ext[6],
int ijk[3],
235 static void ComputePointStructuredCoords(
236 const vtkIdType ptId,
int dim[3],
int ijk[3],
251 const int i,
const int j,
const int k,
const int N1,
const int N2 )
253 return( (static_cast<vtkIdType>(k)*N2+j)*N1+i );
264 const vtkIdType idx,
const int N1,
const int N2,
int &i,
int &j,
int &k )
274 template <
typename T>
275 static T
Max(
const T &a,
const T &b)
277 return (a > b) ? a : b;
287 int ext[6],
int celldims[3],
int)
305 ijk[0], ijk[1], ijk[2],
313 return static_cast<vtkIdType>(ext[1] - ext[0] + 1) *
314 static_cast<vtkIdType>(ext[3] - ext[2] + 1) *
315 static_cast<vtkIdType>(ext[5] - ext[4] + 1);
331 return static_cast<vtkIdType>(cellDims[0]) *
332 static_cast<vtkIdType>(cellDims[1]) *
338 int nodeExtent[6],
int cellExtent[6],
int)
340 cellExtent[0] = nodeExtent[0];
341 cellExtent[2] = nodeExtent[2];
342 cellExtent[4] = nodeExtent[4];
353 dims[0] = ext[1] - ext[0] + 1;
354 dims[1] = ext[3] - ext[2] + 1;
355 dims[2] = ext[5] - ext[4] + 1;
360 int nodeDims[3],
int cellDims[3])
369 int ijk[3],
int ext[6],
int lijk[3],
int)
371 lijk[0] = ijk[0] - ext[0];
372 lijk[1] = ijk[1] - ext[2];
373 lijk[2] = ijk[2] - ext[4];
378 int lijk[3],
int ext[6],
int ijk[3],
int)
380 ijk[0] = ext[0] + lijk[0];
381 ijk[1] = ext[2] + lijk[1];
382 ijk[2] = ext[4] + lijk[2];
387 int extent[6],
int ijk[3],
int)
400 int extent[6],
int ijk[3],
int)
413 const vtkIdType cellId,
int dims[3],
int ijk[3],
int)
416 dims[0] - 1, dims[1] - 1,
417 ijk[0], ijk[1], ijk[2]);
422 const vtkIdType cellIdx,
int ext[6],
int ijk[3],
int)
435 const vtkIdType ptId,
int dim[3],
int ijk[3],
int)
438 ijk[0], ijk[1], ijk[2]);
443 const vtkIdType ptId,
int ext[6],
int ijk[3],
int)
static vtkIdType GetNumberOfCells(int ext[6], int dataDescription=VTK_EMPTY)
Given the grid extent, this method returns the total number of cells within the extent.
static void ComputePointStructuredCoordsForExtent(const vtkIdType ptId, int ext[6], int ijk[3], int dataDescription=VTK_EMPTY)
Given a pointId and the grid extent ext, get the structured coordinates (i-j-k).
Singleton class for topologically regular data.
abstract base class for most VTK objects
static T Max(const T &a, const T &b)
static vtkIdType ComputePointId(int dim[3], int ijk[3], int dataDescription=VTK_EMPTY)
Given a location in structured coordinates (i-j-k), and the dimensions of the structured dataset...
~vtkStructuredData() override
static void GetGlobalStructuredCoordinates(int lijk[3], int ext[6], int ijk[3], int dataDescription=VTK_EMPTY)
Given local structured coordinates, and the corresponding global sub-grid extent, this method compute...
static void GetCellDimensionsFromExtent(int ext[6], int celldims[3], int dataDescription=VTK_EMPTY)
Returns the cell dimensions, i.e., the number of cells along the i,j,k for the grid with the given gr...
static vtkIdType GetLinearIndex(const int i, const int j, const int k, const int N1, const int N2)
Computes the linear index for the given i-j-k structured of a grid with of N1 and N2 dimensions along...
static void GetDimensionsFromExtent(int ext[6], int dims[3], int dataDescription=VTK_EMPTY)
Computes the structured grid dimensions based on the given extent.
static vtkIdType ComputeCellIdForExtent(int extent[6], int ijk[3], int dataDescription=VTK_EMPTY)
Given a location in structured coordinates (i-j-k), and the extent of the structured dataset...
list of point or cell ids
static void GetLocalStructuredCoordinates(int ijk[3], int ext[6], int lijk[3], int dataDescription=VTK_EMPTY)
Given the global structured coordinates for a point or cell, ijk, w.r.t.
static void ComputeCellStructuredCoordsForExtent(const vtkIdType cellIdx, int ext[6], int ijk[3], int dataDescription=VTK_EMPTY)
Given the global grid extent and the linear index of a cell within the grid extent, this method computes the corresponding structured coordinates of the given cell.
static void GetCellDimensionsFromPointDimensions(int pntdims[3], int cellDims[3])
Given the dimensions of the grid, in pntdims, this method returns the corresponding cell dimensions f...
static vtkIdType ComputeCellId(int dim[3], int ijk[3], int dataDescription=VTK_EMPTY)
Given a location in structured coordinates (i-j-k), and the dimensions of the structured dataset...
static vtkIdType ComputePointIdForExtent(int extent[6], int ijk[3], int dataDescription=VTK_EMPTY)
Given a location in structured coordinates (i-j-k), and the extent of the structured dataset...
static void ComputeCellStructuredCoords(const vtkIdType cellId, int dim[3], int ijk[3], int dataDescription=VTK_EMPTY)
Given a cellId and grid dimensions 'dim', get the structured coordinates (i-j-k). ...
static void ComputePointStructuredCoords(const vtkIdType ptId, int dim[3], int ijk[3], int dataDescription=VTK_EMPTY)
Given a pointId and grid dimensions 'dim', get the structured coordinates (i-j-k).
static void GetStructuredCoordinates(const vtkIdType idx, const int N1, const int N2, int &i, int &j, int &k)
Returns the structured coordinates (i,j,k) for the given linear index of a grid with N1 and N2 dimens...
static vtkIdType GetNumberOfPoints(int ext[6], int dataDescription=VTK_EMPTY)
Given the grid extent, this method returns the total number of points within the extent.
static void GetCellExtentFromPointExtent(int pntExtent[6], int cellExtent[6], int dataDescription=VTK_EMPTY)
Given the point extent of a grid, this method computes the corresponding cell extent for the grid...