32#ifndef vtkStructuredData_h
33#define vtkStructuredData_h
35#include "vtkCommonDataModelModule.h"
41#define VTK_UNCHANGED 0
42#define VTK_SINGLE_POINT 1
106 static void GetCellExtentFromPointExtent(
107 const int pntExtent[6],
int cellExtent[6],
int dataDescription =
VTK_EMPTY);
113 static void GetDimensionsFromExtent(
114 const int ext[6],
int dims[3],
int dataDescription =
VTK_EMPTY);
133 static void GetCellDimensionsFromExtent(
134 const int ext[6],
int celldims[3],
int dataDescription =
VTK_EMPTY);
141 static void GetCellDimensionsFromPointDimensions(
const int pntdims[3],
int cellDims[3]);
149 static void GetLocalStructuredCoordinates(
150 const int ijk[3],
const int ext[6],
int lijk[3],
int dataDescription =
VTK_EMPTY);
157 static void GetGlobalStructuredCoordinates(
158 const int lijk[3],
const int ext[6],
int ijk[3],
int dataDescription =
VTK_EMPTY);
183 static vtkIdType ComputePointIdForExtent(
184 const int extent[6],
const int ijk[3],
int dataDescription =
VTK_EMPTY);
192 const int extent[6],
const int ijk[3],
int dataDescription =
VTK_EMPTY);
201 const int dim[3],
const int ijk[3],
int dataDescription =
VTK_EMPTY);
210 const int dim[3],
const int ijk[3],
int dataDescription =
VTK_EMPTY);
218 static void ComputeCellStructuredCoordsForExtent(
219 const vtkIdType cellIdx,
const int ext[6],
int ijk[3],
int dataDescription =
VTK_EMPTY);
226 static void ComputeCellStructuredCoords(
227 const vtkIdType cellId,
const int dim[3],
int ijk[3],
int dataDescription =
VTK_EMPTY);
234 static void ComputePointStructuredCoordsForExtent(
242 static void ComputePointStructuredCoords(
258 return ((
static_cast<vtkIdType>(k) * N2 + j) * N1 + i);
269 const vtkIdType idx,
const int N1,
const int N2,
int& i,
int& j,
int& k)
272 k =
static_cast<int>(idx / N12);
273 j =
static_cast<int>((idx - k * N12) / N1);
274 i =
static_cast<int>(idx - k * N12 - j * N1);
279 template <
typename T>
280 static T
Max(
const T& a,
const T& b)
282 return (a > b) ? a : b;
314 return static_cast<vtkIdType>(ext[1] - ext[0] + 1) *
static_cast<vtkIdType>(ext[3] - ext[2] + 1) *
315 static_cast<vtkIdType>(ext[5] - ext[4] + 1);
337 const int nodeExtent[6],
int cellExtent[6],
int)
339 cellExtent[0] = nodeExtent[0];
340 cellExtent[2] = nodeExtent[2];
341 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 const int nodeDims[3],
int cellDims[3])
367 const int ijk[3],
const 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 const int lijk[3],
const 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 const int extent[6],
const int ijk[3],
int)
398 const int extent[6],
const int ijk[3],
int)
411 const vtkIdType cellId,
const int dims[3],
int ijk[3],
int)
414 cellId, dims[0] - 1, dims[1] - 1, ijk[0], ijk[1], ijk[2]);
419 const vtkIdType cellIdx,
const int ext[6],
int ijk[3],
int)
432 const vtkIdType ptId,
const int dim[3],
int ijk[3],
int)
439 const vtkIdType ptId,
const int ext[6],
int ijk[3],
int)
list of point or cell ids
a simple class to control print indentation
abstract base class for most VTK objects
Singleton class for topologically regular data.
static void GetCellDimensionsFromExtent(const 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 int GetDataDescription(int dims[3])
Returns the data description given the dimensions (eg.
static int GetDataDimension(int ext[6])
Return the topological dimension of the data (e.g., 0, 1, 2, or 3D).
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 void ComputeCellStructuredCoords(const vtkIdType cellId, const 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 ComputePointIdForExtent(const int extent[6], const int ijk[3], int dataDescription=VTK_EMPTY)
Given a location in structured coordinates (i-j-k), and the extent of the structured dataset,...
static int SetExtent(int inExt[6], int ext[6])
Specify the dimensions of a regular, rectangular dataset.
static int GetDataDescriptionFromExtent(int ext[6])
Returns the data description given the dimensions (eg.
static void GetLocalStructuredCoordinates(const int ijk[3], const 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 GetDimensionsFromExtent(const int ext[6], int dims[3], int dataDescription=VTK_EMPTY)
Computes the structured grid dimensions based on the given extent.
static void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds, vtkIdList *cellIds, int dim[3], int seedLoc[3])
static void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds, int dataDescription, int dim[3])
Get the points defining a cell.
static bool IsPointVisible(vtkIdType cellId, vtkUnsignedCharArray *ghosts)
Return non-zero value if specified point is visible.
static void GetCellExtentFromPointExtent(const 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 GetNumberOfCells(const int ext[6], int dataDescription=VTK_EMPTY)
Given the grid extent, this method returns the total number of cells within the extent.
vtkStructuredData()=default
static void ComputeCellStructuredCoordsForExtent(const vtkIdType cellIdx, const 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 int GetDataDimension(int dataDescription)
Return the topological dimension of the data (e.g., 0, 1, 2, or 3D).
static void ComputePointStructuredCoordsForExtent(const vtkIdType ptId, const 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).
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static bool IsCellVisible(vtkIdType cellId, int dimensions[3], int dataDescription, vtkUnsignedCharArray *cellGhostArray, vtkUnsignedCharArray *pointGhostArray=nullptr)
Return non-zero value if specified cell is visible.
~vtkStructuredData() override=default
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 void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds, vtkIdList *cellIds, int dim[3])
Get the cells using the points ptIds, exclusive of the cell cellId.
static void ComputePointStructuredCoords(const vtkIdType ptId, const 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 ComputeCellIdForExtent(const int extent[6], const int ijk[3], int dataDescription=VTK_EMPTY)
Given a location in structured coordinates (i-j-k), and the extent of the structured dataset,...
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=VTK_EMPTY)
Given a location in structured coordinates (i-j-k), and the dimensions of the structured dataset,...
static void GetPointCells(vtkIdType ptId, vtkIdList *cellIds, int dim[3])
Get the cells using a point.
static void GetGlobalStructuredCoordinates(const int lijk[3], const 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 T Max(const T &a, const T &b)
static vtkIdType GetNumberOfPoints(const 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(const int dim[3], const int ijk[3], int dataDescription=VTK_EMPTY)
Given a location in structured coordinates (i-j-k), and the dimensions of the structured dataset,...
dynamic, self-adjusting array of unsigned char