artisynth.core.mechmodels
Class PointFrameAttachment

java.lang.Object
  extended by artisynth.core.modelbase.ModelComponentBase
      extended by artisynth.core.mechmodels.DynamicAttachment
          extended by artisynth.core.mechmodels.PointAttachment
              extended by artisynth.core.mechmodels.PointFrameAttachment
All Implemented Interfaces:
CopyableComponent, ModelComponent, java.lang.Cloneable, HasProperties, HierarchyNode, Scannable

public class PointFrameAttachment
extends PointAttachment


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 artisynth.core.modelbase.CopyableComponent
COPY_REFERENCES
 
Constructor Summary
PointFrameAttachment()
           
PointFrameAttachment(Frame master, Point slave)
           
PointFrameAttachment(Frame master, Point slave, Point3d loc)
           
 
Method Summary
 void addMassToMaster(MatrixBlock mblk, MatrixBlock sblk, int idx)
           
 void addScaledExternalForce(Point3d pnt, double s, Vector3d f)
          Distributes an external force applied at a particular point to all masters
 int addTargetJacobian(SparseBlockMatrix J, int bi)
           
 void applyForces()
           
 void computePosState(Vector3d pos)
           
 void connectToHierarchy()
          Update the attachment position state whenever we connect to the parent (i.e., plug in to the hierarchy).
 PointFrameAttachment copy(int flags, java.util.Map<ModelComponent,ModelComponent> copyMap)
          Create a copy of this component.
 void detachSlave()
           
 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).
 boolean getDerivative(double[] buf, int idx)
           
 Frame getFrame()
           
 void getHardReferences(java.util.List<ModelComponent> refs)
          Appends all hard references for this component to a list.
 Point3d getLocation()
           
 DynamicMechComponent[] getMasters()
           
 void mulSubG(MatrixBlock D, MatrixBlock B, int idx)
          Computes
 void mulSubGNew(MatrixBlock D, MatrixBlock B, int idx)
           
 void mulSubGT(double[] ybuf, int yoff, double[] xbuf, int xoff, int idx)
          Computes
 void mulSubGT(MatrixBlock D, MatrixBlock B, int idx)
          Computes
 void mulSubGTNew(MatrixBlock D, MatrixBlock B, int idx)
           
 int numMasters()
           
 void setDefaultLocation()
           
 void setLocation(Point3d pnt)
           
 void transformSlaveGeometry(AffineTransform3dBase X, TransformableGeometry topObject, int flags)
           
 void updateAttachment()
          Update attachment to reflect changes in the slave state.
 void updatePosStates()
           
 void updateVelStates()
           
 void writeItems(java.io.PrintWriter pw, NumberFormat fmt, CompositeComponent ancestor)
           
 
Methods inherited from class artisynth.core.mechmodels.PointAttachment
getCopyReferences, getPoint, getSlave, getSlaveSolveIndex, isDuplicatable
 
Methods inherited from class artisynth.core.mechmodels.DynamicAttachment
addAttachmentJacobian, addSolveBlocks, clone, containsLoop, containsLoops, containsMaster, createOrderedList, reduceConstraints, reduceMass, reduceRowMatrix
 
Methods inherited from class artisynth.core.modelbase.ModelComponentBase
checkFlag, checkName, checkNameUniqueness, clearFlag, createTempFlag, getAllPropertyInfo, getChildren, getGrandParent, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, hasState, 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.modelbase.ModelComponent
getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, 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
 

Constructor Detail

PointFrameAttachment

public PointFrameAttachment()

PointFrameAttachment

public PointFrameAttachment(Frame master,
                            Point slave)

PointFrameAttachment

public PointFrameAttachment(Frame master,
                            Point slave,
                            Point3d loc)
Method Detail

getMasters

public DynamicMechComponent[] getMasters()
Specified by:
getMasters in class DynamicAttachment

getFrame

public Frame getFrame()

numMasters

public int numMasters()
Overrides:
numMasters in class DynamicAttachment

setLocation

public void setLocation(Point3d pnt)

setDefaultLocation

public void setDefaultLocation()

getLocation

public Point3d getLocation()

detachSlave

public void detachSlave()

computePosState

public void computePosState(Vector3d pos)
Specified by:
computePosState in class PointAttachment

updatePosStates

public void updatePosStates()
Specified by:
updatePosStates in class DynamicAttachment

updateVelStates

public void updateVelStates()
Specified by:
updateVelStates in class DynamicAttachment

