artisynth.core.mechmodels
Class MechModel

java.lang.Object
  extended by artisynth.core.modelbase.ModelComponentBase
      extended by artisynth.core.modelbase.ComponentList<ModelComponent>
          extended by artisynth.core.modelbase.ModelBase
              extended by artisynth.core.modelbase.RenderableModelBase
                  extended by artisynth.core.mechmodels.MechSystemBase
                      extended by artisynth.core.mechmodels.MechModel
All Implemented Interfaces:
MechSystem, MechSystemModel, ComponentChangeListener, ComponentListView<ModelComponent>, CompositeComponent, HasState, IndexedComponentList, Model, ModelComponent, MutableCompositeComponent<ModelComponent>, ParameterizedClass, RenderableComponent, ScalableUnits, TransformableGeometry, java.lang.Cloneable, java.lang.Iterable<ModelComponent>, java.util.Collection<ModelComponent>, HasProperties, HierarchyNode, GLRenderable, GLSelectable, HasRenderProps, Renderable, Disposable, ListView<ModelComponent>, Scannable
Direct Known Subclasses:
LaymanModel

public class MechModel
extends MechSystemBase
implements TransformableGeometry, ScalableUnits, MechSystemModel


Nested Class Summary
 
Nested classes/interfaces inherited from interface artisynth.core.modelbase.ModelComponent
ModelComponent.NavpanelVisibility
 
Nested classes/interfaces inherited from interface artisynth.core.mechmodels.MechSystem
MechSystem.ConstraintInfo, MechSystem.FrictionInfo
 
Nested classes/interfaces inherited from interface artisynth.core.modelbase.CompositeComponent
CompositeComponent.NavpanelDisplay
 
Field Summary
static PropertyList myProps
           
 
Fields inherited from class artisynth.core.mechmodels.MechSystemBase
myParametricsInSystemMatrix
 
Fields inherited from class artisynth.core.modelbase.ComponentList
DEFAULT_NAVPANEL_DISPLAY
 
Fields inherited from class artisynth.core.modelbase.ModelComponentBase
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
 
Fields inherited from interface artisynth.core.util.TransformableGeometry
ARTICULATED, SIMULATING
 
Fields inherited from interface artisynth.core.mechmodels.MechSystem
COMPUTE_CONTACTS, UPDATE_CONTACTS
 
Fields inherited from interface maspack.render.GLRenderable
TRANSLUCENT, TWO_DIMENSIONAL
 
Constructor Summary
MechModel()
           
