public class MatrixNdGrid extends VectorGrid<MatrixNd>
MatrixNd
values using
trilinear interpolation. The class is implemented using VectorGrid<MatrixNd>
as a base class, with augmentation to specify the size
of the MatrixNd
objects to be interpolated. This size must be
specified in the constructor, cannot be modified, and must be uniform
throughout the grid.
Values at any point within the grid are be obtained by trilinear
interpolation of the values at surrounding vertices. Queries can be made for
points in either local or world coordinates, using VectorGrid.getLocalValue(maspack.matrix.Point3d)
or
VectorGrid.getWorldValue(maspack.matrix.Point3d)
. If the query point is outside the grid, then null
is returned.
Values at the grid vertices can be assigned collectively or individually,
using VectorGrid.setVertexValues(T[])
or VectorGrid.setVertexValue(int, T)
. Values at grid
vertices can be queried using VectorGrid.getVertexValue(int)
.
For more details, see the documentation for VectorGrid
.
TRANSPARENT, TWO_DIMENSIONAL
Constructor and Description |
---|
MatrixNdGrid()
Default constructor.
|
MatrixNdGrid(int rowSize,
int colSize,
Vector3d widths,
Vector3i resolution)
Creates a new grid with specified matrix size, widths, and resolution,
centered on the local coordinate system.
|
MatrixNdGrid(int rowSize,
int colSize,
Vector3d widths,
Vector3i resolution,
RigidTransform3d TCL)
Creates a new grid with specified matrix size, widths, resolution, and
position and orientation of the center given by
TCL . |
MatrixNdGrid(int rowSize,
int colSize,
Vector3i resolution)
Creates a new grid, axis-aligned and centered on the origin, with the
specified resolution and x, y, z widths set to 1.
|
MatrixNdGrid(MatrixNdGrid grid)
Creates a new grid that is a copy of an existing grid.
|
Modifier and Type | Method and Description |
---|---|
MatrixNd |
createTypeInstance() |
boolean |
epsilonEquals(MatrixNdGrid grid,
double tol) |
int |
getMatrixColSize()
Returns the column size of the matrics interpolated by this grid.
|
int |
getMatrixRowSize()
Returns the row size of the matrices interpolated by this grid.
|
boolean |
hasParameterizedType()
Queries whether this class explicitly utilizes a parameterized type.
|
void |
set(MatrixNdGrid grid) |
epsilonEquals, getLocalValue, getLocalValue, getParameterType, getRenderVector, getRenderVectorScale, getVertexValue, getVertexValue, getVertexValue, getVertexValues, getWorldValue, getWorldValue, scanValue, set, setRenderVectorScale, setVertexValue, setVertexValue, setVertexValues, writeValue, zeroVertexValues
clearColors, createRenderProps, epsilonEquals, getCellVertex, getCellWidths, getCenter, getCenterAndOrientation, getClosestVertex, getDebug, getDefaultVertexColor, getGridToLocalTransformer, getLocalToWorld, getLocalToWorldTransformer, getLocalVertexCoords, getLocalVertexCoords, getOrientation, getRadius, getRenderHints, getRenderProps, getRenderRanges, getResolution, getSelection, getVertexColor, getWidths, getWidths, getWorldCenter, getWorldOrientation, getWorldVertexCoords, getWorldVertexCoords, hasLocalToWorld, isSelectable, isVertexRenderingEnabled, isWritable, numSelectionQueriesNeeded, numVertices, parseRenderRanges, prerender, prerender, render, render, scaleDistance, scan, set, setCenter, setCenterAndOrientation, setDebug, setDefaultVertexColor, setLocalToWorld, setOrientation, setRenderProps, setRenderRanges, setResolution, setVertexColor, setVertexRenderingEnabled, updateBounds, vertexToXyzIndices, write, xyzIndicesToVertex
public MatrixNdGrid()
InterpolatingGridBase.scan(maspack.util.ReaderTokenizer, java.lang.Object)
is called immediately after.public MatrixNdGrid(int rowSize, int colSize, Vector3d widths, Vector3i resolution)
rowSize
- row size of the matricescolSize
- column size of the matriceswidths
- widths along the x, y, and z axesresolution
- cell resolution along the x, y, and z axespublic MatrixNdGrid(int rowSize, int colSize, Vector3d widths, Vector3i resolution, RigidTransform3d TCL)
TCL
. The
grid values are initialized to zero.rowSize
- row size of the matricescolSize
- column size of the matriceswidths
- widths along the x, y, and z axesresolution
- cell resolution along the x, y, and z axesTCL
- transformation giving the position and orientation
of the grid centerpublic MatrixNdGrid(int rowSize, int colSize, Vector3i resolution)
rowSize
- row size of the matricescolSize
- column size of the matricesresolution
- cell resolution along the x, y, and z axespublic MatrixNdGrid(MatrixNdGrid grid)
grid
- grid to copypublic int getMatrixRowSize()
public int getMatrixColSize()
public boolean hasParameterizedType()
hasParameterizedType
in interface ParameterizedClass
hasParameterizedType
in class VectorGrid<MatrixNd>
true
if this class utilizes a parameterized type.public void set(MatrixNdGrid grid)
public MatrixNd createTypeInstance()
createTypeInstance
in class VectorGrid<MatrixNd>
public boolean epsilonEquals(MatrixNdGrid grid, double tol)