public class FixedMeshBody extends MeshComponent implements HasCoordinateFrame
ModelComponent.FilePathSaveType, ModelComponent.NavpanelVisibilityCompositeComponent.NavpanelDisplay| Modifier and Type | Field and Description |
|---|---|
static PropertyList |
myProps |
DEFAULT_COLOR_INTERPOLATION, DEFAULT_SELECTABLE, DEFAULT_VERTEX_COLOR_MIXINGenforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNamesTG_ARTICULATED, TG_DRAGGER, TG_PRESERVE_ORIENTATION, TG_SIMULATINGTRANSPARENT, TWO_DIMENSIONAL| Constructor and Description |
|---|
FixedMeshBody()
Create an empty, unnamed FixedMeshBody.
|
FixedMeshBody(MeshBase mesh)
Create an unnamed FixedMeshBody containing the specified mesh.
|
FixedMeshBody(java.lang.String name)
Create an empty, named FixedMeshBody.
|
FixedMeshBody(java.lang.String name,
MeshBase mesh)
Create a named FixedMeshBody containing the specified mesh.
|
| Modifier and Type | Method and Description |
|---|---|
Vector3d |
centerPoseOnCentroid()
Adjusts the pose so that it reflects the mesh's centroid.
|
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
Renderer.AxisDrawStyle |
getAxisDrawStyle() |
double |
getAxisLength() |
Point3d |
getCentroid()
Returns the centroid of this mesh body.
|
AxisAngle |
getOrientation()
Queries the orientation of this body's coordinate frame relative to world.
|
RigidTransform3d |
getPose()
Queries the pose of this body's coordinate frame relative to world.
|
void |
getPose(RigidTransform3d XFrameToWorld) |
Point3d |
getPosition()
Queries the position of this body's coordinate frame relative to world.
|
Quaternion |
getRotation() |
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).
|
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 |
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 |
setAxisDrawStyle(Renderer.AxisDrawStyle style) |
void |
setAxisLength(double len) |
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)
Sets the orientation of this body's coordinate frame relative to world.
|
void |
setPose(RigidTransform3d XFrameToWorld)
Sets the pose of this body's coordinate frame relative to world.
|
void |
setPosition(Point3d pos)
Sets the position of this body's coordinate frame relative to world.
|
void |
setRotation(Quaternion q) |
void |
transformCoordinateFrame(RigidTransform3d TNB)
Transforms the coordinate frame of this body, given a transform
TNB from the new frame N to the current body frame B. |
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 |
translateCoordinateFrame(Point3d off)
Shifts the coordinate frame by a specified offset.
|
void |
updateBounds(Vector3d pmin,
Vector3d pmax)
Update the minimum and maximum points for this object.
|
addCurve, addCurve, addExternalCurve, addMeshMarker, addMeshMarker, addTransformableDependencies, clearCurves, clearMeshMarkers, copy, createSurfaceMeshArray, getColorInterpolation, getCurves, getFileName, getFileTransform, getMesh, getMeshMarkers, getMeshToWorld, getSurfaceMeshes, getVertex, getVertexColorMixing, isFileTransformRigid, isMeshModified, isMeshPolygonal, isMeshTriangular, isSelectable, numSurfaceMeshes, numVertices, postscan, prerenderMesh, removeCurve, removeExternalCurve, removeMeshMarker, render, scaleMass, setColorInterpolation, setFileName, setFileTransform, setMesh, setMesh, setMeshToWorld, setSelectable, setVertexColorMixing, transformGeometry, updatePosition, updateSlavePoscreateRenderProps, getRenderHints, getRenderProps, getSelection, numSelectionQueriesNeeded, setRenderPropscomponentChanged, findComponent, get, get, getByNumber, getChildren, getNavpanelDisplay, getNumberLimit, hasChildren, hasState, hierarchyContainsReferences, indexOf, iterator, numComponents, setDisplayMode, updateNameMapcheckFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, createTempFlag, disconnectFromHierarchy, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, isFixed, isMarked, isScanning, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setScanning, setSelected, setWritable, updateReferences, writeequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittransformPriorityconnectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritable, updateReferencesgetPropertygetChildren, hasChildrenisWritable, writerecursivelyFindpublic static PropertyList myProps
public FixedMeshBody()
public FixedMeshBody(java.lang.String name)
name - name of the bodypublic FixedMeshBody(MeshBase mesh)
mesh - mesh geometrypublic FixedMeshBody(java.lang.String name,
MeshBase mesh)
name - name of the bodymesh - mesh geometrypublic PropertyList getAllPropertyInfo()
HasPropertiesgetAllPropertyInfo in interface HasPropertiesgetAllPropertyInfo in class MeshComponentpublic void setPose(RigidTransform3d XFrameToWorld)
XFrameToWorld - pose of this body relative to worldpublic RigidTransform3d getPose()
public void getPose(RigidTransform3d XFrameToWorld)
getPose in interface HasCoordinateFramepublic Point3d getPosition()
public void setPosition(Point3d pos)
pos - new body positionpublic AxisAngle getOrientation()
public void setOrientation(AxisAngle axisAng)
axisAng - body orientation relative to worldpublic Quaternion getRotation()
public void setRotation(Quaternion q)
public double getAxisLength()
public void setAxisLength(double len)
public Renderer.AxisDrawStyle getAxisDrawStyle()
public void setAxisDrawStyle(Renderer.AxisDrawStyle style)
public void setMeshFromFile(MeshBase mesh, java.lang.String fileName) throws java.io.IOException
java.io.IOExceptionpublic void setMeshFromFile(MeshBase mesh, java.lang.String fileName, AffineTransform3dBase X) throws java.io.IOException
java.io.IOExceptionpublic void scaleDistance(double s)
ScalableUnitsscaleDistance in interface ScalableUnitsscaleDistance in class MeshComponents - scaling factorpublic void setMesh(MeshBase mesh, java.lang.String fileName, AffineTransform3dBase X)
setMesh in class MeshComponentpublic 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)
TransformableGeometrygtr 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 TransformGeometryActions. 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 TransformableGeometrytransformGeometry in class MeshComponentgtr - 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
ModelComponentBasewrite.scan in interface ModelComponentscan in interface Scannablescan in class MeshComponentrtok - 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 occuredpublic void prerender(RenderList list)
IsRenderablelist.addIfVisible (obj);
for each of the objects in question.prerender in interface IsRenderableprerender in class MeshComponentlist - list of objects to be renderedpublic void updateBounds(Vector3d pmin, Vector3d pmax)
IsRenderableupdateBounds in interface IsRenderableupdateBounds in class MeshComponentpmin - minimum pointpmax - maximum pointpublic void render(Renderer renderer, int flags)
IsRenderableRenderer.render in interface IsRenderablerender in class MeshComponentrenderer - 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 Point3d getCentroid()
public Vector3d centerPoseOnCentroid()
public void translateCoordinateFrame(Point3d off)
public void transformCoordinateFrame(RigidTransform3d TNB)
TNB from the new frame N to the current body frame B. If the current
pose if TBW, the new pose will be updated to TBW TNB. The
mesh geometry of the body will be adjusted so that they remain ``in
place''.