MechModel(java.lang.String name)
           
 
Method Summary
 void addAttachment(DynamicAttachment ax)
           
 void addAxialSpring(AxialSpring s)
           
 void addConstrainer(ConstrainerBase c)
           
 void addForceEffector(ForceComponent fe)
           
 void addFrameMarker(FrameMarker mkr)
           
 void addFrameMarker(FrameMarker mkr, Frame frame, Point3d loc)
           
 void addFrameSpring(FrameSpring s)
           
 void addMeshBody(MeshComponent rb)
           
 void addModel(MechSystemModel m)
           
 void addMultiPointSpring(MultiPointSpring s)
           
 void addMuscleExciter(MuscleExciter mex)
           
 void addParticle(Particle p)
           
 void addRenderable(RenderableComponent rb)
           
 void addRigidBody(RigidBody rb)
           
 void addRigidBodyConnector(RigidBodyConnector c)
           
 StepAdjustment advance(double t0, double t1, int flags)
          Advances this object from time t0 to time t1.
 void attachAxialSpring(Point pnt0, Point pnt1, AxialSpring s)
           
 void attachFrameSpring(Frame frameA, Frame frameB, FrameSpring s)
           
 ComponentList<DynamicAttachment> attachments()
           
 void attachPoint(Point p1, FemElement3d elem)
          Attaches a point to the element of an FEM.
 void attachPoint(Point p1, FemModel3d fem, double reduceTol)
          Attaches a point to an FEM.
 void attachPoint(Point p1, Particle p2)
           
 void attachPoint(Point p1, RigidBody body)
           
 void attachPoint(Point p1, RigidBody body, Point3d loc)
           
 RenderableComponentList<AxialSpring> axialSprings()
           
 DynamicMechComponent checkVelocityStability()
          Checks the velocity stability of this system.
 void clear()
           
 void clearAxialSprings()
           
 void clearConstrainers()
           
 void clearForceEffectors()
           
 void clearFrameMarkers()
           
 void clearFrameSprings()
           
 void clearMeshBodies()
           
 void clearModels()
           
 void clearMultiPointSprings()
           
 void clearParticles()
           
 void clearRenderables()
           
 void clearRigidBodies()
           
 void clearRigidBodyConnectors()
           
 void closePrintStateFile()
           
 int combineMatrixTypes(int type1, int type2)
           
 void componentChanged(ComponentChangeEvent e)
          Notifies this composite component that a change has occured within one or more of its descendants.
 double computeDefaultPenetrationTol()
          Computes a default value for the penetration tolerance based on the radius of this MechModel.
 ComponentListView<ConstrainerBase> constrainers()
           
 boolean detachPoint(Point p1)
           
 void dispose()
          Called when the model is discarded.
 ComponentListView<ForceComponent> forceEffectors()
           
 RenderableComponentList<FrameMarker> frameMarkers()
           
 ComponentListView<FrameSpring> frameSprings()
           
 boolean getAddConstraintForces()
           
 PropertyList getAllPropertyInfo()
          Returns a list giving static information about all properties exported by this object.
 void getAttachments(java.util.List<DynamicAttachment> list, int level)
           
 void getAuxStateComponents(java.util.List<HasAuxState> list, int level)
           
 void getCollidables(java.util.List<Collidable> list, int level)
           
 CollisionBehavior getCollisionBehavior(Collidable a, Collidable b)
          Returns the collision behavior for a specified pair of collidables.
 CollisionManager getCollisionManager()
           
 void getConstrainers(java.util.List<Constrainer> list, int level)
           
 CollisionBehavior getDefaultCollisionBehavior(Collidable typeA, Collidable typeB)
          Gets the default collision behavior, for this MechModel, for a specified pair of generic collidable types.
 void getDynamicComponents(java.util.List<DynamicMechComponent> active, java.util.List<DynamicMechComponent> attached, java.util.List<DynamicMechComponent> parametric)
           
 java.awt.Color getExcitationColor()
           
 PropertyMode getExcitationColorMode()
           
 void getForceEffectors(java.util.List<ForceEffector> list, int level)
           
 double getFrameDamping()
           
 PropertyMode getFrameDampingMode()
           
 Vector3d getGravity()
           
 PropertyMode getGravityMode()
           
 MechSystemSolver.Integrator getIntegrator()
           
 MechSystemSolver.MatrixSolver getMatrixSolver()
           
 double getMaxColoredExcitation()
           
 PropertyMode getMaxColoredExcitationMode()
           
 ComponentList<MuscleExciter> getMuscleExciters()
           
 double getPenetrationTol()
           
 PropertyMode getPenetrationTolMode()
           
 double getPointDamping()
           
 PropertyMode getPointDampingMode()
           
 java.lang.String getPrintState()
           
 boolean getProfiling()
           
 double getRadius()
          Returns an estimate of the radius of components of this MechModel.
 double getRotaryDamping()
           
 PropertyMode getRotaryDampingMode()
           
 void getSlaveObjectComponents(java.util.List<HasSlaveObjects> list, int level)
          Should be overridden in subclasses to return all the HasSlaveObjects ' components within this model.
 boolean hasState()
          Returns true if this component has state.
static boolean isActive(DynamicMechComponent c)
           
