artisynth.core.mechmodels
Class PointParticleAttachment

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.PointParticleAttachment
All Implemented Interfaces:
CopyableComponent, ModelComponent, java.lang.Cloneable, HasProperties, HierarchyNode, Scannable

public class PointParticleAttachment
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
PointParticleAttachment()
           
PointParticleAttachment(Particle master, Point slave)
           
 
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
 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).
 PointParticleAttachment 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).
 boolean getDerivative(double[] buf, int idx)
           
 void getHardReferences(java.util.List<ModelComponent> refs)
          Appends all hard references for this component to a list.
 DynamicMechComponent[] getMasters()
           
 Particle getParticle()
           
 void mulSubG(MatrixBlock D, MatrixBlock B, int idx)
          Computes
 void mulSubGT(MatrixBlock D, MatrixBlock B, int idx)
          Computes
 int numMasters()
           
 void setParticle(Particle particle)
           
 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

PointParticleAttachment

public PointParticleAttachment()

PointParticleAttachment

public PointParticleAttachment(Particle master,
                               Point slave)
Method Detail

getMasters

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

getParticle

public Particle getParticle()

numMasters

public int numMasters()
Overrides:
numMasters in class DynamicAttachment

setParticle

public void setParticle(Particle particle)

updatePosStates

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

computePosState

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

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

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

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

addMassToMaster

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

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 PointParticleAttachment 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