public abstract class DynamicComponentBase extends RenderableComponentBase implements DynamicComponent
ModelComponent.NavpanelVisibility
myProps
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
TG_ARTICULATED, TG_DRAGGER, TG_PRESERVE_ORIENTATION, TG_SIMULATING
TRANSPARENT, TWO_DIMENSIONAL
Constructor and Description |
---|
DynamicComponentBase() |
Modifier and Type | Method and Description |
---|---|
void |
addAttachmentRequest(AttachingComponent ac) |
void |
addConstrainer(Constrainer c)
Adds a Constrainer to the list returned by
DynamicAgent.getConstrainers() . |
void |
addMasterAttachment(DynamicAttachment a)
Add a DynamicAttachment to the list of master attachments associated
with this component.
|
abstract void |
addSolveBlock(SparseNumberedBlockMatrix S) |
void |
addTransformableDependencies(TransformGeometryContext context,
int flags)
Adds to
context any transformable components which should be
transformed as the same time as this component. |
void |
connectToHierarchy(CompositeComponent comp)
Called by the system after this component, or an ancestor of this
component, is added to the component hierarchy (i.e., added as
a child of another CompositeComponent).
|
DynamicComponentBase |
copy(int flags,
java.util.Map<ModelComponent,ModelComponent> copyMap) |
void |
disconnectFromHierarchy(CompositeComponent comp)
Called by the system after this component, or an ancestor of this
component, is removed from the component hierarchy (i.e., removed as a
child of its parent).
|
DynamicAttachment |
getAttachment()
Returns the slave attachment associated with this component, if any.
|
java.util.List<Constrainer> |
getConstrainers()
Returns a list of Constrainers associated with this component.
|
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()
Queries 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.
|
boolean |
removeAttachmentRequest(AttachingComponent ac) |
boolean |
removeConstrainer(Constrainer c)
Removes a Constrainer from the list returned by
DynamicAgent.getConstrainers() . |
void |
removeMasterAttachment(DynamicAttachment a)
Removes a DynamicAttachment from the list of master attachments associated
with this component.
|
void |
setAttached(DynamicAttachment attachment)
Attach this component to another via a DynamicAttachment object.
|
void |
setSolveIndex(int idx) |
void |
transformGeometry(AffineTransform3dBase X)
Applies an affine transformation to the geometry of this component.
|
void |
transformGeometry(GeometryTransformer gtr,
TransformGeometryContext context,
int flags)
Transforms the geometry of this component, using the geometry transformer
gtr to transform its individual attributes. |
createRenderProps, defaultRenderPropsAreNull, getAllPropertyInfo, getRenderHints, getRenderProps, getSelection, isSelectable, isVisible, numSelectionQueriesNeeded, prerender, render, setRenderProps, setVisible, updateBounds, updateRenderProps
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, createTempFlag, getChildren, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, isFixed, isMarked, isScanning, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, scan, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setScanning, setSelected, setWritable, updateReferences, write
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addForce, addPosImpulse, applyExternalForces, applyGravity, createMassBlock, getEffectiveMass, getEffectiveMass, getEffectiveMassForces, getForce, getMass, getMass, getPosDerivative, getPosState, getPosStateSize, getState, getVelState, getVelStateSize, hasForce, isMassConstant, mulInverseEffectiveMass, resetEffectiveMass, setForce, setPosState, setRandomForce, setRandomPosState, setRandomVelState, setState, setVelState, velocityLimitExceeded, zeroExternalForces, zeroForces
advanceState, getAuxVarDerivative, getAuxVarState, getStateVersion, numAuxVars, requiresAdvance, setAuxVarState
getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, isFixed, isMarked, isSelected, notifyParentOfChange, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritable, updateReferences
getAllPropertyInfo, getProperty
getChildren, hasChildren
postscan
isWritable, write
addPosJacobian, addSolveBlocks, addVelJacobian, applyForces, getJacobianType
transformPriority
public DynamicAttachment getAttachment()
DynamicAgent
getAttachment
in interface DynamicAgent
public boolean isDynamic()
DynamicAgent
isDynamic
in interface DynamicAgent
public void setAttached(DynamicAttachment attachment)
DynamicAgent
setAttached
in interface DynamicAgent
attachment
- Specifies the attachment relationship between
this component and its master(s)public boolean isActive()
DynamicAgent
isActive
in interface DynamicAgent
public boolean isAttached()
DynamicAgent
isAttached
in interface DynamicAgent
public boolean isParametric()
DynamicAgent
isParametric
in interface DynamicAgent
public boolean isControllable()
DynamicAgent
isControllable
in interface DynamicAgent
public int getSolveIndex()
getSolveIndex
in interface DynamicAgent
public void setSolveIndex(int idx)
setSolveIndex
in interface DynamicAgent
public abstract void addSolveBlock(SparseNumberedBlockMatrix S)
addSolveBlock
in interface DynamicAgent
public void getInverseMass(Matrix Minv, Matrix M)
DynamicAgent
getInverseMass
in interface DynamicAgent
Minv
- matrix to return the inverse mass inM
- matrix containing the mass to be invertedpublic void addMasterAttachment(DynamicAttachment a)
addMasterAttachment
in interface DynamicAgent
a
- master attachment to addpublic void removeMasterAttachment(DynamicAttachment a)
removeMasterAttachment
in interface DynamicAgent
a
- master attachment to removepublic java.util.LinkedList<DynamicAttachment> getMasterAttachments()
getMasterAttachments
in interface DynamicAgent
public java.util.List<Constrainer> getConstrainers()
DynamicAgent
transformGeometry()
on this component may require some of
its constrainers to be updated.getConstrainers
in interface DynamicAgent
public void addConstrainer(Constrainer c)
DynamicAgent
DynamicAgent.getConstrainers()
.
This method is intended for internal use by the Constrainer components
themselves.addConstrainer
in interface DynamicAgent
c
- Constrainer to add the constrainer list.public boolean removeConstrainer(Constrainer c)
DynamicAgent
DynamicAgent.getConstrainers()
. This method is intended for internal use by the
Constrainer components themselves.removeConstrainer
in interface DynamicAgent
c
- Constrainer to remove from the constrainer list.true
if the constrainer was present in the list.public DynamicComponentBase copy(int flags, java.util.Map<ModelComponent,ModelComponent> copyMap)
copy
in class RenderableComponentBase
public boolean hasState()
hasState
in interface HasNumericState
hasState
in interface ModelComponent
hasState
in class ModelComponentBase
true
if this component has statepublic void transformGeometry(AffineTransform3dBase X)
TransformableGeometry
TransformGeometryContext.transform (this, X, 0);
transformGeometry
in interface TransformableGeometry
X
- affine transformation to apply to the componentpublic void addTransformableDependencies(TransformGeometryContext context, int flags)
TransformableGeometry
context
any transformable components which should be
transformed as the same time as this component. This will generally
include descendant components, and may also include other components to
which this component is connected in some way.
This method is generally called from with the
TransformGeometryContext.apply(maspack.geometry.GeometryTransformer, int)
method of a
TransformGeometryContext
.
addTransformableDependencies
in interface TransformableGeometry
context
- context information, to which the dependent components
are added.flags
- specifies conditions associated with the transformationpublic 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
gtr
- transformer implementing the transformcontext
- context information, including what other components
are being transformedflags
- specifies conditions associated with the transformationpublic void addAttachmentRequest(AttachingComponent ac)
addAttachmentRequest
in interface DynamicComponent
public boolean removeAttachmentRequest(AttachingComponent ac)
removeAttachmentRequest
in interface DynamicComponent
public void connectToHierarchy(CompositeComponent comp)
ModelComponentBase
When this method is called, ModelComponent.getParent()
will return the new
parent component; the system will have set this beforehand.
connectToHierarchy
in interface ModelComponent
connectToHierarchy
in class ModelComponentBase
comp
- hierarchy component to which this component,
or its ancestor, was attachedpublic void disconnectFromHierarchy(CompositeComponent comp)
ModelComponentBase
When this method is called, ModelComponent.getParent()
will still return this
original parent component; the system will set this to null
after.
disconnectFromHierarchy
in interface ModelComponent
disconnectFromHierarchy
in class ModelComponentBase
comp
- hierarchy component from which this component,
or its ancestor, was detached