artisynth.core.mechmodels
Class PlanarPoint

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.PlanarPoint
All Implemented Interfaces:
DynamicMechComponent, ForceEffector, MotionTargetComponent, PlanarComponent, CopyableComponent, ModelComponent, RenderableComponent, Tracable, ScalableUnits, TransformableGeometry, java.lang.Cloneable, HasProperties, HierarchyNode, GLRenderable, GLSelectable, HasRenderProps, Renderable, RenderablePoint, Scannable

public class PlanarPoint
extends Point
implements PlanarComponent

A 3-dimensional point that is confined to a plane.


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
PlanarPoint()
           
PlanarPoint(double x, double y)
           
PlanarPoint(Point2d p)
           
 
Method Summary
 void addPosition(double dx, double dy, double dz)
           
 void addSolveBlock(SparseNumberedBlockMatrix S)
           
 void addToSolveBlock(Matrix2d M)
           
 void addToSolveBlockDiagonal(double d)
           
 void addVelocity(double dx, double dy, double dz)
           
 ModelComponent copy(int flags, java.util.Map<ModelComponent,ModelComponent> copyMap)
          Create a copy of this component.
 MatrixBlock createSolveBlock()
           
 PropertyList getAllPropertyInfo()
          Returns a list giving static information about all properties exported by this object.
 PlanarComponent getPlanarComponent()
           
 RigidTransform3d getPlaneToWorld()
          Returns the transform from plane coordinates to world coordinates.
 Point3d getPosition()
           
 Point2d getPosition2d()
           
 void getPosition2d(Vector2d p)
           
 int getPosState(double[] x, int idx)
           
 MatrixBlock getSolveBlock()
           
 Vector3d getVelocity()
           
 Vector2d getVelocity2d()
           
 void getVelocity2d(Vector2d v)
           
 int getVelState(double[] v, int idx)
           
 void prerender(RenderList list)
          Prepare for rendering, and potentially add itself to a list to be drawn by a GLRenderer.
 void scaleDistance(double s)
          Scales all distance coordinates.
 void scan(ReaderTokenizer rtok, java.lang.Object ref)
          Scans this element from a ReaderTokenizer.
 void setPlanarComponent(PlanarComponent pcomp)
           
 void setPosition(double x, double y, double z)
           
 void setPosition(Point3d p)
           
 void setPosition2d(double x, double y)
           
 void setPosition2d(Point2d p)
           
 int setPosState(double[] p, int idx)
           
 int setState(VectorNd x, int idx)
           
 void setVelocity(Vector3d v)
           
 void setVelocity2d(Vector2d v)
           
 int setVelState(double[] v, int idx)
           
 void transformGeometry(AffineTransform3dBase X, TransformableGeometry topObject, int flags)
          Applies an affine transformation to the geometry of this object.
 void transformToPlane(Point3d pp, Point3d pw)
           
 void transformToPlane(Vector3d vp, Vector3d vw)
           
 void transformToWorld(Point3d pw, Point3d pp)
           
 void transformToWorld(Vector3d vw, Vector3d vp)
           
 void updateBounds(Point3d pmin, Point3d pmax)
          Update the minimum and maximum points for this object.
 
Methods inherited from class artisynth.core.mechmodels.Point
addExternalForce, addForce, addPosImpulse, addPosJacobian, addScaledExternalForce, addScaledForce, addScaledPosition, addScaledVelocity, addSolveBlocks, addTargetJacobian, addToSolveBlockDiagonal, addVelJacobian, applyForces, applyGravity, createMassBlock, createRenderProps, distance, distance, getCopyReferences, getExternalForce, getForce, getForce, getJacobianType, getMass, getMass, getMassForces, getPointDamping, getPointDampingMode, getPosDerivative, getPosition, getPosStateSize, getRenderCoords, getRenderProps, getSelection, getState, getState, getTargetActivity, getTargetPos, getTargetPosition, getTargetVel, getTargetVelocity, getTracables, getTracingProbe, getVelocity, getVelStateSize, isDuplicatable, isMassConstant, isSelectable, render, resetTargets, scaleMass, setExternalForce, setForce, setForce, setForcesToExternal, setPointDamping, setPointDampingMode, setRenderProps, setScaledExternalForce, setState, setState, setTargetActivity, setTargetPos, setTargetPosition, setTargetVel, setTargetVelocity, setVelocity, subForce, transformGeometry, velocityLimitExceeded, zeroExternalForces, zeroForces
 
Methods inherited from class artisynth.core.mechmodels.DynamicMechComponentBase
addMasterAttachment, getAttachment, getInverseMass, getMasterAttachments, getSolveIndex, hasState, 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, connectToHierarchy, createTempFlag, disconnectFromHierarchy, getChildren, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, 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, setFixed, setMarked, setName, setNumber, setParent, setSelected, updateReferences
 
Methods inherited from interface maspack.properties.HasProperties
getProperty
 
Methods inherited from interface maspack.properties.HierarchyNode
getChildren, hasChildren
 