static MechModel lowestCommonModel(ModelComponent comp1, ModelComponent comp2)
           
 ComponentListView<MeshComponent> meshBodies()
           
 ComponentListView<MechSystemModel> models()
           
 RenderableComponentList<MultiPointSpring> multiPointSprings()
           
 java.io.PrintWriter openPrintStateFile(java.lang.String name)
           
 PointList<Particle> particles()
           
 StepAdjustment preadvance(double t0, double t1, int flags)
          Prepares this object for advance from time t0 to time t1.
 void projectRigidBodyPositionConstraints()
           
 void recursivelyFinalizeAdvance(StepAdjustment stepAdjust, double t0, double t1, int flags, int level)
           
 void recursivelyInitialize(double t, int level)
           
 void removeAxialSpring(AxialSpring s)
           
 void removeConstrainer(ConstrainerBase c)
           
 void removeForceEffector(ForceEffector fe)
           
 void removeFrameMarker(FrameMarker mkr)
           
 void removeFrameSpring(FrameSpring s)
           
 void removeMeshBody(MeshComponent rb)
           
 boolean removeModel(MechSystemModel m)
           
 void removeMultiPointSpring(MultiPointSpring s)
           
 boolean removeMuscleExciter(MuscleExciter mex)
           
 void removeParticle(Particle p)
           
 void removeRenderable(RenderableComponent rb)
           
 void removeRigidBody(RigidBody rb)
           
 void removeRigidBodyConnector(RigidBodyConnector c)
           
 void render(GLRenderer renderer, int flags)
          Render this object using Open GL via the JOGL.
 ComponentListView<RenderableComponent> renderables()
           
 java.io.PrintWriter reopenPrintStateFile(java.lang.String name)
           
 ComponentListView<RigidBody> rigidBodies()
           
 ComponentListView<RigidBodyConnector> rigidBodyConnectors()
           
 void scaleDistance(double s)
          Scales all distance coordinates.
 void scaleMass(double s)
          Scales all mass units.
 void scan(ReaderTokenizer rtok, java.lang.Object ref)
          Scans this element from a ReaderTokenizer.
 void setAddConstraintForces(boolean enable)
           
 void setBounds(Point3d pmin, Point3d pmax)
           
 void setCollisionBehavior(Collidable a, Collidable b, boolean enabled)
          Enables or disables collisions for a specified pair of Collidables, overriding, if necessary, the primary collision behavior.
 void setCollisionBehavior(Collidable a, Collidable b, boolean enabled, double mu)
          Sets collision behavior for a specified pair of Collidables, overriding, if necessary, the primary behavior.
 void setCollisionBehavior(Collidable a, Collidable b, CollisionBehavior behavior)
          Sets collision behavior for a specified pair of Collidables, overriding, if necessary, the primary behavior.
 void setDefaultCollisionBehavior(boolean enabled, double mu)
          Specifies the default collision behavior for all default pairs (RigidBody-RigidBody, RigidBody-Deformable, Deformable-Deformable, Deformable-Self) associated with this MechModel.
 void setDefaultCollisionBehavior(Collidable typeA, Collidable typeB, boolean enabled, double mu)
          Sets the default collision behavior, for this MechModel, for a specified pair of generic collidable types.
 void setDefaultCollisionBehavior(Collidable typeA, Collidable typeB, CollisionBehavior behavior)
          Sets the default collision behavior, for this MechModel, for a specified pair of generic collidable types.
 void setDefaultCollisionBehavior(CollisionBehavior behavior)
          Specifies a default collision behavior for all default pairs (RigidBody-RigidBody, RigidBody-Deformable, Deformable-Deformable, Deformable-Self) associated with this MechModel.
 void setExcitationColor(java.awt.Color color)
           
 void setExcitationColorMode(PropertyMode mode)
           
 void setFrameDamping(double d)
           
 void setFrameDampingMode(PropertyMode mode)
           
 void setFriction(double mu)
           
 void setGravity(double gx, double gy, double gz)
           
 void setGravity(Vector3d g)
           
 void setGravityMode(PropertyMode mode)
           
 void setIntegrator(MechSystemSolver.Integrator integrator)
           
 void setMatrixSolver(MechSystemSolver.MatrixSolver method)
           
 void setMaxColoredExcitation(double excitation)
           
 void setMaxColoredExcitationMode(PropertyMode mode)
           
 void setPenetrationTol(double tol)
           
 void setPenetrationTolIfNecessary()
           
 void setPenetrationTolMode(PropertyMode mode)
           
 void setPointDamping(double d)
           
 void setPointDampingMode(PropertyMode mode)
           
 void setPrintState(java.lang.String fmt)
           
 void setProfiling(boolean enable)
           
 void setRotaryDamping(double d)
           
 void setRotaryDampingMode(PropertyMode mode)
           
static MechModel topMechModel(ModelComponent comp)
          Returns the topmost MechModel, if any, that is associated with a specific component.
 void transformGeometry(AffineTransform3dBase X)
          Applies an affine transformation to the geometry of this object.
 void transformGeometry(AffineTransform3dBase X, TransformableGeometry topObject, int flags)
          Applies an affine transformation to the geometry of this object.
 void updateBounds(Point3d pmin, Point3d pmax)
          Update the minimum and maximum points for this object.
 java.lang.Object validateMatrixSolver(MechSystemSolver.MatrixSolver method, StringHolder errMsg)
           
 
Methods inherited from class artisynth.core.mechmodels.MechSystemBase
addActivePosImpulse, addAttachmentJacobian, addAttachmentSolveBlocks, addGeneralSolveBlocks, addPosJacobian, addVelJacobian, applyAttachmentForces, buildMassMatrix, buildSolveMatrix, copy, createState, createVelocityJacobian, getActiveForces, getActivePosDerivative, getActivePosState, getActivePosStateSize, getActiveStiffness, getActiveVelState, getActiveVelState, getActiveVelStateSize, getAttachmentConstraints, getAttachmentDerivatives, getAuxState, getBilateralConstraints, getBilateralConstraintSizes, getBilateralImpulses, getBilateralImpulses, getBilateralInfo, getDefaultStabilization, getDynamicsEnabled, getFrictionConstraints, getInitialState, getInverseMassMatrix, getMass, getMassMatrix, getNumBilateralImpulses, getNumUnilateralImpulses, getParametricForces, getParametricPosState, getParametricPosStateSize, getParametricPosTarget, getParametricVelState, getParametricVelStateSize, getParametricVelTarget, getPenetrationLimit, getSolveMatrixType, getSolver, getStabilization, getState, getStructureVersion, getUnilateralConstraints, getUnilateralConstraintSizes, getUnilateralImpulses, getUnilateralImpulses, getUnilateralInfo, getUpdateForcesAtStepEnd, hasParameterizedType, initialize, maxFrictionConstraintSets, numActiveComponents, numAttachedComponents, numParametricComponents, printActiveStiffness, reduceVelocityJacobian, setActiveForces, setActivePosState, setActiveVelState, setAuxState, setBilateralImpulses, setBilateralImpulses, setDefaultStabilization, setDynamicsEnabled, setParametricForces, setParametricPosState, setParametricVelState, setPenetrationLimit, setStabilization, setState, setUnilateralImpulses, setUnilateralImpulses, setUpdateForcesAtStepEnd, updateAttachmentPos, updateAttachmentVel, updateConstraints, updateForces, updatePosState, updateVelState, writeBilateralConstraintMatrix, writeMassMatrix, writeStiffnessMatrix
 
