artisynth.core.mechmodels
Class FrameMarker

java.lang.Object
  extended by artisynth.core.modelbase.ModelComponentBase
      extended by artisynth.core.modelbase.RenderableComponentBase
          extended by artisynth.core.mechmodels.DynamicMechComponentBase
              extended by artisynth.core.mechmodels.Point
                  extended by artisynth.core.mechmodels.Marker
                      extended by artisynth.core.mechmodels.FrameMarker
All Implemented Interfaces:
DynamicMechComponent, ForceEffector, HasAttachments, MotionTargetComponent, CopyableComponent, ModelComponent, RenderableComponent, Tracable, ScalableUnits, TransformableGeometry, java.lang.Cloneable, HasProperties, HierarchyNode, GLRenderable, GLSelectable, HasRenderProps, Renderable, RenderablePoint, Scannable

public class FrameMarker
extends Marker


Nested Class Summary
 
Nested classes/interfaces inherited from interface artisynth.core.modelbase.ModelComponent
ModelComponent.NavpanelVisibility
 
Field Summary
static PropertyList myProps
           
 
Fields inherited from class artisynth.core.mechmodels.Point
myRenderCoords
 
Fields inherited from class artisynth.core.modelbase.ModelComponentBase
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
 
Fields inherited from interface maspack.render.GLRenderable
TRANSLUCENT, TWO_DIMENSIONAL
 
Fields inherited from interface artisynth.core.util.TransformableGeometry
ARTICULATED, SIMULATING
 
Fields inherited from interface artisynth.core.modelbase.CopyableComponent
COPY_REFERENCES
 
Constructor Summary
FrameMarker()
           
FrameMarker(double x, double y, double z)
           
FrameMarker(Frame frame, double x, double y, double z)
           
FrameMarker(Frame frame, Point3d pos)
           
FrameMarker(Point3d pos)
           
FrameMarker(java.lang.String name)
           
 
Method Summary
 int addAttachedSolveBlock(SparseNumberedBlockMatrix S)
          Adds a diagonal block to the Jacobian for this marker if the frame to which it is attached is active.
 int addTargetJacobian(SparseBlockMatrix J, int bi)
          Add a row to the motion target Jacobian for this motion target.
 void applyForces()
           
 void connectToHierarchy()
          Called by the system after this component is added to the component hierarchy (i.e., when it is added as a child of another CompositeComponent).
 ModelComponent 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).
 PropertyList getAllPropertyInfo()
          Returns a list giving static information about all properties exported by this object.
 void getAttachments(java.util.List<DynamicAttachment> list)
          Returns the attachments contained by 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.
 Point3d getDisplacement()
           
 double getDisplacementNorm()
           
 Frame getFrame()
           
 void getHardReferences(java.util.List<ModelComponent> refs)
          Appends all hard references for this component to a list.
 Point3d getLocation()
           
 void getLocation(Point3d loc)
           
 Point3d getRefPos()
           
 boolean hasState()
          FrameMarkers don't have state that needs to be saved and restored, since their state is derived from their attached frames.
 boolean isDuplicatable()
          Returns true if this component can be duplicated.
 void scaleDistance(double s)
          Scales all distance coordinates.
 void setDisplacement(Point3d disp)
           
 void setFrame(Frame frame)
           
 void setLocation(Point3d loc)
           
 void setRefPos(Point3d referencePosition)
           
 void setWorldLocation(Point3d loc)
           
 void transformGeometry(AffineTransform3dBase X, TransformableGeometry topObject, int flags)
          Applies an affine transformation to the geometry of this object.
 void transformLocation(AffineTransform3dBase X)
           
 void updateAttachment()
           
 void updatePosState()
           
 void updateState()
           
 void updateVelState()
           
 
Methods inherited from class artisynth.core.mechmodels.Point
addExternalForce, addForce, addPosImpulse, addPosition, addPosJacobian, addScaledExternalForce, addScaledForce, addScaledPosition, addScaledVelocity, addSolveBlock, addSolveBlocks, addToSolveBlockDiagonal, addVelJacobian, addVelocity, applyForces, applyGravity, createMassBlock, createRenderProps, createSolveBlock, distance, distance, getExternalForce, getForce, getForce, getJacobianType, getMass, getMass, getMassForces, getPointDamping, getPointDampingMode, getPosDerivative, getPosition, getPosition, getPosState, getPosStateSize, getRenderCoords, getRenderProps, getSelection, getState, getState, getTargetActivity, getTargetPos, getTargetPosition, getTargetVel, getTargetVelocity, getTracables, getTracingProbe, getVelocity, getVelocity, getVelState, getVelStateSize, isMassConstant, isSelectable, prerender, render, resetTargets, scaleMass, setExternalForce, setForce, setForce, setForcesToExternal, setPointDamping, setPointDampingMode, setPosition, setPosition, setPosState, setRenderProps, setScaledExternalForce, setState, setState, setState, setTargetActivity, setTargetPos, setTargetPosition, setTargetVel, setTargetVelocity, setVelocity, setVelocity, setVelState, subForce, transformGeometry, updateBounds, velocityLimitExceeded, zeroExternalForces, zeroForces
 
Methods inherited from class artisynth.core.mechmodels.DynamicMechComponentBase
addMasterAttachment, getAttachment, getInverseMass, getMasterAttachments, getSolveIndex, isActive, isAttached, isControllable, isDynamic, isParametric, removeMasterAttachment, setAttached, setSolveIndex
 
