23 #ifndef vtkStructuredData_h
24 #define vtkStructuredData_h
26 #include "vtkCommonDataModelModule.h"
31 VTK_ABI_NAMESPACE_BEGIN
53 VTK_STRUCTURED_INVALID = -1,
54 VTK_STRUCTURED_UNCHANGED =
56 VTK_STRUCTURED_SINGLE_POINT = 1,
57 VTK_STRUCTURED_X_LINE = 2,
58 VTK_STRUCTURED_Y_LINE = 3,
59 VTK_STRUCTURED_Z_LINE = 4,
60 VTK_STRUCTURED_XY_PLANE = 5,
61 VTK_STRUCTURED_YZ_PLANE = 6,
62 VTK_STRUCTURED_XZ_PLANE = 7,
63 VTK_STRUCTURED_XYZ_GRID = 8,
64 VTK_STRUCTURED_EMPTY = 9
75 static int SetDimensions(VTK_FUTURE_CONST
int inDim[3],
int dim[3]);
76 static int SetExtent(VTK_FUTURE_CONST
int inExt[6],
int ext[6]);
84 static int GetDataDescription(
int dims[3]);
85 static int GetDataDescriptionFromExtent(VTK_FUTURE_CONST
int ext[6]);
92 static int GetDataDimension(
int dataDescription);
93 static int GetDataDimension(
int ext[6]);
117 static void GetCellExtentFromPointExtent(
const int pntExtent[6],
int cellExtent[6],
124 static inline void GetDimensionsFromExtent(
135 static bool IsCellVisible(
vtkIdType cellId, VTK_FUTURE_CONST
int dimensions[3],
145 static void GetCellDimensionsFromExtent(
const int ext[6],
int celldims[3],
153 static void GetCellDimensionsFromPointDimensions(
const int pntdims[3],
int cellDims[3]);
161 static void GetLocalStructuredCoordinates(
const int ijk[3],
const int ext[6],
int lijk[3],
169 static void GetGlobalStructuredCoordinates(
const int lijk[3],
const int ext[6],
int ijk[3],
176 static void GetCellPoints(
vtkIdType cellId,
vtkIdList* ptIds,
int dataDescription,
int dim[3]);
181 static void GetPointCells(
vtkIdType ptId,
vtkIdList* cellIds, VTK_FUTURE_CONST
int dim[3]);
188 static void GetCellNeighbors(
196 static vtkIdType ComputePointIdForExtent(
const int extent[6],
const int ijk[3],
204 static vtkIdType ComputeCellIdForExtent(
const int extent[6],
const int ijk[3],
213 static vtkIdType ComputePointId(
const int dim[3],
const int ijk[3],
222 static vtkIdType ComputeCellId(
const int dim[3],
const int ijk[3],
231 static void ComputeCellStructuredCoordsForExtent(
vtkIdType cellIdx,
const int ext[6],
int ijk[3],
239 static void ComputeCellStructuredCoords(
vtkIdType cellId,
const int dim[3],
int ijk[3],
246 static void ComputeCellStructuredMinMaxCoords(
vtkIdType cellId,
const int dim[3],
int ijkMin[3],
254 static void ComputePointStructuredCoordsForExtent(
vtkIdType ptId,
const int ext[6],
int ijk[3],
262 static void ComputePointStructuredCoords(
vtkIdType ptId,
const int dim[3],
int ijk[3],
269 int extent[6],
bool usePixelVoxelOrientation);
283 int extent[6],
bool usePixelVoxelOrientation);
285 "Use vtkSmartPointer<vtkConstantArray<unsigned char>> GetCellTypes(extent, "
286 "usePixelVoxelOrientation) instead")
288 int extent[6],
bool usePixelVoxelOrientation);
302 static
vtkIdType GetLinearIndex(const
int i, const
int j, const
int k, const
int N1, const
int N2)
304 return ((static_cast<vtkIdType>(k) * N2 + j) * N1 + i);
315 const vtkIdType idx,
const int N1,
const int N2,
int& i,
int& j,
int& k)
318 k =
static_cast<int>(idx / N12);
319 j =
static_cast<int>((idx - k * N12) / N1);
320 i =
static_cast<int>(idx - k * N12 - j * N1);
325 template <
typename T>
326 static T
Max(
const T& a,
const T& b)
328 return (a > b) ? a : b;
360 return static_cast<vtkIdType>(ext[1] - ext[0] + 1) * static_cast<vtkIdType>(ext[3] - ext[2] + 1) *
361 static_cast<vtkIdType>(ext[5] - ext[4] + 1);
377 return static_cast<vtkIdType>(cellDims[0]) * static_cast<vtkIdType>(cellDims[1]) *
383 const int nodeExtent[6],
int cellExtent[6],
int)
385 cellExtent[0] = nodeExtent[0];
386 cellExtent[2] = nodeExtent[2];
387 cellExtent[4] = nodeExtent[4];
397 dims[0] = ext[1] - ext[0] + 1;
398 dims[1] = ext[3] - ext[2] + 1;
399 dims[2] = ext[5] - ext[4] + 1;
404 const int nodeDims[3],
int cellDims[3])
413 const int ijk[3],
const int ext[6],
int lijk[3],
int)
415 lijk[0] = ijk[0] - ext[0];
416 lijk[1] = ijk[1] - ext[2];
417 lijk[2] = ijk[2] - ext[4];
422 const int lijk[3],
const int ext[6],
int ijk[3],
int)
424 ijk[0] = ext[0] + lijk[0];
425 ijk[1] = ext[2] + lijk[1];
426 ijk[2] = ext[4] + lijk[2];
431 const int extent[6],
const int ijk[3],
int)
444 const int extent[6],
const int ijk[3],
int)
457 vtkIdType cellId,
const int dims[3],
int ijk[3],
int)
460 cellId, dims[0] - 1, dims[1] - 1, ijk[0], ijk[1], ijk[2]);
465 vtkIdType cellIdx,
const int ext[6],
int ijk[3],
int)
478 vtkIdType ptId,
const int dim[3],
int ijk[3],
int)
485 vtkIdType ptId,
const int ext[6],
int ijk[3],
int)
496 VTK_ABI_NAMESPACE_END
static void ComputeCellStructuredCoordsForExtent(vtkIdType cellIdx, const int ext[6], int ijk[3], int dataDescription=vtkStructuredData::VTK_STRUCTURED_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.
Singleton class for topologically regular data.
abstract base class for most VTK objects
static void ComputeCellStructuredCoords(vtkIdType cellId, const int dim[3], int ijk[3], int dataDescription=vtkStructuredData::VTK_STRUCTURED_EMPTY)
Given a cellId and grid dimensions 'dim', get the structured coordinates (i-j-k). ...
static vtkIdType GetNumberOfPoints(const int ext[6], int dataDescription=vtkStructuredData::VTK_STRUCTURED_EMPTY)
Given the grid extent, this method returns the total number of points within the extent.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkIdType ComputeCellIdForExtent(const int extent[6], const int ijk[3], int dataDescription=vtkStructuredData::VTK_STRUCTURED_EMPTY)
Given a location in structured coordinates (i-j-k), and the extent of the structured dataset...
A utility array for wrapping constant functions in implicit arrays.
implicit object to represent cell connectivity
static void GetLocalStructuredCoordinates(const int ijk[3], const int ext[6], int lijk[3], int dataDescription=vtkStructuredData::VTK_STRUCTURED_EMPTY)
Given the global structured coordinates for a point or cell, ijk, w.r.t.
static void GetDimensionsFromExtent(const int ext[6], int dims[3], int dataDescription=vtkStructuredData::VTK_STRUCTURED_EMPTY)
Computes the structured grid dimensions based on the given extent.
static void ComputePointStructuredCoords(vtkIdType ptId, const int dim[3], int ijk[3], int dataDescription=vtkStructuredData::VTK_STRUCTURED_EMPTY)
Given a pointId and grid dimensions 'dim', get the structured coordinates (i-j-k).
static T Max(const T &a, const T &b)
static vtkIdType ComputeCellId(const int dim[3], const int ijk[3], int dataDescription=vtkStructuredData::VTK_STRUCTURED_EMPTY)
Given a location in structured coordinates (i-j-k), and the dimensions of the structured dataset...
static void GetCellExtentFromPointExtent(const int pntExtent[6], int cellExtent[6], int dataDescription=vtkStructuredData::VTK_STRUCTURED_EMPTY)
Given the point extent of a grid, this method computes the corresponding cell extent for the grid...
static void GetCellDimensionsFromPointDimensions(const int pntdims[3], int cellDims[3])
Given the dimensions of the grid, in pntdims, this method returns the corresponding cell dimensions f...
static vtkIdType GetNumberOfCells(const int ext[6], int dataDescription=vtkStructuredData::VTK_STRUCTURED_EMPTY)
Given the grid extent, this method returns the total number of cells within the extent.
#define VTK_DEPRECATED_IN_9_6_0(reason)
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 vtkIdType ComputePointId(const int dim[3], const int ijk[3], int dataDescription=vtkStructuredData::VTK_STRUCTURED_EMPTY)
Given a location in structured coordinates (i-j-k), and the dimensions of the structured dataset...
a simple class to control print indentation
list of point or cell ids
abstract superclass for arrays of numeric data
vtkStructuredDataType
An enum to describe the different types of vtkStructuredData XXX: This should be an enum class...
static void GetGlobalStructuredCoordinates(const int lijk[3], const int ext[6], int ijk[3], int dataDescription=vtkStructuredData::VTK_STRUCTURED_EMPTY)
Given local structured coordinates, and the corresponding global sub-grid extent, this method compute...
dynamic, self-adjusting array of unsigned char
static void GetCellDimensionsFromExtent(const int ext[6], int celldims[3], int dataDescription=vtkStructuredData::VTK_STRUCTURED_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 ComputePointIdForExtent(const int extent[6], const int ijk[3], int dataDescription=vtkStructuredData::VTK_STRUCTURED_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...
represent and manipulate 3D points
static void ComputePointStructuredCoordsForExtent(vtkIdType ptId, const int ext[6], int ijk[3], int dataDescription=vtkStructuredData::VTK_STRUCTURED_EMPTY)
Given a pointId and the grid extent ext, get the structured coordinates (i-j-k).