|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gumbo.graphic.space.AbstractSpaceMapper
A full implementation of the SpaceMapper interface. Implementations should override these methods to take advantage of native graphic constraints and capabilities.
The default implementation caches (automatically saves) the last source space, target space, and transform used by any transform method. Caching greatly improves the performance of a series of point and vector transformations along the same transform path. If the cached transform is suspected of being stale (a transform node along the path may have changed), first call a transform method with null as the source and target space to effectively clear the cache.
Constructor Summary | |
AbstractSpaceMapper()
Creates an instance. |
Method Summary | |
java.lang.Object |
getGraphic()
Default implementation: Returns this object (non-native direct implementation). |
Matrix4 |
getGraphicTransform(SpaceNode from,
SpaceNode to,
Matrix4 retVal)
Default implementation: Recursively computes a new transform using matrix multiplication, updates the cache with it, and returns it. |
Point3 |
transformGraphic(Point3 point,
SpaceNode from,
SpaceNode to,
Point3 retVal)
Default implementation: Transforms the input point with the cached transform using matrix multiplication. |
Vector3 |
transformGraphic(Vector3 vector,
SpaceNode from,
SpaceNode to,
Vector3 retVal)
Default implementation: Transforms the input vector with the cached transform using matrix multiplication. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AbstractSpaceMapper()
Method Detail |
public Point3 transformGraphic(Point3 point, SpaceNode from, SpaceNode to, Point3 retVal)
transformGraphic
in interface SpaceMapper
point
- Value of a point in the from space. Never null.from
- The source space. If null, the tree's absolute space.to
- The target space. If null, the tree's absolute space.retVal
- The return value object. The transformed point
Never null.
public Vector3 transformGraphic(Vector3 vector, SpaceNode from, SpaceNode to, Vector3 retVal)
transformGraphic
in interface SpaceMapper
vector
- Value of a vector in the from space. Never null.from
- The source space. If null, the tree's absolute space.to
- The target space. If null, the tree's absolute space.retVal
- The return value object. The transformed vector
Never null.
public Matrix4 getGraphicTransform(SpaceNode from, SpaceNode to, Matrix4 retVal)
getGraphicTransform
in interface SpaceMapper
from
- The source space. If null, the tree's absolute space.to
- The target space. If null, the tree's absolute space.retVal
- The return value object. The transform matrix.
Never null.
public java.lang.Object getGraphic()
getGraphic
in interface Graphic
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |