artisynth.core.mechmodels
Class RigidMeshComponent

java.lang.Object
  extended by artisynth.core.modelbase.ModelComponentBase
      extended by artisynth.core.modelbase.RenderableComponentBase
          extended by artisynth.core.mechmodels.MeshComponent
              extended by artisynth.core.mechmodels.RigidMeshComponent
All Implemented Interfaces:
Collidable, ModelComponent, RenderableComponent, ScalableUnits, TransformableGeometry, PullController.Pullable, java.lang.Cloneable, HasProperties, HierarchyNode, GLRenderable, GLSelectable, HasRenderProps, Renderable, Scannable

public class RigidMeshComponent
extends MeshComponent
implements PullController.Pullable, Collidable


Nested Class Summary
 
Nested classes/interfaces inherited from interface artisynth.core.mechmodels.Collidable
Collidable.DefaultCollidable
 
Nested classes/interfaces inherited from interface artisynth.core.modelbase.ModelComponent
ModelComponent.NavpanelVisibility
 
Field Summary
static boolean DEFAULT_PHYSICAL
           
static PropertyList myProps
           
 
Fields inherited from class artisynth.core.modelbase.ModelComponentBase
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
 
Fields inherited from interface artisynth.core.mechmodels.Collidable
Default, Deformable, RigidBody, Self
 
Fields inherited from interface artisynth.core.util.TransformableGeometry
ARTICULATED, SIMULATING
 
Fields inherited from interface maspack.render.GLRenderable
TRANSLUCENT, TWO_DIMENSIONAL
 
Constructor Summary
RigidMeshComponent()
           
RigidMeshComponent(MeshBase mesh, java.lang.String fileName, AffineTransform3dBase X)
           
