artisynth.core.mechmodels
Class PointAttachment

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

public abstract class PointAttachment
extends DynamicAttachment
implements CopyableComponent


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
PointAttachment()
           
 
Method Summary
abstract  void addScaledExternalForce(Point3d pnt, double s, Vector3d f)
          Distributes an external force applied at a particular point to all masters
abstract  void computePosState(Vector3d pos)
           
 PointAttachment copy(int flags, java.util.Map<ModelComponent,ModelComponent> copyMap)
          Create a copy of this component.
 boolean getCopyReferences(java.util.List<ModelComponent> refs, ModelComponent ancestor)
          Collects external references which must also be copied in order to duplicate this component.
 Point getPoint()
           
 Point getSlave()
          Returns the slave DynamicMechComponent associated with this attachment.
 int getSlaveSolveIndex()
          Returns the block index within the system solve matrix of the slave DynamicMechComponent associated with this attachment.
 boolean isDuplicatable()
          Returns true if this component can be duplicated.
 void writeItems(java.io.PrintWriter pw, NumberFormat fmt, CompositeComponent ancestor)
           
 
Methods inherited from class artisynth.core.mechmodels.DynamicAttachment
addAttachmentJacobian, addMassToMaster, addSolveBlocks, applyForces, clone, connectToHierarchy, containsLoop, containsLoops, containsMaster, createOrderedList, getDerivative, getMasters, numMasters, reduceConstraints, reduceMass, reduceRowMatrix, transformSlaveGeometry, updateAttachment, updatePosStates, updateVelStates
 
Methods inherited from class artisynth.core.modelbase.ModelComponentBase
checkFlag, checkName, checkNameUniqueness, clearFlag, createTempFlag, disconnectFromHierarchy, getAllPropertyInfo, getChildren, getGrandParent, getHardReferences, 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
connectToHierarchy, disconnectFromHierarchy, getHardReferences, 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

PointAttachment

public PointAttachment()
Method Detail

getSlave

public Point getSlave()
Description copied from class: DynamicAttachment
Returns the slave DynamicMechComponent associated with this attachment. In some cases, the attachment may connect some other entity (such as a mesh vertex) to the master components, in which case this method should return null.

Specified by:
getSlave in class DynamicAttachment
Returns:
slave DynamicMechComponent, if any

getPoint

public Point getPoint()

getSlaveSolveIndex

public int getSlaveSolveIndex()
Description copied from class: DynamicAttachment
Returns the block index within the system solve matrix of the slave DynamicMechComponent associated with this attachment. If there is no such component (see DynamicAttachment.getSlave()), this method returns -1.

Specified by:
getSlaveSolveIndex in class DynamicAttachment
Returns:
solve index of slave DynamicMechComponent, or -1.

addScaledExternalForce

public abstract void addScaledExternalForce(Point3d pnt,
                                            double s,
                                            Vector3d f)
Distributes an external force applied at a particular point to all masters

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

writeItems

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

copy

public PointAttachment 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 DynamicAttachment

computePosState

public abstract void computePosState(Vector3d pos)

isDuplicatable

public boolean isDuplicatable()
Returns true if this component can be duplicated. Duplication means that we can expect to be able to make a complete copy of the component along with all it's external references. This method should return true if and only if CopyableComponent.getCopyReferences(java.util.List, 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) to build the list of copy references.

Specified by:
isDuplicatable in interface CopyableComponent
Returns:
true if this component can be duplicated.

getCopyReferences

public boolean getCopyReferences(java.util.List<ModelComponent> refs,
                                 ModelComponent ancestor)
Collects external references which must also be copied in order to duplicate this component. These references should exclude those which are contained within a specified component hierarchy. This method should return true if and only if CopyableComponent.isDuplicatable() returns true.

Specified by:
getCopyReferences in interface CopyableComponent
Parameters:
refs - list to which references are appended
ancestor - root node of the hierarchy from which references are to be excluded
Returns:
false if it is discovered that the component cannot be duplicated