artisynth.core.mechmodels
Class DynamicMechComponentBase

java.lang.Object
  extended by artisynth.core.modelbase.ModelComponentBase
      extended by artisynth.core.modelbase.RenderableComponentBase
          extended by artisynth.core.mechmodels.DynamicMechComponentBase
All Implemented Interfaces:
DynamicMechComponent, ForceEffector, ModelComponent, RenderableComponent, java.lang.Cloneable, HasProperties, HierarchyNode, GLRenderable, GLSelectable, HasRenderProps, Renderable, Scannable
Direct Known Subclasses:
Frame, Point

public abstract class DynamicMechComponentBase
extends RenderableComponentBase
implements DynamicMechComponent


Nested Class Summary
 
Nested classes/interfaces inherited from interface artisynth.core.modelbase.ModelComponent
ModelComponent.NavpanelVisibility
 
Field Summary
 
Fields inherited from class artisynth.core.modelbase.ModelComponentBase
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, myProps, NULL_OBJ, useCompactPathNames
 
Fields inherited from interface maspack.render.GLRenderable
TRANSLUCENT, TWO_DIMENSIONAL
 
Constructor Summary
DynamicMechComponentBase()
           
 
Method Summary
 void addMasterAttachment(DynamicAttachment a)
           
abstract  void addSolveBlock(SparseNumberedBlockMatrix S)
           
 ModelComponent copy(int flags, java.util.Map<ModelComponent,ModelComponent> copyMap)
           
 DynamicAttachment getAttachment()
          Returns the slave attachment associated with this component, if any.
 void getInverseMass(Matrix Minv, Matrix M)
          Inverts a mass for this component.
 java.util.LinkedList<DynamicAttachment> getMasterAttachments()
          Returns a list of the attachments for which this component is a master, or null if there are no such attachments.
 int getSolveIndex()
           
 boolean hasState()
          Returns true if this component has state.
 boolean isActive()
          Returns true if this component is active.
 boolean isAttached()
          Returns true if this component is attached.
 boolean isControllable()
          Returns true is this component is active, or it is attached to one or more other components which ultimately are attached to at least one active component.
 boolean isDynamic()
          Returns true if this component is dynamic.
 boolean isParametric()
          Returns true if the state of this component is determined parametrically; i.e., it is neither dynamic nor attached.
 void removeMasterAttachment(DynamicAttachment a)
           
 void setAttached(DynamicAttachment attachment)
          M Attach this component to another via a DynamicAttachment object.
 void setSolveIndex(int idx)
           
 
Methods inherited from class artisynth.core.modelbase.RenderableComponentBase
createRenderProps, getRenderHints, getRenderProps, getSelection, isSelectable, numSelectionQueriesNeeded, prerender, render, setRenderProps, updateBounds, updateRenderProps
 
Methods inherited from class artisynth.core.modelbase.ModelComponentBase
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, createTempFlag, disconnectFromHierarchy, getAllPropertyInfo, getChildren, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, 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.mechmodels.DynamicMechComponent
addPosImpulse, applyGravity, checkFlag, clearFlag, createMassBlock, createSolveBlock, getForce, getMass, getMass, getMassForces, getPosDerivative, getPosState, getPosStateSize, getVelState, getVelStateSize, isMassConstant, setFlag, setForce, setForcesToExternal, setPosState, setState, setVelState, velocityLimitExceeded, zeroExternalForces, zeroForces
 
Methods inherited from interface artisynth.core.modelbase.ModelComponent
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, isFixed, isMarked, isSelected, notifyParentOfChange, postscan, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, updateReferences
 
Methods inherited from interface maspack.properties.HasProperties
getAllPropertyInfo, 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.mechmodels.ForceEffector
addPosJacobian, addSolveBlocks, addVelJacobian, applyForces, getJacobianType
 

Constructor Detail

DynamicMechComponentBase

public DynamicMechComponentBase()
Method Detail

getAttachment

public DynamicAttachment getAttachment()
Description copied from interface: DynamicMechComponent
Returns the slave attachment associated with this component, if any.

Specified by:
getAttachment in interface DynamicMechComponent
Returns:
slave attachment, or null if the component is unattached

isDynamic

public boolean isDynamic()
Description copied from interface: DynamicMechComponent
Returns true if this component is dynamic. If a component is unattached, then its state is determined by forces if it is dynamic, or parametrically if it is non-dynamic.

Specified by:
isDynamic in interface DynamicMechComponent
Returns:
true if this component is dynamic

setAttached

public void setAttached(DynamicAttachment attachment)
Description copied from interface: DynamicMechComponent
M Attach this component to another via a DynamicAttachment object.

Specified by:
setAttached in interface DynamicMechComponent
Parameters:
attachment - Specifies the attachment relationship between this component and its master(s)

isActive

public boolean isActive()
Description copied from interface: DynamicMechComponent
Returns true if this component is active. A component is active if its position and velocity are determined by forces, which implies that it is dynamic and unattached.

Specified by:
isActive in interface DynamicMechComponent
Returns:
true if this component is active

isAttached

public boolean isAttached()
Description copied from interface: DynamicMechComponent
Returns true if this component is attached. The state of an attached component is derived from the state of an attached master component.

Specified by:
isAttached in interface DynamicMechComponent
Returns:
true if this component is attached

isParametric

public boolean isParametric()
Description copied from interface: DynamicMechComponent
Returns true if the state of this component is determined parametrically; i.e., it is neither dynamic nor attached.

Specified by:
isParametric in interface DynamicMechComponent
Returns:
true if this component's state is determined parametrically.

isControllable

public boolean isControllable()
Description copied from interface: DynamicMechComponent
Returns true is this component is active, or it is attached to one or more other components which ultimately are attached to at least one active component.

Specified by:
isControllable in interface DynamicMechComponent
Returns:
true if this component is controllable.

getSolveIndex

public int getSolveIndex()
Specified by:
getSolveIndex in interface DynamicMechComponent

setSolveIndex

public void setSolveIndex(int idx)
Specified by:
setSolveIndex in interface DynamicMechComponent

addSolveBlock

public abstract void addSolveBlock(SparseNumberedBlockMatrix S)
Specified by:
addSolveBlock in interface DynamicMechComponent

getInverseMass

public void getInverseMass(Matrix Minv,
                           Matrix M)
Description copied from interface: DynamicMechComponent
Inverts a mass for this component.

Specified by:
getInverseMass in interface DynamicMechComponent
Parameters:
Minv - matrix to return the inverse mass in
M - matrix containing the mass to be inverted

addMasterAttachment

public void addMasterAttachment(DynamicAttachment a)
Specified by:
addMasterAttachment in interface DynamicMechComponent

removeMasterAttachment

public void removeMasterAttachment(DynamicAttachment a)
Specified by:
removeMasterAttachment in interface DynamicMechComponent

getMasterAttachments

public java.util.LinkedList<DynamicAttachment> getMasterAttachments()
Description copied from interface: DynamicMechComponent
Returns a list of the attachments for which this component is a master, or null if there are no such attachments. The returned list must not be modified.

Specified by:
getMasterAttachments in interface DynamicMechComponent
Returns:
list of master attachments

copy

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

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