Go to the documentation of this file.
29 #ifndef vtkStructuredData_h
30 #define vtkStructuredData_h
32 #include "vtkCommonDataModelModule.h"
37 #define VTK_UNCHANGED 0
38 #define VTK_SINGLE_POINT 1
42 #define VTK_XY_PLANE 5
43 #define VTK_YZ_PLANE 6
44 #define VTK_XZ_PLANE 7
45 #define VTK_XYZ_GRID 8
61 static int SetDimensions(
int inDim[3],
int dim[3]);
62 static int SetExtent(
int inExt[6],
int ext[6]);
70 static int GetDataDescription(
int dims[3]);
71 static int GetDataDescriptionFromExtent(
int ext[6] );
78 static int GetDataDimension(
int dataDescription);
79 static int GetDataDimension(
int ext[6] );
101 static void GetCellExtentFromPointExtent(
102 int pntExtent[6],
int cellExtent[6],
int dataDescription=
VTK_EMPTY );
108 static void GetDimensionsFromExtent(
109 int ext[6],
int dims[3],
int dataDescription=
VTK_EMPTY );
117 static void GetCellDimensionsFromExtent(
118 int ext[6],
int celldims[3],
int dataDescription=
VTK_EMPTY );
125 static void GetCellDimensionsFromPointDimensions(
126 int pntdims[3],
int cellDims[3] );
134 static void GetLocalStructuredCoordinates(
135 int ijk[3],
int ext[6],
int lijk[3],
int dataDescription=
VTK_EMPTY );
142 static void GetGlobalStructuredCoordinates(
143 int lijk[3],
int ext[6],
int ijk[3],
int dataDescription=
VTK_EMPTY );
149 int dataDescription,
int dim[3]);
163 vtkIdList *cellIds,
int dim[3],
int seedLoc[3]);
188 int dim[3],
int ijk[3],
int dataDescription=
VTK_EMPTY );
197 int dim[3],
int ijk[3],
int dataDescription=
VTK_EMPTY );
205 static void ComputeCellStructuredCoordsForExtent(
206 const vtkIdType cellIdx,
int ext[6],
int ijk[3],
214 static void ComputeCellStructuredCoords(
215 const vtkIdType cellId,
int dim[3],
int ijk[3],
223 static void ComputePointStructuredCoordsForExtent(
224 const vtkIdType ptId,
int ext[6],
int ijk[3],
232 static void ComputePointStructuredCoords(
233 const vtkIdType ptId,
int dim[3],
int ijk[3],
248 const int i,
const int j,
const int k,
const int N1,
const int N2 )
250 return( (static_cast<vtkIdType>(k)*
N2+j)*
N1+i );
261 const vtkIdType idx,
const int N1,
const int N2,
int &i,
int &j,
int &k )
271 template <
typename T>
272 static T
Max(
const T &a,
const T &b)
274 return (a > b) ? a : b;
284 int ext[6],
int celldims[3],
int)
302 ijk[0], ijk[1], ijk[2],
310 return static_cast<vtkIdType>(ext[1] - ext[0] + 1) *
311 static_cast<vtkIdType>(ext[3] - ext[2] + 1) *
312 static_cast<vtkIdType>(ext[5] - ext[4] + 1);
328 return static_cast<vtkIdType>(cellDims[0]) *
329 static_cast<vtkIdType>(cellDims[1]) *
330 static_cast<vtkIdType>(cellDims[2]);
335 int nodeExtent[6],
int cellExtent[6],
int)
337 cellExtent[0] = nodeExtent[0];
338 cellExtent[2] = nodeExtent[2];
339 cellExtent[4] = nodeExtent[4];
350 dims[0] = ext[1] - ext[0] + 1;
351 dims[1] = ext[3] - ext[2] + 1;
352 dims[2] = ext[5] - ext[4] + 1;
357 int nodeDims[3],
int cellDims[3])
366 int ijk[3],
int ext[6],
int lijk[3],
int)
368 lijk[0] = ijk[0] - ext[0];
369 lijk[1] = ijk[1] - ext[2];
370 lijk[2] = ijk[2] - ext[4];
375 int lijk[3],
int ext[6],
int ijk[3],
int)
377 ijk[0] = ext[0] + lijk[0];
378 ijk[1] = ext[2] + lijk[1];
379 ijk[2] = ext[4] + lijk[2];
384 int extent[6],
int ijk[3],
int)
397 int extent[6],
int ijk[3],
int)
410 const vtkIdType cellId,
int dims[3],
int ijk[3],
int)
413 dims[0] - 1, dims[1] - 1,
414 ijk[0], ijk[1], ijk[2]);
419 const vtkIdType cellIdx,
int ext[6],
int ijk[3],
int)
432 const vtkIdType ptId,
int dim[3],
int ijk[3],
int)
435 ijk[0], ijk[1], ijk[2]);
440 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 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...
abstract base class for most VTK objects
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 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...
~vtkStructuredData() override
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,...
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,...
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...
Singleton class for topologically regular data.
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,...
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).
list of point or cell ids
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 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 void GetDimensionsFromExtent(int ext[6], int dims[3], int dataDescription=VTK_EMPTY)
Computes the structured grid dimensions based on the given 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.
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 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 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 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 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).