Methods inherited from class artisynth.core.modelbase.RenderableModelBase
createRenderProps, getRenderHints, getRenderProps, getSelection, isSelectable, numSelectionQueriesNeeded, prerender, setRenderProps
 
Methods inherited from class artisynth.core.modelbase.ModelBase
copy, getInitialState, getMaxStepSize, hierarchyContainsReferences, setInitialState, setMaxStepSize
 
Methods inherited from class artisynth.core.modelbase.ComponentList
add, add, addAll, addComponents, addFixed, addNumbered, clone, contains, contains, containsAll, ensureCapacity, findComponent, get, get, getByNumber, getChildren, getNavpanelDisplay, getNumberLimit, getShortName, getTypeParameter, hasChildren, indexOf, isEmpty, iterator, nextComponentNumber, numComponents, postscan, remove, remove, removeAll, removeAll, removeComponents, retainAll, setNavpanelDisplay, setNumberingStartAtOne, setShortName, size, toArray, toArray, updateNameMap
 
Methods inherited from class artisynth.core.modelbase.ModelComponentBase
checkFlag, checkName, checkNameUniqueness, clearFlag, connectToHierarchy, createTempFlag, disconnectFromHierarchy, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, 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.Model
getMaxStepSize, initialize
 
Methods inherited from interface artisynth.core.modelbase.ModelComponent
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, isFixed, isMarked, isSelected, notifyParentOfChange, postscan, 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
 
Methods inherited from interface artisynth.core.modelbase.HasState
createState, getInitialState, getState, setState
 
Methods inherited from interface artisynth.core.mechmodels.MechSystem
addActivePosImpulse, addPosJacobian, addVelJacobian, buildMassMatrix, buildSolveMatrix, getActiveForces, getActivePosDerivative, getActivePosState, getActivePosStateSize, getActiveVelState, getActiveVelStateSize, getBilateralConstraints, getBilateralImpulses, getBilateralInfo, getFrictionConstraints, getInverseMassMatrix, getMassMatrix, getParametricForces, getParametricPosState, getParametricPosStateSize, getParametricPosTarget, getParametricVelState, getParametricVelStateSize, getParametricVelTarget, getSolveMatrixType, getStructureVersion, getUnilateralConstraints, getUnilateralImpulses, getUnilateralInfo, maxFrictionConstraintSets, numActiveComponents, numParametricComponents, setActiveForces, setActivePosState, setActiveVelState, setBilateralImpulses, setParametricForces, setParametricPosState, setParametricVelState, setUnilateralImpulses, updateConstraints, updateForces
 
Methods inherited from interface artisynth.core.modelbase.ComponentListView
getName
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Field Detail

myProps

public static PropertyList myProps
Constructor Detail

MechModel

public MechModel()

MechModel

public MechModel(java.lang.String name)
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 RenderableModelBase
Returns:
static information for all exported properties

clear

public void clear()
Specified by:
clear in interface java.util.Collection<ModelComponent>
Overrides:
clear in class ComponentList<ModelComponent>

getRadius

public double getRadius()
Returns an estimate of the radius of components of this MechModel. Can be used to compute default tolerances.

Returns:
estimated model radius

setPenetrationTol

public void setPenetrationTol(double tol)

getPenetrationTol

public double getPenetrationTol()

getPenetrationTolMode

public PropertyMode getPenetrationTolMode()

setPenetrationTolMode

public void setPenetrationTolMode(PropertyMode mode)

setPenetrationTolIfNecessary

public void setPenetrationTolIfNecessary()

computeDefaultPenetrationTol

public double computeDefaultPenetrationTol()
Computes a default value for the penetration tolerance based on the radius of this MechModel.


getExcitationColor

public java.awt.Color getExcitationColor()

setExcitationColor

public void setExcitationColor(java.awt.Color color)

getExcitationColorMode

public PropertyMode getExcitationColorMode()

setExcitationColorMode

public void setExcitationColorMode(PropertyMode mode)

getMaxColoredExcitation

public double getMaxColoredExcitation()

setMaxColoredExcitation

public void setMaxColoredExcitation(double excitation)

getMaxColoredExcitationMode

public PropertyMode getMaxColoredExcitationMode()

setMaxColoredExcitationMode

public void setMaxColoredExcitationMode(PropertyMode mode)

setFriction

public void setFriction(double mu)

setDefaultCollisionBehavior

public void setDefaultCollisionBehavior(boolean enabled,
                                        double mu)