Methods inherited from class artisynth.core.modelbase.RenderableComponentBase
getRenderHints, numSelectionQueriesNeeded, updateRenderProps
 
Methods inherited from class artisynth.core.modelbase.ModelComponentBase
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, createTempFlag, getChildren, getGrandParent, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, 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 maspack.render.RenderablePoint
isSelected
 
Methods inherited from interface maspack.render.GLSelectable
numSelectionQueriesNeeded
 
Methods inherited from interface maspack.render.GLRenderable
getRenderHints
 
Methods inherited from interface artisynth.core.mechmodels.DynamicMechComponent
addMasterAttachment, checkFlag, clearFlag, getAttachment, getInverseMass, getMasterAttachments, getSolveIndex, isActive, isAttached, isControllable, isDynamic, isParametric, removeMasterAttachment, setAttached, setFlag, setSolveIndex
 
Methods inherited from interface artisynth.core.modelbase.ModelComponent
getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, isFixed, isMarked, isSelected, notifyParentOfChange, postscan, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, updateReferences
 
Methods inherited from interface maspack.properties.HierarchyNode
getChildren, hasChildren
 
Methods inherited from interface maspack.util.Scannable
isWritable, write
 

Field Detail

myProps

public static PropertyList myProps
Constructor Detail

FrameMarker

public FrameMarker()

FrameMarker

public FrameMarker(java.lang.String name)

FrameMarker

public FrameMarker(Frame frame,
                   Point3d pos)

FrameMarker

public FrameMarker(Point3d pos)

FrameMarker

public FrameMarker(double x,
                   double y,
                   double z)

FrameMarker

public FrameMarker(Frame frame,
                   double x,
                   double y,
                   double z)
Method Detail

getAllPropertyInfo

public PropertyList getAllPropertyInfo()
Description copied from interface: HasProperties
Returns a list giving static information about all properties exported by this object.

Specified by:
getAllPropertyInfo in interface HasProperties
Overrides:
getAllPropertyInfo in class Point
Returns:
static information for all exported properties

hasState

public boolean hasState()
FrameMarkers don't have state that needs to be saved and restored, since their state is derived from their attached frames.

Specified by:
hasState in interface ModelComponent
Overrides:
hasState in class DynamicMechComponentBase

getLocation

public void getLocation(Point3d loc)

getLocation

public Point3d getLocation()

setLocation

public void setLocation(Point3d loc)

transformLocation

public void transformLocation(AffineTransform3dBase X)

setWorldLocation

public void setWorldLocation(Point3d loc)

getFrame

public Frame getFrame()

setFrame

public void setFrame(Frame frame)

addTargetJacobian

public int addTargetJacobian(SparseBlockMatrix J,
                             int bi)
Add a row to the motion target Jacobian for this motion target. The Jacobian maps state velocities u into motion target velocities vt according to
 vt = J u
 

Specified by:
addTargetJacobian in interface MotionTargetComponent
Overrides:
addTargetJacobian in class Point
Parameters:
J - motion target Jacobian
bi - block row index for the row to be added
Returns:
bi + 1

updateState

public void updateState()
Specified by:
updateState in class Marker

getDisplacementNorm

public double getDisplacementNorm()

setDisplacement

public void setDisplacement(Point3d disp)

getDisplacement

public Point3d getDisplacement()

getRefPos

public Point3d getRefPos()

setRefPos

public void setRefPos(Point3d referencePosition)

transformGeometry

public void transformGeometry(AffineTransform3dBase X,
                              TransformableGeometry topObject,
                              int flags)
Description copied from interface: TransformableGeometry
Applies an affine transformation to the geometry of this object. If recursively invoked within a component hierarchy, then topComponent should be the component for which the method was initially invoked. The variable flags provides information about the context in which the transformation is being applied. At present, the available flags are TransformableGeometry.SIMULATING and TransformableGeometry.ARTICULATED.

Specified by:
transformGeometry in interface TransformableGeometry
Overrides:
transformGeometry in class Point
Parameters:
X - affine transformation
topObject - component on which the method was initially invoked
flags - provides information about the context in which the transformation is being applied.

updateAttachment

public void updateAttachment()

scaleDistance

public void scaleDistance(double s)
Description copied from interface: ScalableUnits
Scales all distance coordinates.

Specified by:
scaleDistance in interface ScalableUnits
Overrides:
scaleDistance in class Point
Parameters:
s - scaling factor

applyForces

public void applyForces()

updatePosState

public void updatePosState()

updateVelState

public void updateVelState()

addAttachedSolveBlock

public int addAttachedSolveBlock(SparseNumberedBlockMatrix S)
Adds a diagonal block to the Jacobian for this marker if the frame to which it is attached is active.


connectToHierarchy

public void connectToHierarchy()
Description copied from class: ModelComponentBase
Called by the system after this component is added to the component hierarchy (i.e., when it is added as a child of another CompositeComponent). This method is responsible for doing any required hierarchy-dependent initialization.

When this method is called, ModelComponent.getParent() will return the new parent component; the system will have set this beforehand.

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

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

getAttachments

public void getAttachments(java.util.List<DynamicAttachment> list)
Returns the attachments contained by this component. This will be called by MechModelBase when creating a complete list of all the attachments in the model.


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
Overrides:
isDuplicatable in class Point
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
Overrides:
getCopyReferences in class Point
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

copy

public ModelComponent 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 Point