public class VectorNdGrid extends VectorGrid<VectorNd>
VectorNd
values using
trilinear interpolation. The class is implemented using VectorGrid<VectorNd>
as a base class, with augmentation to specify the size
of the VectorNd
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 |
---|
VectorNdGrid()
Default constructor.
|
VectorNdGrid(int vsize,
Vector3d widths,
Vector3i resolution)
Creates a new grid with specified vector size, widths and resolution,
centered on the local coordinate system.
|
VectorNdGrid(int vsize,
Vector3d widths,
Vector3i resolution,
RigidTransform3d TCL)
Creates a new grid with specified vector size, widths, resolution, and
position and orientation of the center given by
TCL . |
VectorNdGrid(int vsize,
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.
|
VectorNdGrid(VectorNdGrid grid)
Creates a new grid that is a copy of an existing grid.
|
Modifier and Type | Method and Description |
---|---|
VectorNd |
createTypeInstance() |
boolean |
epsilonEquals(VectorNdGrid grid,
double tol) |
int |
getVectorSize()
Returns the size of the vectors interpolated by this grid.
|
boolean |
hasParameterizedType()
Queries whether this class explicitly utilizes a parameterized type.
|
void |
set(VectorNdGrid 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 VectorNdGrid()
InterpolatingGridBase.scan(maspack.util.ReaderTokenizer, java.lang.Object)
is called immediately after.public VectorNdGrid(int vsize, Vector3d widths, Vector3i resolution)
vsize
- size of the vectors to be interpolatedwidths
- widths along the x, y, and z axesresolution
- cell resolution along the x, y, and z axespublic VectorNdGrid(int vsize, Vector3d widths, Vector3i resolution, RigidTransform3d TCL)
TCL
. The
grid values are initialized to zero.vsize
- size of the vectors to be interpolatedwidths
- 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 VectorNdGrid(int vsize, Vector3i resolution)
vsize
- size of the vectors to be interpolatedresolution
- cell resolution along the x, y, and z axespublic VectorNdGrid(VectorNdGrid grid)
grid
- grid to copypublic int getVectorSize()
public boolean hasParameterizedType()
hasParameterizedType
in interface ParameterizedClass
hasParameterizedType
in class VectorGrid<VectorNd>
true
if this class utilizes a parameterized type.public void set(VectorNdGrid grid)
public VectorNd createTypeInstance()
createTypeInstance
in class VectorGrid<VectorNd>
public boolean epsilonEquals(VectorNdGrid grid, double tol)