Specifies the default collision behavior for all default pairs (RigidBody-RigidBody, RigidBody-Deformable, Deformable-Deformable, Deformable-Self) associated with this MechModel. This is a wrapper for the CollisionManager method setDefaultCollisionBehavior(behavior).

Parameters:
enabled - if true, enables collisions
mu - friction coefficient (ignored if enabled is false)

setDefaultCollisionBehavior

public void setDefaultCollisionBehavior(CollisionBehavior behavior)
Specifies a default collision behavior for all default pairs (RigidBody-RigidBody, RigidBody-Deformable, Deformable-Deformable, Deformable-Self) associated with this MechModel. This is a wrapper for the CollisionManager method setDefaultCollisionBehavior(behavior).

Parameters:
behavior - desired collision behavior

getDefaultCollisionBehavior

public CollisionBehavior getDefaultCollisionBehavior(Collidable typeA,
                                                     Collidable typeB)
Gets the default collision behavior, for this MechModel, for a specified pair of generic collidable types. This is a wrapper for the CollisionManager method getDefaultCollisionBehavior(typeA,typeB).

Parameters:
typeA - first generic collidable type
typeB - second generic collidable type
Returns:
default collision behavior for the indicted collidable types.

setDefaultCollisionBehavior

public void setDefaultCollisionBehavior(Collidable typeA,
                                        Collidable typeB,
                                        CollisionBehavior behavior)
Sets the default collision behavior, for this MechModel, for a specified pair of generic collidable types. This is a wrapper for the CollisionManager method setDefaultCollisionBehavior(typeA,typeB,behavior).

Parameters:
typeA - first generic collidable type
typeB - second generic collidable type
behavior - specified collision behavior

setDefaultCollisionBehavior

public void setDefaultCollisionBehavior(Collidable typeA,
                                        Collidable typeB,
                                        boolean enabled,
                                        double mu)
Sets the default collision behavior, for this MechModel, for a specified pair of generic collidable types. This is a wrapper for the CollisionManager method setDefaultCollisionBehavior(typeA,typeB,behavior).

Parameters:
typeA - first generic collidable type
typeB - second generic collidable type
enabled - if true, enables collisions
mu - friction coefficient (ignored if enabled is false)

setCollisionBehavior

public void setCollisionBehavior(Collidable a,
                                 Collidable b,
                                 boolean enabled)
Enables or disables collisions for a specified pair of Collidables, overriding, if necessary, the primary collision behavior. Each collidable must be a particular component instance. If collisions are enabled, the friction coefficient is set to 0. This is a wrapper for the CollisionManager method setCollisionBehavior(a,b,behavior).

Parameters:
a - first Collidable
b - second Collidable
enabled - if true, enables collisions

setCollisionBehavior

public void setCollisionBehavior(Collidable a,
                                 Collidable b,
                                 boolean enabled,
                                 double mu)
Sets collision behavior for a specified pair of Collidables, overriding, if necessary, the primary behavior. Each collidable must be a particular component instance. This is a wrapper for the CollisionManager method setCollisionBehavior(a,b,behavior).

Parameters:
a - first Collidable
b - second Collidable
enabled - if true, enables collisions
mu - friction coefficient (ignored if enabled is false)

setCollisionBehavior

public void setCollisionBehavior(Collidable a,
                                 Collidable b,
                                 CollisionBehavior behavior)
Sets collision behavior for a specified pair of Collidables, overriding, if necessary, the primary behavior. Each collidable must be a particular component instance. This is a wrapper for the CollisionManager method setCollisionBehavior(a,b,behavior).

Parameters:
a - first Collidable
b - second Collidable
behavior - specified collision behavior

getCollisionBehavior

public CollisionBehavior getCollisionBehavior(Collidable a,
                                              Collidable b)
Returns the collision behavior for a specified pair of collidables. Each collidable must be a particular component instance. Each collidable must be a particular component instance. This is a wrapper for the CollisionManager method getCollisionBehavior(a,b).

Parameters:
a - first Collidable
b - second Collidable
Returns:
behavior for this pair of Collidables.

getCollidables

public void getCollidables(java.util.List<Collidable> list,
                           int level)
Specified by:
getCollidables in interface MechSystemModel

getCollisionManager

public CollisionManager getCollisionManager()

setMatrixSolver

public void setMatrixSolver(MechSystemSolver.MatrixSolver method)

validateMatrixSolver

public java.lang.Object validateMatrixSolver(MechSystemSolver.MatrixSolver method,
                                             StringHolder errMsg)

getMatrixSolver

public MechSystemSolver.MatrixSolver getMatrixSolver()

setIntegrator

public void setIntegrator(MechSystemSolver.Integrator integrator)

getIntegrator

public MechSystemSolver.Integrator getIntegrator()

particles

public PointList<Particle> particles()

addParticle

public void addParticle(Particle p)

removeParticle

public void removeParticle(Particle p)

clearParticles

public void clearParticles()

axialSprings

public RenderableComponentList<AxialSpring> axialSprings()

multiPointSprings

