public class FixedMeshBody extends MeshComponent implements HasCoordinateFrame
ModelComponent.NavpanelVisibility
Modifier and Type | Field and Description |
---|---|
static PropertyList |
myProps |
DEFAULT_COLOR_INTERPOLATION, DEFAULT_VERTEX_COLOR_MIXING
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
TG_ARTICULATED, TG_DRAGGER, TG_PRESERVE_ORIENTATION, TG_SIMULATING
TRANSPARENT, TWO_DIMENSIONAL
Constructor and Description |
---|
FixedMeshBody() |
FixedMeshBody(MeshBase mesh) |
FixedMeshBody(java.lang.String name) |
FixedMeshBody(java.lang.String name,
MeshBase mesh) |
Modifier and Type | Method and Description |
---|---|
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
AxisAngle |
getOrientation() |
RigidTransform3d |
getPose() |
void |
getPose(RigidTransform3d XFrameToWorld) |
Point3d |
getPosition() |
Quaternion |
getRotation() |
void |
scaleDistance(double s)
Scales all distance coordinates.
|
void |
scaleMesh(double s) |
void |
scaleMesh(double sx,
double sy,
double sz) |
void |
scan(ReaderTokenizer rtok,
java.lang.Object ref)
Scans this element from a ReaderTokenizer.
|
void |
setMesh(MeshBase mesh,
java.lang.String fileName,
AffineTransform3dBase X)
Sets a mesh for this body.
|
void |
setMeshFromFile(MeshBase mesh,
java.lang.String fileName) |
void |
setMeshFromFile(MeshBase mesh,
java.lang.String fileName,
AffineTransform3dBase X) |
void |
setOrientation(AxisAngle axisAng) |
void |
setPose(RigidTransform3d XFrameToWorld) |
void |
setPosition(Point3d pos) |
void |
setRotation(Quaternion q) |
void |
transformGeometry(GeometryTransformer gtr,
TransformGeometryContext context,
int flags)
Transforms the geometry of this component, using the geometry transformer
gtr to transform its individual attributes. |
void |
transformMesh(AffineTransform3dBase X) |
void |
updateBounds(Vector3d pmin,
Vector3d pmax)
Update the minimum and maximum points for this object.
|
addTransformableDependencies, copy, createRenderProps, createSurfaceMeshArray, getColorInterpolation, getFileTransform, getMesh, getMeshToWorld, getSurfaceMeshes, getVertex, getVertexColorMixing, isFileTransformRigid, isMeshModfied, numSurfaceMeshes, numVertices, prerender, render, render, scaleMass, setColorInterpolation, setDefaultValues, setMesh, setMesh, setMeshToWorld, setVertexColorMixing, transformGeometry, updatePosition, updateSlavePos
getRenderHints, getRenderProps, getSelection, isSelectable, numSelectionQueriesNeeded, setRenderProps, updateRenderProps
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, createTempFlag, disconnectFromHierarchy, getChildren, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, hasState, isConnectedToHierarchy, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setSelected, updateReferences, write
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, postscan, setFixed, setMarked, setName, setNumber, setParent, setSelected, updateReferences
getProperty
getChildren, hasChildren
isWritable, write
public static PropertyList myProps
public FixedMeshBody()
public FixedMeshBody(java.lang.String name)
public FixedMeshBody(MeshBase mesh)
public FixedMeshBody(java.lang.String name, MeshBase mesh)
public PropertyList getAllPropertyInfo()
HasProperties
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class MeshComponent
public void setPose(RigidTransform3d XFrameToWorld)
public RigidTransform3d getPose()
public void getPose(RigidTransform3d XFrameToWorld)
getPose
in interface HasCoordinateFrame
public Point3d getPosition()
public void setPosition(Point3d pos)
public AxisAngle getOrientation()
public void setOrientation(AxisAngle axisAng)
public Quaternion getRotation()
public void setRotation(Quaternion q)
public void setMeshFromFile(MeshBase mesh, java.lang.String fileName) throws java.io.IOException
java.io.IOException
public void setMeshFromFile(MeshBase mesh, java.lang.String fileName, AffineTransform3dBase X) throws java.io.IOException
java.io.IOException
public void updateBounds(Vector3d pmin, Vector3d pmax)
IsRenderable
updateBounds
in interface IsRenderable
updateBounds
in class MeshComponent
pmin
- minimum pointpmax
- maximum pointpublic void scaleDistance(double s)
ScalableUnits
scaleDistance
in interface ScalableUnits
scaleDistance
in class MeshComponent
s
- scaling factorpublic void setMesh(MeshBase mesh, java.lang.String fileName, AffineTransform3dBase X)
setMesh
in class MeshComponent
public void scaleMesh(double sx, double sy, double sz)
public void scaleMesh(double s)
public void transformMesh(AffineTransform3dBase X)
public void transformGeometry(GeometryTransformer gtr, TransformGeometryContext context, int flags)
TransformableGeometry
gtr
to transform its individual attributes. The
context
argument supplies information about what other
components are currently being transformed, and also allows the
requesting of update actions to be performed after all transform called
have completed. The context is also the usual entity that calls
this method, from within its TransformGeometryContext.apply(maspack.geometry.GeometryTransformer, int)
method. The argument flags
provides flags to specify
various conditions associated with the the transformation.
At present, the available flags are TransformableGeometry.TG_SIMULATING
and
TransformableGeometry.TG_ARTICULATED
.
This method is not usually called directly by applications.
Instead, it is typically called from within the
TransformGeometryContext.apply(maspack.geometry.GeometryTransformer, int)
method of the context,
which takes care of the various operations needed for a
complete transform operation, including calling
TransformableGeometry.addTransformableDependencies(artisynth.core.modelbase.TransformGeometryContext, int)
to collect other
components that should be transformed, calling
TransformableGeometry.transformGeometry(maspack.matrix.AffineTransform3dBase)
for each component, notifying
component parents that the geometry has changed, and calling
any requested TransformGeometryAction
s. More details
are given in the documentation for
TransformGeometryContext.apply(maspack.geometry.GeometryTransformer, int)
.
TransformGeometryContext
provides a number of
static convenience transform
methods
which take care of building the context and calling
apply()
for a specified set of components.
This method should not
generally call transformGeometry()
for its descendant
components. Instead, descendants needing transformation should be
specified by adding them to the context in the method TransformableGeometry.addTransformableDependencies(artisynth.core.modelbase.TransformGeometryContext, int)
.
transformGeometry
in interface TransformableGeometry
transformGeometry
in class MeshComponent
gtr
- transformer implementing the transformcontext
- context information, including what other components
are being transformedflags
- specifies conditions associated with the transformationpublic void scan(ReaderTokenizer rtok, java.lang.Object ref) throws java.io.IOException
ModelComponentBase
write
.scan
in interface ModelComponent
scan
in interface Scannable
scan
in class ModelComponentBase
rtok
- Tokenizer from which to scan the elementref
- optional reference object which can be used for resolving references to
other objectsjava.io.IOException
- if an I/O or formatting error occured