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
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 )
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]) *
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)
list of point or cell ids
abstract base class for most VTK objects
Singleton class for topologically regular data.
static int GetDataDescription(int dims[3])
Returns the data description given the dimensions (eg.
static int GetDataDimension(int ext[6])
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 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 int SetDimensions(int inDim[3], int dim[3])
Specify the dimensions of a regular, rectangular dataset.
static int SetExtent(int inExt[6], int ext[6])
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).
static int GetDataDescriptionFromExtent(int ext[6])
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 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 GetCellPoints(vtkIdType cellId, vtkIdList *ptIds, int dataDescription, int dim[3])
Get the points defining a cell.
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 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 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 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 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 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 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 int GetDataDimension(int dataDescription)
Return the topological dimension of the data (e.g., 0, 1, 2, or 3D).
static void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds, vtkIdList *cellIds, int dim[3])
Get the cells using the points ptIds, exclusive of the cell cellId.
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 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 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 GetPointCells(vtkIdType ptId, vtkIdList *cellIds, int dim[3])
Get the cells using a point.
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 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 GetDimensionsFromExtent(int ext[6], int dims[3], int dataDescription=VTK_EMPTY)
Computes the structured grid dimensions based on the given extent.
static T Max(const T &a, const T &b)