public RenderableComponentList<MultiPointSpring> multiPointSprings()

frameSprings

public ComponentListView<FrameSpring> frameSprings()

forceEffectors

public ComponentListView<ForceComponent> forceEffectors()

getPointDamping

public double getPointDamping()

setPointDamping

public void setPointDamping(double d)

getPointDampingMode

public PropertyMode getPointDampingMode()

setPointDampingMode

public void setPointDampingMode(PropertyMode mode)

getFrameDamping

public double getFrameDamping()

setFrameDamping

public void setFrameDamping(double d)

getFrameDampingMode

public PropertyMode getFrameDampingMode()

setFrameDampingMode

public void setFrameDampingMode(PropertyMode mode)

getRotaryDamping

public double getRotaryDamping()

setRotaryDamping

public void setRotaryDamping(double d)

getRotaryDampingMode

public PropertyMode getRotaryDampingMode()

setRotaryDampingMode

public void setRotaryDampingMode(PropertyMode mode)

getGravity

public Vector3d getGravity()

setGravity

public void setGravity(Vector3d g)

setGravity

public void setGravity(double gx,
                       double gy,
                       double gz)

getGravityMode

public PropertyMode getGravityMode()

setGravityMode

public void setGravityMode(PropertyMode mode)

addAxialSpring

public void addAxialSpring(AxialSpring s)

attachAxialSpring

public void attachAxialSpring(Point pnt0,
                              Point pnt1,
                              AxialSpring s)

removeAxialSpring

public void removeAxialSpring(AxialSpring s)

clearAxialSprings

public void clearAxialSprings()

addMultiPointSpring

public void addMultiPointSpring(MultiPointSpring s)

removeMultiPointSpring

public void removeMultiPointSpring(MultiPointSpring s)

clearMultiPointSprings

public void clearMultiPointSprings()

addFrameSpring

public void addFrameSpring(FrameSpring s)

attachFrameSpring

public void attachFrameSpring(Frame frameA,
                              Frame frameB,
                              FrameSpring s)

removeFrameSpring

public void removeFrameSpring(FrameSpring s)

clearFrameSprings

public void clearFrameSprings()

addForceEffector

public void addForceEffector(ForceComponent fe)

removeForceEffector

public void removeForceEffector(ForceEffector fe)

clearForceEffectors

public void clearForceEffectors()

addMuscleExciter

public void addMuscleExciter(MuscleExciter mex)

removeMuscleExciter

public boolean removeMuscleExciter(MuscleExciter mex)

getMuscleExciters

public ComponentList<MuscleExciter> getMuscleExciters()

rigidBodies

public ComponentListView<RigidBody> rigidBodies()

addRigidBody

public void addRigidBody(RigidBody rb)

removeRigidBody

public void removeRigidBody(RigidBody rb)

clearRigidBodies

public void clearRigidBodies()

meshBodies

public ComponentListView<MeshComponent> meshBodies()

addMeshBody

public void addMeshBody(MeshComponent rb)

removeMeshBody

public void removeMeshBody(MeshComponent rb)

clearMeshBodies

public void clearMeshBodies()

addFrameMarker

public void addFrameMarker(FrameMarker mkr,
                           Frame frame,
                           Point3d loc)

addFrameMarker

public void addFrameMarker(FrameMarker mkr)

removeFrameMarker

public void removeFrameMarker(FrameMarker mkr)

clearFrameMarkers

public void clearFrameMarkers()

frameMarkers

public RenderableComponentList<FrameMarker> frameMarkers()

rigidBodyConnectors

public ComponentListView<RigidBodyConnector> rigidBodyConnectors()

addRigidBodyConnector

public void addRigidBodyConnector(RigidBodyConnector c)

removeRigidBodyConnector

public void removeRigidBodyConnector(RigidBodyConnector c)

clearRigidBodyConnectors

public void clearRigidBodyConnectors()

constrainers

public ComponentListView<ConstrainerBase> constrainers()

addConstrainer

public void addConstrainer(ConstrainerBase c)

removeConstrainer

public void removeConstrainer(ConstrainerBase c)

clearConstrainers

public void clearConstrainers()

renderables

public ComponentListView<RenderableComponent> renderables()

addRenderable

public void addRenderable(RenderableComponent rb)

removeRenderable

public void removeRenderable(RenderableComponent rb)

clearRenderables

public void clearRenderables()

models

public ComponentListView<MechSystemModel> models()

addModel

public void addModel(MechSystemModel m)

removeModel

public boolean removeModel(MechSystemModel m)

clearModels

public void clearModels()

attachPoint

public void attachPoint(Point p1,
                        Particle p2)

attachPoint

public void attachPoint(Point p1,
                        RigidBody body,
                        Point3d loc)

attachPoint

public void attachPoint(Point p1,
                        FemModel3d fem,
                        double reduceTol)
Attaches a point to an FEM. The point in question is connected to either its containing element, or projected to the nearest surface element.

