public class PlanarPoint extends Point implements PlanarComponent
ModelComponent.NavpanelVisibility
Modifier and Type | Field and Description |
---|---|
static PropertyList |
myProps |
myRenderCoords
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
COPY_REFERENCES, REST_POSITION
TG_ARTICULATED, TG_DRAGGER, TG_PRESERVE_ORIENTATION, TG_SIMULATING
TRANSPARENT, TWO_DIMENSIONAL
Constructor and Description |
---|
PlanarPoint() |
PlanarPoint(double x,
double y) |
PlanarPoint(Point2d p) |
Modifier and Type | Method and Description |
---|---|
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) |
PlanarPoint |
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()
Returns the current position of this point, in world coordinates.
|
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)
Called prior to rendering to allow this object to update the internal
state required for rendering (such as by caching rendering coordinates).
|
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) |
void |
setVelocity(Vector3d v) |
void |
setVelocity2d(Vector2d v) |
int |
setVelState(double[] v,
int idx) |
void |
transformGeometry(GeometryTransformer gtr,
TransformGeometryContext context,
int flags)
Transforms the geometry of this component, using the geometry transformer
gtr to transform its individual attributes. |
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(Vector3d pmin,
Vector3d pmax)
Update the minimum and maximum points for this object.
|
addEffectiveMass, addExternalForce, addForce, addForce, addPosImpulse, addPosJacobian, addScaledExternalForce, addScaledForce, addSolveBlocks, addTargetJacobian, addToPointVelocity, addToSolveBlockDiagonal, addTransformableDependencies, addVelJacobian, applyExternalForces, applyForces, applyGravity, createMassBlock, createRenderProps, defaultRenderPropsAreNull, distance, distance, getCopyReferences, getEffectiveMass, getEffectiveMass, getEffectiveMassForces, getExternalForce, getForce, getForce, getJacobianType, getMass, getMass, getPointDamping, getPointDampingMode, getPosDerivative, getPosition, getPosStateSize, getRenderCoords, getRenderProps, getSelection, getState, getTargetActivity, getTargetPos, getTargetPosition, getTargetVel, getTargetVelocity, getTraceablePositionProperty, getTraceables, getVelocity, getVelStateSize, hasForce, isDuplicatable, isMassConstant, isSelectable, mulInverseEffectiveMass, render, resetEffectiveMass, resetTargets, scaleMass, setContactConstraint, setExternalForce, setForce, setForce, setPointDamping, setPointDampingMode, setRandomForce, setRandomPosState, setRandomVelState, setRenderProps, setScaledExternalForce, setState, setState, setTargetActivity, setTargetPos, setTargetPosition, setTargetVel, setTargetVelocity, setVelocity, subForce, updatePosState, updateVelState, velocityLimitExceeded, zeroExternalForces, zeroForces
addAttachmentRequest, addConstrainer, addMasterAttachment, connectToHierarchy, disconnectFromHierarchy, getAttachment, getConstrainers, getInverseMass, getMasterAttachments, getSolveIndex, hasState, isActive, isAttached, isControllable, isDynamic, isParametric, removeAttachmentRequest, removeConstrainer, removeMasterAttachment, setAttached, setSolveIndex, transformGeometry
getRenderHints, isVisible, numSelectionQueriesNeeded, setVisible, updateRenderProps
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, createTempFlag, getChildren, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, isFixed, isMarked, isScanning, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setScanning, setSelected, setWritable, updateReferences, write
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritable, updateReferences
getProperty
getChildren, hasChildren
postscan
isWritable, write
addAttachmentRequest, removeAttachmentRequest
addConstrainer, addMasterAttachment, getAttachment, getConstrainers, getInverseMass, getMasterAttachments, getSolveIndex, isActive, isAttached, isControllable, isDynamic, isParametric, removeConstrainer, removeMasterAttachment, setAttached, setSolveIndex
advanceState, getAuxVarDerivative, getAuxVarState, getStateVersion, hasState, numAuxVars, requiresAdvance, setAuxVarState
transformGeometry, transformPriority
public static PropertyList myProps
public PlanarPoint()
public PlanarPoint(Point2d p)
public PlanarPoint(double x, double y)
public PropertyList getAllPropertyInfo()
HasProperties
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class Point
public void setPlanarComponent(PlanarComponent pcomp)
public PlanarComponent getPlanarComponent()
public RigidTransform3d getPlaneToWorld()
PlanarComponent
getPlaneToWorld
in interface PlanarComponent
public Point2d getPosition2d()
public void setPosition2d(Point2d p)
public void setPosition2d(double x, double y)
public void setVelocity2d(Vector2d v)
public Vector2d getVelocity2d()
public Point3d getPosition()
Point
getPosition
in class Point
public int getPosState(double[] x, int idx)
getPosState
in interface DynamicAgent
getPosState
in class Point
public void getPosition2d(Vector2d p)
public void setPosition(Point3d p)
setPosition
in class Point
public void setPosition(double x, double y, double z)
setPosition
in class Point
public void addPosition(double dx, double dy, double dz)
public int setPosState(double[] p, int idx)
setPosState
in interface DynamicAgent
setPosState
in class Point
public Vector3d getVelocity()
getVelocity
in class Point
public int getVelState(double[] v, int idx)
getVelState
in interface DynamicAgent
getVelState
in class Point
public void getVelocity2d(Vector2d v)
public void setVelocity(Vector3d v)
setVelocity
in class Point
public void addVelocity(double dx, double dy, double dz)
public int setVelState(double[] v, int idx)
setVelState
in interface DynamicAgent
setVelState
in class Point
public void scan(ReaderTokenizer rtok, java.lang.Object ref) throws java.io.IOException
ModelComponentBase
write
.scan
in interface ModelComponent
scan
in interface Scannable
scan
in class ModelComponentBase
rtok
- Tokenizer from which to scan the elementref
- optional reference object which can be used for resolving references to
other objectsjava.io.IOException
- if an I/O or formatting error occuredpublic void prerender(RenderList list)
IsRenderable
list.addIfVisible (obj);
for each of the objects in question.prerender
in interface IsRenderable
prerender
in class Point
list
- list of objects to be renderedpublic void updateBounds(Vector3d pmin, Vector3d pmax)
IsRenderable
updateBounds
in interface IsRenderable
updateBounds
in class Point
pmin
- minimum pointpmax
- maximum pointpublic void scaleDistance(double s)
ScalableUnits
scaleDistance
in interface ScalableUnits
scaleDistance
in class Point
s
- scaling factorpublic void transformGeometry(GeometryTransformer gtr, TransformGeometryContext context, int flags)
TransformableGeometry
gtr
to transform its individual attributes. The
context
argument supplies information about what other
components are currently being transformed, and also allows the
requesting of update actions to be performed after all transform called
have completed. The context is also the usual entity that calls
this method, from within its TransformGeometryContext.apply(maspack.geometry.GeometryTransformer, int)
method. The argument flags
provides flags to specify
various conditions associated with the the transformation.
At present, the available flags are TransformableGeometry.TG_SIMULATING
and
TransformableGeometry.TG_ARTICULATED
.
This method is not usually called directly by applications.
Instead, it is typically called from within the
TransformGeometryContext.apply(maspack.geometry.GeometryTransformer, int)
method of the context,
which takes care of the various operations needed for a
complete transform operation, including calling
TransformableGeometry.addTransformableDependencies(artisynth.core.modelbase.TransformGeometryContext, int)
to collect other
components that should be transformed, calling
TransformableGeometry.transformGeometry(maspack.matrix.AffineTransform3dBase)
for each component, notifying
component parents that the geometry has changed, and calling
any requested TransformGeometryAction
s. More details
are given in the documentation for
TransformGeometryContext.apply(maspack.geometry.GeometryTransformer, int)
.
TransformGeometryContext
provides a number of
static convenience transform
methods
which take care of building the context and calling
apply()
for a specified set of components.
This method should not
generally call transformGeometry()
for its descendant
components. Instead, descendants needing transformation should be
specified by adding them to the context in the method TransformableGeometry.addTransformableDependencies(artisynth.core.modelbase.TransformGeometryContext, int)
.
transformGeometry
in interface TransformableGeometry
transformGeometry
in class Point
gtr
- transformer implementing the transformcontext
- context information, including what other components
are being transformedflags
- specifies conditions associated with the transformationpublic void addSolveBlock(SparseNumberedBlockMatrix S)
addSolveBlock
in interface DynamicAgent
addSolveBlock
in class Point
public MatrixBlock createSolveBlock()
createSolveBlock
in class Point
public MatrixBlock getSolveBlock()
public void addToSolveBlock(Matrix2d M)
public void addToSolveBlockDiagonal(double d)
public PlanarPoint copy(int flags, java.util.Map<ModelComponent,ModelComponent> copyMap)
CopyableComponent
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
.copy
in interface CopyableComponent
copy
in class Point
flags
- flags to control the copyingcopyMap
- map to possible existing instances of referenced
components