public class PointSkinAttachment extends PointAttachment implements ScalableUnits
The class maintains a list of Connection
objects for each
underlying dynamic component (such as a Frame
or
FemNode3d
) that has a weighted influence on the point's final
value.
ModelComponent.NavpanelVisibility
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, myProps, NULL_OBJ, useCompactPathNames
COPY_REFERENCES
Constructor and Description |
---|
PointSkinAttachment()
Creates an empty PointSkinAttachment.
|
PointSkinAttachment(SkinMesh skinMesh)
Creates an empty PointSkinAttachment to associated with a specific
skinMesh.
|
Modifier and Type | Method and Description |
---|---|
void |
addBaseConnection(double weight)
Adds a base point connection to this attachment.
|
void |
addFemDisplacementConnection(FemNode3d node,
double weight)
Adds a displacment-based FemNode connection to this attachment.
|
void |
addFrameConnection(SkinMesh.FrameInfo frameInfo,
double weight)
Adds a Frame connection to this attachment.
|
void |
addMassToMaster(MatrixBlock mblk,
MatrixBlock sblk,
int idx) |
void |
addParticleConnection(Particle particle,
double weight)
Adds an arbitrary particle connection to this attachment.
|
void |
addScaledExternalForce(Point3d pnt,
double s,
Vector3d f)
Distributes an external force applied at a particular point
to all masters
|
void |
applyForces() |
void |
clearConnections()
Clear the connections used by this attachment.
|
void |
computePosState(Vector3d pos) |
void |
connectToHierarchy()
Update the attachment position state whenever we connect to the parent
(i.e., plug in to the hierarchy).
|
PointSkinAttachment |
copy(int flags,
java.util.Map<ModelComponent,ModelComponent> copyMap)
Create a copy of this component.
|
void |
disconnectFromHierarchy()
Called by the system after this component is removed from the component
hierarchy (i.e., when it is removed as a child of its parent).
|
void |
finalizeConnections()
Should be called after all connections have been added.
|
Point3d |
getBasePosition()
Gets the base position for this attachment.
|
artisynth.core.femmodels.PointSkinAttachment.Connection |
getConnection(int idx)
Gets a specific connection used by this attachent.
|
boolean |
getDerivative(double[] buf,
int idx) |
DynamicMechComponent |
getMaster(int idx)
Returns the underlying master component for a connection used by this
attachment.
|
DynamicMechComponent[] |
getMasters() |
SkinMesh |
getSkinMesh()
Returns the SkinMesh associated with this attachment.
|
void |
getSoftReferences(java.util.List<ModelComponent> refs)
Appends all soft references for this component to a list.
|
double |
getWeight(int idx)
Returns the weight for a connection used by this attachment.
|
void |
mulSubG(MatrixBlock D,
MatrixBlock B,
int idx)
Computes
|
void |
mulSubGT(double[] ybuf,
int yoff,
double[] xbuf,
int xoff,
int idx)
Computes
|
void |
mulSubGT(MatrixBlock D,
MatrixBlock B,
int idx)
Computes
|
int |
numConnections()
Returns the number of connections (to master components) used by this
attachment.
|
int |
numMasters() |
void |
postscan(java.util.Deque<ScanToken> tokens,
CompositeComponent ancestor)
Performs any required post-scanning for this component.
|
void |
scaleBaseWeights(double s,
artisynth.core.femmodels.PointSkinAttachment.Connection[] connections) |
void |
scaleDistance(double s)
Scales all distance coordinates.
|
void |
scaleMass(double s)
Scales all mass units.
|
void |
setBasePosition(Vector3d pos)
Sets the base position for this attachment.
|
void |
setSkinMesh(SkinMesh skinMesh)
Sets the SkinMesh associated with this attachment.
|
void |
setWeight(int idx,
double w)
Sets the weight for a connection used by this attachment.
|
void |
transformSlaveGeometry(AffineTransform3dBase X,
TransformableGeometry topObject,
int flags) |
void |
trimToSize()
Minimizes the connection storage space.
|
void |
updateAttachment()
Update attachment to reflect changes in the slave state.
|
void |
updatePosStates() |
void |
updateReferences(boolean undo,
java.util.Deque<java.lang.Object> undoInfo)
May be called by the system if any of the soft references for
this component are removed from the the component hierarchy.
|
void |
updateVelStates() |
void |
writeItems(java.io.PrintWriter pw,
NumberFormat fmt,
CompositeComponent ancestor) |
getCopyReferences, getPoint, getSlave, getSlaveSolveIndex, isDuplicatable
addAttachmentJacobian, addSolveBlocks, clone, containsLoop, containsLoops, containsMaster, createOrderedList, reduceConstraints, reduceMass, reduceRowMatrix
checkFlag, checkName, checkNameUniqueness, clearFlag, createTempFlag, getAllPropertyInfo, getChildren, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, hasChildren, hasState, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, scan, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setSelected, write
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected
getAllPropertyInfo, getProperty
getChildren, hasChildren
isWritable, write
public PointSkinAttachment()
public PointSkinAttachment(SkinMesh skinMesh)
public SkinMesh getSkinMesh()
public void setSkinMesh(SkinMesh skinMesh)
public Point3d getBasePosition()
public void setBasePosition(Vector3d pos)
public int numConnections()
public void clearConnections()
public artisynth.core.femmodels.PointSkinAttachment.Connection getConnection(int idx)
idx
- index of the connection. Must be in the range 0 to
numConnections()
.public double getWeight(int idx)
idx
- index of the connection. Must be in the range 0 to
numConnections()
.public void setWeight(int idx, double w)
idx
- index of the connection. Must be in the range 0 to
numConnections()
.public DynamicMechComponent getMaster(int idx)
idx
- index of the connection. Must be in the range 0 to
numConnections()
.public void addFrameConnection(SkinMesh.FrameInfo frameInfo, double weight)
SkinMesh.getFrameBlending()
).frameInfo
- FrameInfo structure within the associated SkinMesh.weight
- connection weight.public void addFemDisplacementConnection(FemNode3d node, double weight)
node
- FemNodeweight
- connection weight.public void addBaseConnection(double weight)
getBasePosition()
will be used to compute a
weighted contribution to the point value.weight
- connection weight.public void addParticleConnection(Particle particle, double weight)
particle
- particle associated with the attachment.weight
- connection weight.public void addScaledExternalForce(Point3d pnt, double s, Vector3d f)
PointAttachment
addScaledExternalForce
in class PointAttachment
pnt
- point at which to apply the force (to be used to compute a wrench)s
- force scale factorf
- force vector to applypublic void trimToSize()
public void finalizeConnections()
public DynamicMechComponent[] getMasters()
getMasters
in class DynamicAttachment
public int numMasters()
numMasters
in class DynamicAttachment
public void computePosState(Vector3d pos)
computePosState
in class PointAttachment
public void updatePosStates()
updatePosStates
in class DynamicAttachment
public void updateVelStates()
updateVelStates
in class DynamicAttachment
public void applyForces()
applyForces
in class DynamicAttachment
public void mulSubGT(MatrixBlock D, MatrixBlock B, int idx)
DynamicAttachment
T D -= G Bwhere D and B are matrices associated with master and slave components, respectively, and G is the constraint matrix for the attachment.
D
- dependent matrix associated with a master componentB
- matrix associated with a slave componentpublic void mulSubG(MatrixBlock D, MatrixBlock B, int idx)
DynamicAttachment
D -= B Gwhere D and B are matrices associated with master and slave components, respectively, and G is the constraint matrix for the attachment.
D
- dependent matrix associated with a master componentB
- matrix associated with a slave componentpublic void mulSubGT(double[] ybuf, int yoff, double[] xbuf, int xoff, int idx)
DynamicAttachment
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.
ybuf
- buffer into which to store resultyoff
- offset into ybufxbuf
- buffer containing right hand side vectorxoff
- offset into xbufidx
- master component indexpublic void updateAttachment()
DynamicAttachment
updateAttachment
in class DynamicAttachment
public void transformSlaveGeometry(AffineTransform3dBase X, TransformableGeometry topObject, int flags)
transformSlaveGeometry
in class DynamicAttachment
public void addMassToMaster(MatrixBlock mblk, MatrixBlock sblk, int idx)
addMassToMaster
in class DynamicAttachment
public void postscan(java.util.Deque<ScanToken> tokens, CompositeComponent ancestor) throws java.io.IOException
ModelComponent
scan()
method and stored in the token queue.
The most common use of this method is to resolve the paths
of component references, which may not have been created
at the time of the initial scan()
call.postscan
in interface ModelComponent
postscan
in class ModelComponentBase
tokens
- token information that was stored during
scan()
.ancestor
- ancestor component with respect to which
reference component paths are defined.java.io.IOException
public void writeItems(java.io.PrintWriter pw, NumberFormat fmt, CompositeComponent ancestor) throws java.io.IOException
writeItems
in class PointAttachment
java.io.IOException
public boolean getDerivative(double[] buf, int idx)
getDerivative
in class DynamicAttachment
public void connectToHierarchy()
DynamicAttachment
connectToHierarchy
in interface ModelComponent
connectToHierarchy
in class DynamicAttachment
public void disconnectFromHierarchy()
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
public void getSoftReferences(java.util.List<ModelComponent> refs)
ModelComponentBase
updateReferences()
method will
be called to update its internal reference information.getSoftReferences
in interface ModelComponent
getSoftReferences
in class ModelComponentBase
refs
- list to which soft references are appendedpublic void scaleDistance(double s)
ScalableUnits
scaleDistance
in interface ScalableUnits
s
- scaling factorpublic void scaleMass(double s)
ScalableUnits
scaleMass
in interface ScalableUnits
s
- scaling factorpublic PointSkinAttachment 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 CopyableComponent
copy
in class PointAttachment
public void scaleBaseWeights(double s, artisynth.core.femmodels.PointSkinAttachment.Connection[] connections)
public void updateReferences(boolean undo, java.util.Deque<java.lang.Object> undoInfo)
undo
equal to false
,
this component should then examine its soft references and
use ComponentUtils.isConnected()
to determine which of them have been disconnected from the hierarchy.
Disconnected references should be removed, and sufficient information
should be appended to undoInfo
to allow this update
to be undone if this method is called later with undo
equal to true
. When undoing an update, the undo
information should be removed from the front of undoInfo
.updateReferences
in interface ModelComponent
updateReferences
in class ModelComponentBase
undo
- if true
, indicates that the most
recent reference update should be undone, using the supplied
undo information.undoInfo
- if undo
is false
, should be used
to store information allowing the reference update to be undone.
Otherwise, if undo
is true
, then this
supplied information to undo the most recent update.