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]);
189 int dim[3],
int ijk[3],
int dataDescription=
VTK_EMPTY );
198 int dim[3],
int ijk[3],
int dataDescription=
VTK_EMPTY );
206 static void ComputeCellStructuredCoordsForExtent(
207 const vtkIdType cellIdx,
int ext[6],
int ijk[3],
215 static void ComputeCellStructuredCoords(
216 const vtkIdType cellId,
int dim[3],
int ijk[3],
224 static void ComputePointStructuredCoordsForExtent(
225 const vtkIdType ptId,
int ext[6],
int ijk[3],
233 static void ComputePointStructuredCoords(
234 const vtkIdType ptId,
int dim[3],
int ijk[3],
249 const int i,
const int j,
const int k,
const int N1,
const int N2 )
251 return( (static_cast<vtkIdType>(k)*N2+j)*N1+i );
262 const vtkIdType idx,
const int N1,
const int N2,
int &i,
int &j,
int &k )
272 template <
typename T>
273 static T
Max(
const T &a,
const T &b)
275 return (a > b) ? a : b;
285 int ext[6],
int celldims[3],
int)
303 ijk[0], ijk[1], ijk[2],
311 return static_cast<vtkIdType>(ext[1] - ext[0] + 1) *
312 static_cast<vtkIdType>(ext[3] - ext[2] + 1) *
313 static_cast<vtkIdType>(ext[5] - ext[4] + 1);
329 return static_cast<vtkIdType>(cellDims[0]) *
330 static_cast<vtkIdType>(cellDims[1]) *
336 int nodeExtent[6],
int cellExtent[6],
int)
338 cellExtent[0] = nodeExtent[0];
339 cellExtent[2] = nodeExtent[2];
340 cellExtent[4] = nodeExtent[4];
351 dims[0] = ext[1] - ext[0] + 1;
352 dims[1] = ext[3] - ext[2] + 1;
353 dims[2] = ext[5] - ext[4] + 1;
358 int nodeDims[3],
int cellDims[3])
367 int ijk[3],
int ext[6],
int lijk[3],
int)
369 lijk[0] = ijk[0] - ext[0];
370 lijk[1] = ijk[1] - ext[2];
371 lijk[2] = ijk[2] - ext[4];
376 int lijk[3],
int ext[6],
int ijk[3],
int)
378 ijk[0] = ext[0] + lijk[0];
379 ijk[1] = ext[2] + lijk[1];
380 ijk[2] = ext[4] + lijk[2];
385 int extent[6],
int ijk[3],
int)
398 int extent[6],
int ijk[3],
int)
411 const vtkIdType cellId,
int dims[3],
int ijk[3],
int)
414 dims[0] - 1, dims[1] - 1,
415 ijk[0], ijk[1], ijk[2]);
420 const vtkIdType cellIdx,
int ext[6],
int ijk[3],
int)
433 const vtkIdType ptId,
int dim[3],
int ijk[3],
int)
436 ijk[0], ijk[1], ijk[2]);
441 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...