Methods inherited from interface maspack.util.Scannable
isWritable, write
 
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
 

Field Detail

myProps

public static PropertyList myProps
Constructor Detail

PlanarPoint

public PlanarPoint()

PlanarPoint

public PlanarPoint(Point2d p)

PlanarPoint

public PlanarPoint(double x,
                   double y)
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

transformToWorld

public void transformToWorld(Point3d pw,
                             Point3d pp)

transformToWorld

public void transformToWorld(Vector3d vw,
                             Vector3d vp)

transformToPlane

public void transformToPlane(Point3d pp,
                             Point3d pw)

transformToPlane

public void transformToPlane(Vector3d vp,
                             Vector3d vw)

setPlanarComponent

public void setPlanarComponent(PlanarComponent pcomp)

getPlanarComponent

public PlanarComponent getPlanarComponent()

getPlaneToWorld

public RigidTransform3d getPlaneToWorld()
Description copied from interface: PlanarComponent
Returns the transform from plane coordinates to world coordinates. The plane is assumed to lie in the x-y plane of the planar coordinate system.

Specified by:
getPlaneToWorld in interface PlanarComponent
Returns:
plane to world transform

getPosition2d

public Point2d getPosition2d()

setPosition2d

public void setPosition2d(Point2d p)

setPosition2d

public void setPosition2d(double x,
                          double y)

setVelocity2d

public void setVelocity2d(Vector2d v)

getVelocity2d

public Vector2d getVelocity2d()

getPosition

public Point3d getPosition()
Overrides:
getPosition in class Point

getPosState

public int getPosState(double[] x,
                       int idx)
Specified by:
getPosState in interface DynamicMechComponent
Overrides:
getPosState in class Point

getPosition2d

public void getPosition2d(Vector2d p)

setPosition

public void setPosition(Point3d p)
Overrides:
setPosition in class Point

setPosition

public void setPosition(double x,
                        double y,
                        double z)
Overrides:
setPosition in class Point

addPosition

public void addPosition(double dx,
                        double dy,
                        double dz)
Overrides:
addPosition in class Point

setPosState

public int setPosState(double[] p,
                       int idx)
Specified by:
setPosState in interface DynamicMechComponent
Overrides:
setPosState in class Point

getVelocity

public Vector3d getVelocity()
Overrides:
getVelocity in class Point

getVelState

public int getVelState(double[] v,
                       int idx)
Specified by:
getVelState in interface DynamicMechComponent
Overrides:
getVelState in class Point

getVelocity2d

public void getVelocity2d(Vector2d v)

setVelocity

public void setVelocity(Vector3d v)
Overrides:
setVelocity in class Point

addVelocity

public void addVelocity(double dx,
                        double dy,
                        double dz)
Overrides:
addVelocity in class Point

setVelState

public int setVelState(double[] v,
                       int idx)
Specified by:
setVelState in interface DynamicMechComponent
Overrides:
setVelState in class Point

scan

public void scan(ReaderTokenizer rtok,
                 java.lang.Object ref)
          throws java.io.IOException
Description copied from class: ModelComponentBase
Scans this element from a ReaderTokenizer. The expected text format is assumed to be compatible with that produced by write.

Specified by:
scan in interface ModelComponent
Specified by:
scan in interface Scannable
Overrides:
scan in class ModelComponentBase
Parameters:
rtok - Tokenizer from which to scan the element
ref - optional reference object which can be used for resolving references to other objects
Throws:
java.io.IOException - if an I/O or formatting error occured

prerender

public void prerender(RenderList list)
Description copied from interface: GLRenderable
Prepare for rendering, and potentially add itself to a list to be drawn by a GLRenderer.

Specified by:
prerender in interface GLRenderable
Overrides:
prerender in class Point

updateBounds

public void updateBounds(Point3d pmin,
                         Point3d pmax)
Description copied from interface: GLRenderable
Update the minimum and maximum points for this object. In an x-y-z coordinate system with x directed to the right and y directed upwards, the minimum and maximum points can be thought of as defining the left-lower-far and right-upper-near corners of a bounding cube. This method should only reduce the elements of the minimum point and increase the elements of the maximum point, since it may be used as part of an iteration to determine the bounding cube for several different objects.

Specified by:
updateBounds in interface GLRenderable
Overrides:
updateBounds in class Point
Parameters:
pmin - minimum point
pmax - maximum point

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

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.

setState

public int setState(VectorNd x,
                    int idx)
Overrides:
setState in class Point

addSolveBlock

public void addSolveBlock(SparseNumberedBlockMatrix S)
Specified by:
addSolveBlock in interface DynamicMechComponent
Overrides:
addSolveBlock in class Point

createSolveBlock

public MatrixBlock createSolveBlock()
Specified by:
createSolveBlock in interface DynamicMechComponent
Overrides:
createSolveBlock in class Point

getSolveBlock

public MatrixBlock getSolveBlock()

addToSolveBlock

public void addToSolveBlock(Matrix2d M)

addToSolveBlockDiagonal

public void addToSolveBlockDiagonal(double d)

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