public abstract class FrameAttachment extends DynamicAttachmentBase implements CopyableComponent, ScalableUnits
ModelComponent.NavpanelVisibility
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, myProps, NULL_OBJ, useCompactPathNames
COPY_REFERENCES, REST_POSITION
Constructor and Description |
---|
FrameAttachment() |
Modifier and Type | Method and Description |
---|---|
abstract void |
applyForce(Wrench wr)
Applies a force to this frame, in world coordinates, by propagating
it through to the underlying master bodies.
|
void |
applyForces() |
FrameAttachment |
copy(int flags,
java.util.Map<ModelComponent,ModelComponent> copyMap)
Create a copy of this component.
|
abstract double |
getAverageMasterInertia()
Returns the average rotational inertia of the master components as seen
by the attached frame.
|
abstract double |
getAverageMasterMass()
Returns the average mass of the master components as seen by the attached
frame.
|
boolean |
getCopyReferences(java.util.List<ModelComponent> refs,
ModelComponent ancestor)
Collects external references which must also be copied in order to
duplicate this component.
|
abstract void |
getCurrentTFW(RigidTransform3d TFW)
Returns the current pose of the attached frame, in world coordinates.
|
abstract void |
getCurrentVel(Twist vel,
Twist dvel)
Returns the current velocity of the attached frame, in frame coordinates.
|
Frame |
getFrame() |
MatrixBlock |
getGT(int idx)
Returns the transpose of the constraint matrix G associated
with the idx-th master component.
|
MatrixBlock[] |
getMasterBlocks() |
DynamicComponent[] |
getMasters() |
Frame |
getSlave()
Returns the slave DynamicMechComponent associated with this attachment.
|
abstract void |
getUndeformedTFW(RigidTransform3d TFW)
Returns the current undeformed pose of the attached frame, in world
coordinates.
|
void |
invalidateMasters() |
boolean |
isDuplicatable()
Returns true if this component can be duplicated.
|
abstract boolean |
isFlexible()
Indicates that this attachment is flexible.
|
void |
mulSubGT(double[] ybuf,
int yoff,
double[] xbuf,
int xoff,
int idx)
Computes
|
void |
mulSubGTM(MatrixBlock D,
MatrixBlock M,
int idx)
Computes
|
void |
mulSubMG(MatrixBlock D,
MatrixBlock M,
int idx)
Computes
|
int |
numMasters() |
void |
scaleMass(double m)
Nothing to do for scale mass.
|
abstract boolean |
setCurrentTFW(RigidTransform3d TFW)
Sets the current pose of the attached frame, in world coordinates.
|
void |
transformGeometry(AffineTransform3dBase X,
RigidTransform3d TFW) |
void |
writeItems(java.io.PrintWriter pw,
NumberFormat fmt,
CompositeComponent ancestor) |
addBackRefs, addBackRefs, addConnectedMasterRefs, addMassToMasters, clone, connectAttachment, connectToHierarchy, disconnectFromHierarchy, getAttachment, getDerivative, getHardReferences, oneMasterActive, oneMasterNotAttached, removeBackRefs, removeBackRefs, removeConnectedMasterRefs, setSlaveAffectsStiffness, slaveAffectsStiffness, updateAttachment, updatePosStates, updateVelStates
checkFlag, checkName, checkNameUniqueness, clearFlag, createTempFlag, getAllPropertyInfo, getChildren, getGrandParent, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, hasState, 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
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritable, updateReferences
getAllPropertyInfo, getProperty
getChildren, hasChildren
postscan
isWritable, write
scaleDistance
public Frame getSlave()
DynamicAttachmentBase
null
.getSlave
in interface DynamicAttachment
getSlave
in class DynamicAttachmentBase
public Frame getFrame()
public DynamicComponent[] getMasters()
getMasters
in interface DynamicAttachment
getMasters
in class DynamicAttachmentBase
public MatrixBlock[] getMasterBlocks()
public int numMasters()
numMasters
in interface DynamicAttachment
numMasters
in class DynamicAttachmentBase
public void invalidateMasters()
invalidateMasters
in interface DynamicAttachment
invalidateMasters
in class DynamicAttachmentBase
public abstract boolean isFlexible()
true
if this attachment is flexible.public abstract void getCurrentTFW(RigidTransform3d TFW)
TFW
- used to return current frame pose.public abstract void getUndeformedTFW(RigidTransform3d TFW)
getCurrentTFW()
.TFW
- used to return current undeformed frame pose.isFlexible()
public abstract boolean setCurrentTFW(RigidTransform3d TFW)
TFW
- new pose for the attached frame, in world coordinatestrue
if the underlying master
components have changedpublic abstract void getCurrentVel(Twist vel, Twist dvel)
\dot J velmwhere
J
is the matrix that maps master velocities
to the attached frame velocity (in frame coordinates), and velm
are the master velocities.vel
- used to return current frame velocitydvel
- if not null
, returns the velocity derivative termpublic abstract void applyForce(Wrench wr)
wr
- force to apply to the framepublic abstract double getAverageMasterMass()
public abstract double getAverageMasterInertia()
public void writeItems(java.io.PrintWriter pw, NumberFormat fmt, CompositeComponent ancestor) throws java.io.IOException
java.io.IOException
public FrameAttachment copy(int flags, java.util.Map<ModelComponent,ModelComponent> copyMap)
CopyableComponent
COPY_REFERENCES
is set in flags
, then any component referenced
by this component should itself be set to a copy. This
should be done first checking copyMap
for an
existing copy of the referenced component. If there is no existing
copy, then a copy should be created by calling copy
recursively and adding the new copy to copyMap
.copy
in interface DynamicAttachmentComp
copy
in interface CopyableComponent
copy
in class DynamicAttachmentBase
flags
- flags to control the copyingcopyMap
- map to possible existing instances of referenced
componentspublic void applyForces()
applyForces
in interface DynamicAttachment
applyForces
in class DynamicAttachmentBase
public boolean isDuplicatable()
true
if and only if CopyableComponent.getCopyReferences(java.util.List<artisynth.core.modelbase.ModelComponent>, artisynth.core.modelbase.ModelComponent)
returns true.
This method is not currently used. It is intended to provide a faster
way of determining if a component can be duplicated, without having to
use CopyableComponent.getCopyReferences(java.util.List<artisynth.core.modelbase.ModelComponent>, artisynth.core.modelbase.ModelComponent)
to build the list of copy references.
isDuplicatable
in interface CopyableComponent
true
if this component can be duplicated.public boolean getCopyReferences(java.util.List<ModelComponent> refs, ModelComponent ancestor)
true
if and only if CopyableComponent.isDuplicatable()
returns
true.getCopyReferences
in interface CopyableComponent
refs
- list to which references are appendedancestor
- root node of the hierarchy from which references are to be excludedpublic void mulSubGTM(MatrixBlock D, MatrixBlock M, int idx)
T D -= G Mwhere D and M are matrices associated with master and slave components, respectively, and G is the constraint matrix for the attachment.
mulSubGTM
in interface DynamicAttachment
mulSubGTM
in class DynamicAttachmentBase
D
- dependent matrix associated with a master componentM
- matrix associated with a slave componentpublic void mulSubMG(MatrixBlock D, MatrixBlock M, int idx)
D -= M Gwhere D and M are matrices associated with master and slave components, respectively, and G is the constraint matrix for the attachment.
mulSubMG
in interface DynamicAttachment
mulSubMG
in class DynamicAttachmentBase
D
- dependent matrix associated with a master componentM
- matrix associated with a slave componentpublic MatrixBlock getGT(int idx)
DynamicAttachmentBase
getGT
in interface DynamicAttachment
getGT
in class DynamicAttachmentBase
idx
- index of the master componentpublic void mulSubGT(double[] ybuf, int yoff, double[] xbuf, int xoff, int idx)
T y -= G xwhere y and x are vectors associated with master and slave components, respectively, and G is the constraint matrix for the attachment.
mulSubGT
in interface DynamicAttachment
mulSubGT
in class DynamicAttachmentBase
ybuf
- buffer into which to store resultyoff
- offset into ybufxbuf
- buffer containing right hand side vectorxoff
- offset into xbufidx
- master component indexpublic void scaleMass(double m)
scaleMass
in interface ScalableUnits
m
- scaling factorpublic void transformGeometry(AffineTransform3dBase X, RigidTransform3d TFW)