Parameters:
p1 - Point to connect. Must currently be a particle.
fem - FemModel to connect the point to.
reduceTol - if > 0, attempts to reduce the number of nodes in the connection by removing any whose coordinate weights are less than reduceTol.

attachPoint

public void attachPoint(Point p1,
                        FemElement3d elem)
Attaches a point to the element of an FEM. The points coordinates within the element are determined using its current position, whether or not the point is outside the element.

Parameters:
p1 - Point to connect. Must currently be a particle.
elem - Element to connect the point to.

attachPoint

public void attachPoint(Point p1,
                        RigidBody body)

attachments

public ComponentList<DynamicAttachment> attachments()

addAttachment

public void addAttachment(DynamicAttachment ax)

detachPoint

public boolean detachPoint(Point p1)

getAttachments

public void getAttachments(java.util.List<DynamicAttachment> list,
                           int level)
Specified by:
getAttachments in interface MechSystemModel

getAddConstraintForces

public boolean getAddConstraintForces()

setAddConstraintForces

public void setAddConstraintForces(boolean enable)

isActive

public static boolean isActive(DynamicMechComponent c)

getDynamicComponents

public void getDynamicComponents(java.util.List<DynamicMechComponent> active,
                                 java.util.List<DynamicMechComponent> attached,
                                 java.util.List<DynamicMechComponent> parametric)
Specified by:
getDynamicComponents in interface MechSystemModel

getConstrainers

public void getConstrainers(java.util.List<Constrainer> list,
                            int level)
Specified by:
getConstrainers in interface MechSystemModel

getForceEffectors

public void getForceEffectors(java.util.List<ForceEffector> list,
                              int level)
Specified by:
getForceEffectors in interface MechSystemModel

getAuxStateComponents

public void getAuxStateComponents(java.util.List<HasAuxState> list,
                                  int level)
Specified by:
getAuxStateComponents in interface MechSystemModel

getSlaveObjectComponents

public void getSlaveObjectComponents(java.util.List<HasSlaveObjects> list,
                                     int level)
Should be overridden in subclasses to return all the HasSlaveObjects ' components within this model.

Specified by:
getSlaveObjectComponents in interface MechSystemModel
Overrides:
getSlaveObjectComponents in class MechSystemBase
Parameters:
list - HasSlaveObjects components should be added to this list

projectRigidBodyPositionConstraints

public void projectRigidBodyPositionConstraints()

combineMatrixTypes

public int combineMatrixTypes(int type1,
                              int type2)

getPrintState

public java.lang.String getPrintState()

setPrintState

public void setPrintState(java.lang.String fmt)

openPrintStateFile

public java.io.PrintWriter openPrintStateFile(java.lang.String name)
                                       throws java.io.IOException
Throws:
java.io.IOException

reopenPrintStateFile

public java.io.PrintWriter reopenPrintStateFile(java.lang.String name)
                                         throws java.io.IOException
Throws:
java.io.IOException

closePrintStateFile

public void closePrintStateFile()
                         throws java.io.IOException
Throws:
java.io.IOException

preadvance

public StepAdjustment preadvance(double t0,
                                 double t1,
                                 int flags)
Description copied from class: ModelBase
Prepares this object for advance from time t0 to time t1. Often this method does nothing; it is provided in case a model needs to update internal state at the very beginning a step before input probes and controllers are applied.

If the method determines that the step size should be reduced, it can return a StepAdjustment object indicating the recommended reduction. Otherwise, the method may return null

Specified by:
preadvance in interface Model
Overrides:
preadvance in class MechSystemBase
Parameters:
t0 - current time (seconds)
t1 - new time to advance to (seconds)
flags - reserved for future use
Returns:
null, or a step adjustment recommendation

advance

public StepAdjustment advance(double t0,
                              double t1,
                              int flags)
Description copied from class: ModelBase
Advances this object from time t0 to time t1.

If the method determines that the step size should be reduced, it can return a StepAdjustment object indicating the recommended reduction. Otherwise, the method may return null

Specified by:
advance in interface Model
Specified by:
advance in class ModelBase
Parameters:
t0 - current time (seconds)
t1 - new time to advance to (seconds)
flags - reserved for future use
Returns:
null, or a step adjustment recommendation

recursivelyFinalizeAdvance

public void recursivelyFinalizeAdvance(StepAdjustment stepAdjust,
                                       double t0,
                                       double t1,
                                       int flags,
                                       int level)
Specified by:
recursivelyFinalizeAdvance in interface MechSystemModel
Overrides:
recursivelyFinalizeAdvance in class MechSystemBase

recursivelyInitialize

public void recursivelyInitialize(double t,
                                  int level)
Specified by:
recursivelyInitialize in interface MechSystemModel
Overrides:
recursivelyInitialize in class MechSystemBase

setBounds

public void setBounds(Point3d pmin,
                      Point3d pmax)

scan

public void scan(ReaderTokenizer rtok,
                 java.lang.Object ref)
          throws java.io.IOException
