public class DistanceGridComp extends GridCompBase
Modifier and Type | Class and Description |
---|---|
static class |
DistanceGridComp.SurfaceType
Specfies the type of interpolation that should be used when constructing
an iso-surface for the grid.
|
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 |
---|
DistanceGridComp() |
DistanceGridComp(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
addGeneratingMesh(MeshComponent mcomp) |
void |
clearGeneratingMeshes() |
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
boolean |
getFitWithOBB()
Queries whether an OBB is used when automatically constructing a grid.
|
DistanceGrid |
getGrid() |
double |
getMarginFraction()
Returns the margin fraction used when automatically constructing a grid.
|
int |
getMaxResolution()
Returns the default maximum cell resolution that should be used when
automatically constructing a grid.
|
boolean |
getRenderSurface()
Queries whether or not iso-surface rendering is enabled for this grid.
|
Vector3i |
getResolution()
Returns the cell resolutions (in the x, y, and z directions) that should
be used when automatically constructing a grid.
|
void |
getSoftReferences(java.util.List<ModelComponent> refs)
Appends all soft references for this component to a list.
|
PolygonalMesh |
getSurface() |
double |
getSurfaceDistance()
Returns the distance value used for creating this grid's iso-surface.
|
DistanceGridComp.SurfaceType |
getSurfaceType()
Queries the type of interpolation used when creating the iso-surface
for this grid.
|
boolean |
hasGrid() |
double |
penetrationDistance(Vector3d nrm,
Matrix3d Dnrm,
Point3d p0) |
void |
prerender(RenderList list)
Called prior to rendering to allow this object to update the internal
state required for rendering (such as by caching rendering coordinates).
|
boolean |
removeGeneratingMesh(MeshComponent mcomp) |
void |
render(Renderer renderer,
int flags)
Render this object using the functionality of the supplied
Renderer . |
void |
scaleDistance(double s)
Scales all distance coordinates.
|
void |
setFitWithOBB(boolean enable)
Enables OBB fitting to be used when automatically constructing a grid.
|
void |
setGeneratingMeshes(java.util.Collection<MeshComponent> meshes) |
void |
setGrid(DistanceGrid grid)
Explicitly sets the grid for this DistanceGridComp.
|
void |
setLocalToWorld(RigidTransform3d TGW) |
void |
setMarginFraction(double frac)
Sets the margin fraction used when automatically constructing a grid.
|
void |
setMaxResolution(int max)
Sets the default maximum cell resolution that should be used when
automatically constructing a distance grid.
|
void |
setRenderSurface(boolean enable)
Sets whether or not iso-surface rendering is enabled for this grid.
|
void |
setResolution(Vector3i res)
Sets the cell resolution (in the x, y, and z directions) that should be
used when automatically constructing a grid.
|
void |
setSurfaceDistance(double dist)
Sets the distance value used for creating this grid's iso-surface.
|
void |
setSurfaceType(DistanceGridComp.SurfaceType type)
Sets the type of interpolation used when creating the iso-surface
for this grid.
|
void |
surfaceTangent(Point3d pr,
Point3d pa,
Point3d p1,
double lam0,
Vector3d sideNrm) |
void |
updateReferences(boolean undo,
java.util.Deque<java.lang.Object> undoInfo)
May be called by the system if any of the soft references for
this component are removed from the the component hierarchy.
|
addTransformableDependencies, clearCacheIfNecessary, createRenderProps, defaultRenderProps, getLocalToWorld, getLocalToWorld, getRenderGrid, getRenderRanges, getRenderRangesRange, getRenderVertices, scaleMass, setGrid, 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, 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, write
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
transformPriority
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritable
getProperty
getChildren, hasChildren
postscan
isWritable, write
public static PropertyList myProps
public DistanceGridComp()
public DistanceGridComp(java.lang.String name)
public PropertyList getAllPropertyInfo()
HasProperties
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class GridCompBase
public void setGeneratingMeshes(java.util.Collection<MeshComponent> meshes)
public boolean removeGeneratingMesh(MeshComponent mcomp)
public void addGeneratingMesh(MeshComponent mcomp)
public void clearGeneratingMeshes()
public Vector3i getResolution()
setResolution(maspack.matrix.Vector3i)
for a more detailed description.setResolution(maspack.matrix.Vector3i)
public void setResolution(Vector3i res)
<=
0, then all of the values are
set to zero and the value returned by getMaxResolution()
) is
used to determine the grid divisions instead.res
- x, y, and z cell divisions to be used in constructing a gridgetResolution()
public int getMaxResolution()
setMaxResolution(int)
for
a more detailed description.public void setMaxResolution(int max)
max
is <=
0, the value will be set to 0. If the values returned by
getResolution()
) are non-zero, those will be used to specify
the cell resolutions instead. If the maximum cell resolution and the
values returned by getResolution()
are all 0, then no grid
will be generated.max
- default maximum cell resolution for constructing a gridpublic boolean getFitWithOBB()
setFitWithOBB(boolean)
for more details.true
if grid fitting is done using an OBBpublic void setFitWithOBB(boolean enable)
enable
- if true
, enables OBB fitting for grid constructionpublic double getMarginFraction()
public void setMarginFraction(double frac)
frac
- margin fractionpublic DistanceGridComp.SurfaceType getSurfaceType()
public void setSurfaceType(DistanceGridComp.SurfaceType type)
type
- iso-surface interpolationpublic double getSurfaceDistance()
public void setSurfaceDistance(double dist)
dist
- iso-surface distance valuepublic boolean getRenderSurface()
true
if iso-surface rendering is enabledpublic void setRenderSurface(boolean enable)
enable
- if true
, enables iso-surface renderingpublic void setLocalToWorld(RigidTransform3d TGW)
setLocalToWorld
in class GridCompBase
public void scaleDistance(double s)
ScalableUnits
scaleDistance
in interface ScalableUnits
scaleDistance
in class GridCompBase
s
- scaling factorpublic boolean hasGrid()
public DistanceGrid getGrid()
getGrid
in class GridCompBase
public void setGrid(DistanceGrid grid)
renderRanges
and
localToWorld
transform are updated from the current renderRanges
and gridtoWorld
transform values for this
component. If the grid is set to be null
, then any explicit grid
is cleared and automatic generation is reenabled.grid
- grid to setpublic PolygonalMesh getSurface()
public void surfaceTangent(Point3d pr, Point3d pa, Point3d p1, double lam0, Vector3d sideNrm)
public void prerender(RenderList list)
IsRenderable
list.addIfVisible (obj);
for each of the objects in question.prerender
in interface IsRenderable
prerender
in class GridCompBase
list
- list of objects to be renderedpublic void render(Renderer renderer, int flags)
IsRenderable
Renderer
.render
in interface IsRenderable
render
in class GridCompBase
renderer
- provides the functionality used to perform the rendering.flags
- flags that may be used to control different
aspects of the rendering. Flags are defined in Renderer
and currently include
Renderer.HIGHLIGHT
and
Renderer.SORT_FACES
.public void getSoftReferences(java.util.List<ModelComponent> refs)
ModelComponentBase
updateReferences()
method will
be called to update its internal reference information.getSoftReferences
in interface ModelComponent
getSoftReferences
in class ModelComponentBase
refs
- list to which soft references are appendedpublic void updateReferences(boolean undo, java.util.Deque<java.lang.Object> undoInfo)
undo
equal to false
,
this component should then examine its soft references and
use ComponentUtils.areConnected()
to determine which of them have been disconnected from the hierarchy.
Disconnected references should be removed, and sufficient information
should be appended to undoInfo
to allow this update
to be undone if this method is called later with undo
equal to true
. When undoing an update, the undo
information should be removed from the front of undoInfo
.updateReferences
in interface ModelComponent
updateReferences
in class ModelComponentBase
undo
- if true
, indicates that the most
recent reference update should be undone, using the supplied
undo information.undoInfo
- if undo
is false
, should be used
to store information allowing the reference update to be undone.
Otherwise, if undo
is true
, then this
supplied information to undo the most recent update.