Aviatrix3D
2.1.0

org.j3d.aviatrix3d
Class PixelTransform

java.lang.Object
  extended by org.j3d.aviatrix3d.SceneGraphObject
      extended by org.j3d.aviatrix3d.Node
          extended by org.j3d.aviatrix3d.Group
              extended by org.j3d.aviatrix3d.PixelTransform
All Implemented Interfaces:
GroupPickTarget, PickableObject, PickTarget, TransformPickTarget, Cullable, GroupCullable, TransformCullable, TransformHierarchy

public class PixelTransform
extends Group
implements TransformPickTarget, TransformCullable

A grouping node that contains a transform for 2D pixel coordinate space.

As this node works in pixel space defined by OpenGL, it is limited in the types of transformations that can occur. Actions permitted are only translations and zoom. These are defined for all the children and may be nested. If the node contains any 3D spaces below it, the Z component of those values are ignored when projected onto the screen. Any scales become a zoom factor in X and Y. While you can also include TransformGroups below this node, that's generally not a good idea. We recommend you stay to either pure 2D or 3D in any one transformation path.

The default location is (0,0) and zoom of (1,1). Zoom may be a negative number, indicating a mirror operation on that axis.

Version:
$Revision: 2.5 $
Author:
Justin Couch

Field Summary
 
Fields inherited from class org.j3d.aviatrix3d.Group
childList, cullList, dirtyBoundsCount, lastChild, pickableList, pickFlags, wkVec1, wkVec2
 
Fields inherited from class org.j3d.aviatrix3d.Node
bounds, implicitBounds, INVALID_BOUNDS, parent
 
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler
 
Fields inherited from interface org.j3d.aviatrix3d.picking.PickTarget
CUSTOM_PICK_TYPE, GROUP_PICK_TYPE, LEAF_PICK_TYPE, SINGLE_PICK_TYPE
 
Fields inherited from interface org.j3d.aviatrix3d.picking.PickableObject
COLLIDABLE_OBJECT, GENERAL_OBJECT, PROXIMITY_OBJECT, VISIBLE_OBJECT
 
Constructor Summary
PixelTransform()
          The default constructor
PixelTransform(int[] translation)
          Construct a TransformGroup given a translation offset.
PixelTransform(int[] translation, float[] zoom)
          Construct a TransformGroup given a zoom and translation offset.
 
Method Summary
 void getInverseTransform(javax.vecmath.Matrix4f mat)
          Get the inverse version of the local transform.
 void getTransform(javax.vecmath.Matrix4f mat)
          Get the inverse version of the local transform.
 void getTranslation(int[] translation)
          Get the current local transformation value.
 void getZoom(float[] zoom)
          Get the current local zoom value.
protected  void recomputeBounds()
          Internal method to recalculate the implicit bounds of this Node.
 void setTranslation(int[] translation)
          Set the pixel translation for this transform.
 void setZoom(float[] zoom)
          Set the pixel zoom for this transform.
 
Methods inherited from class org.j3d.aviatrix3d.Group
addChild, checkForCyclicChild, checkPickMask, getAllChildren, getChild, getCullableChildren, getCullableParent, getPickableBounds, getPickableChild, getPickableChildren, getPickMask, getPickTargetType, hasMultipleParents, indexOfChild, markBoundsDirty, numChildren, numCullableChildren, numPickableChildren, pickBatch, pickSingle, removeAllChildren, removeChild, removeChild, requestBoundsUpdate, setBounds, setChild, setLive, setPickMask, setUpdateHandler, updateBounds
 
Methods inherited from class org.j3d.aviatrix3d.Node
boundsChanged, checkForCyclicParent, getBounds, getParent, removeParent, setParent, updateParentBounds
 
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject
dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.j3d.aviatrix3d.picking.PickTarget
checkPickMask, getPickableBounds, getPickTargetType
 
Methods inherited from interface org.j3d.aviatrix3d.rendering.GroupCullable
getBounds
 

Constructor Detail

PixelTransform

public PixelTransform()
The default constructor


PixelTransform

public PixelTransform(int[] translation)
Construct a TransformGroup given a translation offset.

Parameters:
translation - The pixel translation to use

PixelTransform

public PixelTransform(int[] translation,
                      float[] zoom)
Construct a TransformGroup given a zoom and translation offset.

Parameters:
translation - The pixel translation to use
zoom - The amount of zoom factors to use
Method Detail

recomputeBounds

protected void recomputeBounds()
Internal method to recalculate the implicit bounds of this Node. Overrides the group version to take into account the transform stack applied to each child.

Overrides:
recomputeBounds in class Group

getTransform

public void getTransform(javax.vecmath.Matrix4f mat)
Get the inverse version of the local transform. The default implementation does nothing.

Specified by:
getTransform in interface TransformPickTarget
Specified by:
getTransform in interface TransformCullable
Parameters:
mat - The matrix to copy the transform data to

getInverseTransform

public void getInverseTransform(javax.vecmath.Matrix4f mat)
Get the inverse version of the local transform. The default implementation does nothing.

Specified by:
getInverseTransform in interface TransformPickTarget
Parameters:
mat - The matrix to copy the transform data to

setTranslation

public void setTranslation(int[] translation)
                    throws InvalidWriteTimingException
Set the pixel translation for this transform. Translations are in 2D screen pixel space.

Parameters:
translation - The copy of the matrix to use
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener bounds changed callback method

getTranslation

public void getTranslation(int[] translation)
Get the current local transformation value.

Parameters:
translation - The array to copy the translation data to

setZoom

public void setZoom(float[] zoom)
             throws InvalidWriteTimingException
Set the pixel zoom for this transform. Zooms are in 2D screen pixel space and may have both positive and negative values. A negative value indicates a mirroring operation on that axis.

Parameters:
zoom - The zoom factor in (x,y) order
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener bounds changed callback method

getZoom

public void getZoom(float[] zoom)
Get the current local zoom value.

Parameters:
zoom - The array to copy the zoom data to

Aviatrix3D
2.1.0

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - 2009 j3d.org