applyForces

public void applyForces()
Specified by:
applyForces in class DynamicAttachment

addScaledExternalForce

public void addScaledExternalForce(Point3d pnt,
                                   double s,
                                   Vector3d f)
Description copied from class: PointAttachment
Distributes an external force applied at a particular point to all masters

Specified by:
addScaledExternalForce in class PointAttachment
Parameters:
pnt - point at which to apply the force (to be used to compute a wrench)
s - force scale factor
f - force vector to apply

mulSubGT

public void mulSubGT(MatrixBlock D,
                     MatrixBlock B,
                     int idx)
Description copied from class: DynamicAttachment
Computes
       T
 D -= G  B
 
where D and B are matrices associated with master and slave components, respectively, and G is the constraint matrix for the attachment.

Parameters:
D - dependent matrix associated with a master component
B - matrix associated with a slave component

mulSubG

public void mulSubG(MatrixBlock D,
                    MatrixBlock B,
                    int idx)
Description copied from class: DynamicAttachment
Computes
 D -= B G
 
where D and B are matrices associated with master and slave components, respectively, and G is the constraint matrix for the attachment.

Parameters:
D - dependent matrix associated with a master component
B - matrix associated with a slave component

mulSubGT

public void mulSubGT(double[] ybuf,
                     int yoff,
                     double[] xbuf,
                     int xoff,
                     int idx)
Description copied from class: DynamicAttachment
Computes
       T
 y -= G  x
 
where y and x are vectors associated with master and slave components, respectively, and G is the constraint matrix for the attachment.

Parameters:
ybuf - buffer into which to store result
yoff - offset into ybuf
xbuf - buffer containing right hand side vector
xoff - offset into xbuf
idx - master component index

mulSubGTNew

public void mulSubGTNew(MatrixBlock D,
                        MatrixBlock B,
                        int idx)

mulSubGNew

public void mulSubGNew(MatrixBlock D,
                       MatrixBlock B,
                       int idx)

updateAttachment

public void updateAttachment()
Description copied from class: DynamicAttachment
Update attachment to reflect changes in the slave state.

Specified by:
updateAttachment in class DynamicAttachment

transformSlaveGeometry

public void transformSlaveGeometry(AffineTransform3dBase X,
                                   TransformableGeometry topObject,
                                   int flags)
Specified by:
transformSlaveGeometry in class DynamicAttachment

addTargetJacobian

public int addTargetJacobian(SparseBlockMatrix J,
                             int bi)

addMassToMaster

public void addMassToMaster(MatrixBlock mblk,
                            MatrixBlock sblk,
                            int idx)
Specified by:
addMassToMaster in class DynamicAttachment

writeItems

public void writeItems(java.io.PrintWriter pw,
                       NumberFormat fmt,
                       CompositeComponent ancestor)
                throws java.io.IOException
Overrides:
writeItems in class PointAttachment
Throws:
java.io.IOException

getDerivative

public boolean getDerivative(double[] buf,
                             int idx)
Specified by:
getDerivative in class DynamicAttachment

connectToHierarchy

public void connectToHierarchy()
Description copied from class: DynamicAttachment
Update the attachment position state whenever we connect to the parent (i.e., plug in to the hierarchy).

Specified by:
connectToHierarchy in interface ModelComponent
Overrides:
connectToHierarchy in class DynamicAttachment

disconnectFromHierarchy

public void disconnectFromHierarchy()
Description copied from class: ModelComponentBase
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). This method is responsible for any required hierarchy-dependent deinitialization.

When this method is called, ModelComponent.getParent() will still return this original parent component; the system will set this to null after.

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

getHardReferences

public void getHardReferences(java.util.List<ModelComponent> refs)
Description copied from class: ModelComponentBase
Appends all hard references for this component to a list. References are other components, outside of this component's immediate ancestry, on which this component depends. For example, an AxialSpring refers to two Point components as for it's end points. A hard reference is one which the referring component must have, and which if deleted, implies that the referring component should be deleted too.

Specified by:
getHardReferences in interface ModelComponent
Overrides:
getHardReferences in class ModelComponentBase
Parameters:
refs - list to which hard references are appended

copy

public PointFrameAttachment copy(int flags,
                                 java.util.Map<ModelComponent,ModelComponent> copyMap)
Description copied from interface: CopyableComponent
Create a copy of this component. If 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.

Specified by:
copy in interface CopyableComponent
Overrides:
copy in class PointAttachment