public class VectorGridField<T extends VectorObject<T>> extends GridFieldBase implements VectorFieldComponent<T>
VectorGrid
component. Vectors are of type T
, which must be an
instance of VectorObject
.ModelComponent.NavpanelVisibility
Modifier and Type | Field and Description |
---|---|
static PropertyList |
myProps |
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
TG_ARTICULATED, TG_DRAGGER, TG_PRESERVE_ORIENTATION, TG_SIMULATING
TRANSPARENT, TWO_DIMENSIONAL
Constructor and Description |
---|
VectorGridField()
This constructor should not be called by applications, unless
ModelComponentBase.scan(maspack.util.ReaderTokenizer, java.lang.Object) is called immediately after. |
VectorGridField(java.lang.String name,
VectorGrid<T> grid)
Constructs a named field using a given grid.
|
VectorGridField(VectorGrid<T> grid)
Constructs a field using a given grid.
|
Modifier and Type | Method and Description |
---|---|
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
VectorGrid<T> |
getGrid() |
double |
getRenderScale()
Queries the
renderScale property for this vector grid field. |
T |
getValue(FemFieldPoint fp)
Returns the value of the this field at a specified FEM field point.
|
T |
getValue(MeshFieldPoint fp)
Returns the value of the this field at a specified mesh field point.
|
T |
getValue(Point3d pos)
Queries the field value associated with this grid at a specified position.
|
Point3d |
getVertexPosition(int vi)
Gets the position of the vertex indexed by
vi . |
Point3d |
getVertexPosition(int xi,
int yj,
int zk)
Gets the position of the vertex indexed by its indices along the x, y,
and z axes.
|
T |
getVertexValue(int vi)
Returns the value at the grid vertex indexed by
vi . |
T |
getVertexValue(int xi,
int yj,
int zk)
Returns the value at the grid vertex indexed by its indices along the x,
y, and z axes.
|
int |
numVertices()
Returns the number of vertices in the grid.
|
void |
setGrid(VectorGrid<T> grid)
Sets the grid for this VectorGridField.
|
void |
setRenderScale(double scale)
Set the
renderScale property for this vector grid field. |
void |
setVertexValue(int xi,
int yj,
int zk,
T value)
Sets the value at the grid vertex indexed by its indices along the x,
y, and z axes.
|
void |
setVertexValue(int vi,
T value)
Sets the value at the grid vertex indexed by
vi , which is
computed from the axial vertex indices xi , yj , zk
according to |
getClipToGrid, getUseFemRestPositions, getUseLocalValuesForField, setClipToGrid, setUseFemRestPositions, setUseLocalValuesForField
addTransformableDependencies, clearCacheIfNecessary, createRenderProps, defaultRenderProps, getLocalToWorld, getLocalToWorld, getRenderGrid, getRenderRanges, getRenderRangesRange, getRenderVertices, prerender, render, scaleDistance, scaleMass, setGrid, setLocalToWorld, setRenderGrid, setRenderRanges, setRenderVertices, transformGeometry, transformGeometry, updateBounds
copy, defaultRenderPropsAreNull, getRenderHints, getRenderProps, getSelection, isSelectable, isVisible, numSelectionQueriesNeeded, setRenderProps, setVisible, updateRenderProps
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, createTempFlag, disconnectFromHierarchy, getChildren, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, hasState, isFixed, isMarked, isScanning, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, scan, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setScanning, setSelected, setWritable, updateReferences, write
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clearCacheIfNecessary
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritable, updateReferences
getProperty
getChildren, hasChildren
postscan
isWritable, write
transformPriority
public static PropertyList myProps
public VectorGridField()
ModelComponentBase.scan(maspack.util.ReaderTokenizer, java.lang.Object)
is called immediately after.public VectorGridField(VectorGrid<T> grid)
grid
- vector grid used to implement the field.public VectorGridField(java.lang.String name, VectorGrid<T> grid)
grid
- name name of the fieldgrid
- vector grid used to implement the fieldpublic PropertyList getAllPropertyInfo()
HasProperties
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class GridFieldBase
public double getRenderScale()
renderScale
property for this vector grid field.
See setRenderScale(double)
.public void setRenderScale(double scale)
renderScale
property for this vector grid field. This is
used to scale the rendered size of the vector components of this field in
subclasses that support rendering of those values. The default value is
0, meaning that the components will not be rendered.scale
- new scale property valuepublic int numVertices()
public T getValue(Point3d pos)
GridFieldBase.getUseLocalValuesForField()
returns true
.
If the query point is outside the grid, then the value for the nearest
grid point is returned if the property cliptoGrid
is true
; otherwise null
is returned.
getValue
in interface VectorFieldComponent<T extends VectorObject<T>>
pos
- query positionpublic Point3d getVertexPosition(int xi, int yj, int zk)
GridFieldBase.getUseLocalValuesForField()
returns true
.xi
- x vertex indexyj
- y vertex indexzk
- z vertex indexpublic Point3d getVertexPosition(int vi)
vi
. See setVertexValue(int,VectorObject)
for a description of how vi
is
computed. The position is in either local or world coordinates depending
on whether GridFieldBase.getUseLocalValuesForField()
returns true
.vi
- vertex indexpublic T getValue(FemFieldPoint fp)
VectorFieldComponent
getValue
in interface VectorFieldComponent<T extends VectorObject<T>>
fp
- point at which value is requestedpublic T getValue(MeshFieldPoint fp)
VectorFieldComponent
getValue
in interface VectorFieldComponent<T extends VectorObject<T>>
fp
- point at which value is requestedpublic VectorGrid<T> getGrid()
getGrid
in class GridCompBase
public T getVertexValue(int vi)
vi
. See setVertexValue(int,VectorObject)
for a description of how vi
is
computed.vi
- index of the vertexpublic void setVertexValue(int xi, int yj, int zk, T value)
xi
- x vertex indexyj
- y vertex indexzk
- z vertex indexvalue
- new vertex valuepublic void setVertexValue(int vi, T value)
vi
, which is
computed from the axial vertex indices xi
, yj
, zk
according to
vi = xi + nx*yj + (nx*ny)*zkwhere
nx
and ny
are the number
of vertices along x and y axes.vi
- index of the vertexvalue
- new vertex valuepublic T getVertexValue(int xi, int yj, int zk)
xi
- x vertex indexyj
- y vertex indexzk
- z vertex indexpublic void setGrid(VectorGrid<T> grid)
renderRanges
and localToWorld
transform are updated from the current renderRanges
and gridtoWorld
transform values for this component.grid
- grid to set