RigidMeshComponent(java.lang.String name)
           
 
Method Summary
 void applyForce(java.lang.Object orig, Vector3d force)
          Given the supplied force origin info and a force vector, apply the force (typically sets an external force)
 RigidMeshComponent copy(int flags, java.util.Map<ModelComponent,ModelComponent> copyMap)
           
 CollisionData createCollisionData()
           
 PropertyList getAllPropertyInfo()
          Returns a list giving static information about all properties exported by this object.
 PolygonalMesh getCollisionMesh()
           
 double getMass()
           
 java.lang.Object getOriginData(MouseRayEvent ray)
          Constructs force origin storage data given a mouse ray (e.g.
 Point3d getOriginPoint(java.lang.Object data)
          Determines the world-coordinate point to which force will be applied (used for determining magnitude of force)
 double getPointRenderRadius()
           
 RigidBody getRigidBody()
           
 void getSelection(java.util.LinkedList<java.lang.Object> list, int qid)
          Append to list the component (or components) associated with the qid-th selection query issued by this component's render method.
 boolean isCollidable()
           
 boolean isPhysical()
           
 boolean isPullable()
           
 int numSelectionQueriesNeeded()
          If this selectable manages its own selection (by issuing selection queries within its render method), then this method should return the maximum number of selection queries that will be required.
 void render(GLRenderer renderer, RenderProps props, int flags)
           
 void setPhysical(boolean set)
           
 
Methods inherited from class artisynth.core.mechmodels.MeshComponent
createRenderProps, getMesh, getVertex, numVertices, prerender, render, scaleDistance, scaleMass, setDefaultValues, setMesh, setMesh, setMesh, transformGeometry, transformGeometry, transformGeometry, updateBounds, updatePosition, updateSlavePos
 
Methods inherited from class artisynth.core.modelbase.RenderableComponentBase
getRenderHints, getRenderProps, isSelectable, setRenderProps, updateRenderProps
 
Methods inherited from class artisynth.core.modelbase.ModelComponentBase
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, createTempFlag, disconnectFromHierarchy, getChildren, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, hasState, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, scan, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setSelected, updateReferences, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface artisynth.core.modelbase.ModelComponent
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, postscan, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, updateReferences
 
Methods inherited from interface maspack.properties.HasProperties
getProperty
 
Methods inherited from interface maspack.properties.HierarchyNode
getChildren, hasChildren
 
Methods inherited from interface maspack.util.Scannable
isWritable, write
 

Field Detail

DEFAULT_PHYSICAL

public static boolean DEFAULT_PHYSICAL

myProps

public static PropertyList myProps
Constructor Detail

RigidMeshComponent

public RigidMeshComponent()

RigidMeshComponent

public RigidMeshComponent(java.lang.String name)

RigidMeshComponent

public RigidMeshComponent(MeshBase mesh,
                          java.lang.String fileName,
                          AffineTransform3dBase X)
Method Detail

getAllPropertyInfo

public PropertyList getAllPropertyInfo()
Description copied from interface: HasProperties
Returns a list giving static information about all properties exported by this object.

Specified by:
getAllPropertyInfo in interface HasProperties
Overrides:
getAllPropertyInfo in class MeshComponent
Returns:
static information for all exported properties

isPhysical

public boolean isPhysical()

setPhysical

public void setPhysical(boolean set)

render

public void render(GLRenderer renderer,
                   RenderProps props,
                   int flags)
Overrides:
render in class MeshComponent

getRigidBody

public RigidBody getRigidBody()

copy

public RigidMeshComponent copy(int flags,
                               java.util.Map<ModelComponent,ModelComponent> copyMap)
Overrides:
copy in class MeshComponent

isPullable

public boolean isPullable()
Specified by:
isPullable in interface PullController.Pullable

getOriginData

public java.lang.Object getOriginData(MouseRayEvent ray)
Description copied from interface: PullController.Pullable
Constructs force origin storage data given a mouse ray (e.g. intersect ray with mesh to determine for origin point) If null, assumes that there is no origin, so no force can be applied

Specified by:
getOriginData in interface PullController.Pullable

getOriginPoint

public Point3d getOriginPoint(java.lang.Object data)
Description copied from interface: PullController.Pullable
Determines the world-coordinate point to which force will be applied (used for determining magnitude of force)

Specified by:
getOriginPoint in interface PullController.Pullable

getPointRenderRadius

public double getPointRenderRadius()
Specified by:
getPointRenderRadius in interface PullController.Pullable

applyForce

public void applyForce(java.lang.Object orig,
                       Vector3d force)
Description copied from interface: PullController.Pullable
Given the supplied force origin info and a force vector, apply the force (typically sets an external force)

Specified by:
applyForce in interface PullController.Pullable

numSelectionQueriesNeeded

public int numSelectionQueriesNeeded()
Description copied from interface: GLSelectable
If this selectable manages its own selection (by issuing selection queries within its render method), then this method should return the maximum number of selection queries that will be required. Otherwise, this method should return -1.

Specified by:
numSelectionQueriesNeeded in interface GLSelectable
Overrides:
numSelectionQueriesNeeded in class RenderableComponentBase
Returns:
maximum number of selection queries needed by this component, or -1 if this component does not manage its own selection.

getSelection

public void getSelection(java.util.LinkedList<java.lang.Object> list,
                         int qid)
Description copied from interface: GLSelectable
Append to list the component (or components) associated with the qid-th selection query issued by this component's render method. This will only be called if this component manages its own selection (i.e., the number nums returned by GLSelectable.numSelectionQueriesNeeded() is positive), and qid will in turn be a number between 0 and nums-1.

Specified by:
getSelection in interface GLSelectable
Overrides:
getSelection in class RenderableComponentBase
Parameters:
list - selected objects are appended to the end of this list
qid - index of the selection query

createCollisionData

public CollisionData createCollisionData()
Specified by:
createCollisionData in interface Collidable

getCollisionMesh

public PolygonalMesh getCollisionMesh()

getMass

public double getMass()
Specified by:
getMass in interface Collidable

isCollidable

public boolean isCollidable()
Specified by:
isCollidable in interface Collidable