Description copied from class: ModelComponentBase
Scans this element from a ReaderTokenizer. The expected text format is assumed to be compatible with that produced by write.

Specified by:
scan in interface ModelComponent
Specified by:
scan in interface Scannable
Overrides:
scan in class ComponentList<ModelComponent>
Parameters:
rtok - Tokenizer from which to scan the element
ref - optional reference object which can be used for resolving references to other objects
Throws:
java.io.IOException - if an I/O or formatting error occured

updateBounds

public void updateBounds(Point3d pmin,
                         Point3d pmax)
Description copied from interface: GLRenderable
Update the minimum and maximum points for this object. In an x-y-z coordinate system with x directed to the right and y directed upwards, the minimum and maximum points can be thought of as defining the left-lower-far and right-upper-near corners of a bounding cube. This method should only reduce the elements of the minimum point and increase the elements of the maximum point, since it may be used as part of an iteration to determine the bounding cube for several different objects.

Specified by:
updateBounds in interface GLRenderable
Overrides:
updateBounds in class RenderableModelBase
Parameters:
pmin - minimum point
pmax - maximum point

render

public void render(GLRenderer renderer,
                   int flags)
Description copied from interface: GLRenderable
Render this object using Open GL via the JOGL.

Specified by:
render in interface GLRenderable
Specified by:
render in class RenderableModelBase
Parameters:
renderer - renderer object which is used to perform the rendering. Provides pointers to GL and GLU, along with helper functions.
flags - supplies flags that may be used to control different aspects of the rendering. Flags are defined in GLRenderer and currently include GLRenderer.SELECTED, GLRenderer.VERTEX_COLORING, GLRenderer.HSV_COLOR_INTERPOLATION, GLRenderer.SORT_FACES, and GLRenderer.CLEAR_MESH_DISPLAY_LISTS.

transformGeometry

public void transformGeometry(AffineTransform3dBase X)
Description copied from interface: TransformableGeometry
Applies an affine transformation to the geometry of this object. This method should be equivalent to
 transformGeometry (X, this, 0);
 

Specified by:
transformGeometry in interface TransformableGeometry
Parameters:
X - affine transformation

transformGeometry

public void transformGeometry(AffineTransform3dBase X,
                              TransformableGeometry topObject,
                              int flags)
Description copied from interface: TransformableGeometry
Applies an affine transformation to the geometry of this object. If recursively invoked within a component hierarchy, then topComponent should be the component for which the method was initially invoked. The variable flags provides information about the context in which the transformation is being applied. At present, the available flags are TransformableGeometry.SIMULATING and TransformableGeometry.ARTICULATED.

Specified by:
transformGeometry in interface TransformableGeometry
Parameters:
X - affine transformation
topObject - component on which the method was initially invoked
flags - provides information about the context in which the transformation is being applied.

scaleDistance

public void scaleDistance(double s)
Description copied from interface: ScalableUnits
Scales all distance coordinates.

Specified by:
scaleDistance in interface ScalableUnits
Parameters:
s - scaling factor

scaleMass

public void scaleMass(double s)
Description copied from interface: ScalableUnits
Scales all mass units.

Specified by:
scaleMass in interface ScalableUnits
Parameters:
s - scaling factor

hasState

public boolean hasState()
Returns true if this component has state. Structure change events involving components that have state will cause the current state history of of the system to be cleared.

Specified by:
hasState in interface ModelComponent
Overrides:
hasState in class ModelComponentBase

lowestCommonModel

public static MechModel lowestCommonModel(ModelComponent comp1,
                                          ModelComponent comp2)

topMechModel

public static MechModel topMechModel(ModelComponent comp)
Returns the topmost MechModel, if any, that is associated with a specific component.

Parameters:
comp - component to start with
Returns:
topmost MechModel on or above comp, or null if there is none.

setProfiling

public void setProfiling(boolean enable)

getProfiling

public boolean getProfiling()

componentChanged

public void componentChanged(ComponentChangeEvent e)
Description copied from class: ComponentList
Notifies this composite component that a change has occured within one or more of its descendants. When this occurs, the composite may need to invalidate cached information that depends on the descendants.

This method should propagate the notification up the component hierarchy by calling notifyParentOfChange.

Specified by:
componentChanged in interface ComponentChangeListener
Specified by:
componentChanged in interface CompositeComponent
Overrides:
componentChanged in class ComponentList<ModelComponent>
Parameters:
e - optional argument giving specific information about the change

checkVelocityStability

public DynamicMechComponent checkVelocityStability()
Checks the velocity stability of this system. If the velocity of any component appears to be unstable, return that component. Otherwise, return null.

Specified by:
checkVelocityStability in interface MechSystemModel

dispose

public void dispose()
Description copied from class: ModelBase
Called when the model is discarded. Disposes of any resources used.

Specified by:
dispose in interface Model
Specified by:
dispose in interface Disposable
Overrides:
dispose in class ModelBase