visad.java3d
Class MouseBehaviorJ3D
- java.lang.Object
-
- javax.media.j3d.SceneGraphObject
-
- javax.media.j3d.Node
-
- javax.media.j3d.Leaf
-
- javax.media.j3d.Behavior
-
- visad.java3d.MouseBehaviorJ3D
-
- All Implemented Interfaces:
- MouseBehavior
- Direct Known Subclasses:
- WandBehaviorJ3D
public class MouseBehaviorJ3D extends javax.media.j3d.Behavior implements MouseBehavior
MouseBehaviorJ3D is the VisAD class for mouse behaviors for Java3D
-
-
Field Summary
-
Fields inherited from class javax.media.j3d.Node
ALLOW_AUTO_COMPUTE_BOUNDS_READ, ALLOW_AUTO_COMPUTE_BOUNDS_WRITE, ALLOW_BOUNDS_READ, ALLOW_BOUNDS_WRITE, ALLOW_COLLIDABLE_READ, ALLOW_COLLIDABLE_WRITE, ALLOW_LOCAL_TO_VWORLD_READ, ALLOW_LOCALE_READ, ALLOW_PARENT_READ, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING
-
-
Constructor Summary
Constructors Constructor and Description MouseBehaviorJ3D()Default ConstructorMouseBehaviorJ3D(DisplayRendererJ3D r)Construct a MouseBehavior for the DisplayRenderer specifiedMouseBehaviorJ3D(DisplayRendererJ3D r, java.lang.Class mhClass)Construct a MouseBehavior for the DisplayRenderer specified
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description VisADRaycursorRay(double[] cursor)Return the VisAD ray corresponding to the VisAD cursor coordinates.voiddestroy()VisADRayfindRay(int screen_x, int screen_y)Return the VisAD ray corresponding to the component coordinates.MouseHelpergetMouseHelper()Get the helper class used by this MouseBehavior.double[]getPlateCoords(double[] position)Return the screen coordinates corresponding to the VisAD coordinates.int[]getScreenCoords(double[] position)Return the screen coordinates corresponding to the VisAD coordinates.voidinitialize()Initialize this behavior.voidinstance_unmake_matrix(double[] rot, double[] scale, double[] trans, double[] matrix)Get the rotation, scale and translation parameters for the specified matrix.double[]make_matrix(double rotx, double roty, double rotz, double scale, double transx, double transy, double transz)Make a transformation matrix to perform the given rotation, scale and translation.double[]make_matrix(double rotx, double roty, double rotz, double scalex, double scaley, double scalez, double transx, double transy, double transz)Make a transformation matrix to perform the given rotation, scale and translation.double[]make_translate(double transx, double transy)Create a translation matrix.double[]make_translate(double transx, double transy, double transz)Create a translation matrix.double[]multiply_matrix(double[] a, double[] b)Multiply the two matrices together.voidprocessStimulus(java.util.Enumeration criteria)Process a stimulus meant for this behavior.static double[]static_make_matrix(double rotx, double roty, double rotz, double scale, double transx, double transy, double transz)Make a transformation matrix to perform the given rotation, scale and translation.static double[]static_make_matrix(double rotx, double roty, double rotz, double scalex, double scaley, double scalez, double transx, double transy, double transz)Make a transformation matrix to perform the given rotation, scale and translation.static double[]static_multiply_matrix(double[] a, double[] b)Multiply the two matrices together.static voidunmake_matrix(double[] rot, double[] scale, double[] trans, double[] matrix)Get the rotation, scale and translation parameters for the specified matrix.-
Methods inherited from class javax.media.j3d.Behavior
getEnable, getNumSchedulingIntervals, getSchedulingBoundingLeaf, getSchedulingBounds, getSchedulingInterval, postId, setEnable, setSchedulingBoundingLeaf, setSchedulingBounds, setSchedulingInterval, updateNodeReferences
-
Methods inherited from class javax.media.j3d.Node
cloneNode, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocale, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable
-
-
-
-
Constructor Detail
-
MouseBehaviorJ3D
public MouseBehaviorJ3D()
Default Constructor
-
MouseBehaviorJ3D
public MouseBehaviorJ3D(DisplayRendererJ3D r)
Construct a MouseBehavior for the DisplayRenderer specified- Parameters:
r- DisplayRenderer to use
-
MouseBehaviorJ3D
public MouseBehaviorJ3D(DisplayRendererJ3D r, java.lang.Class mhClass)
Construct a MouseBehavior for the DisplayRenderer specified- Parameters:
r- DisplayRenderer to usemhClass- MouseHelper subclass to use
-
-
Method Detail
-
destroy
public void destroy()
-
getMouseHelper
public MouseHelper getMouseHelper()
Get the helper class used by this MouseBehavior. TheMouseHelperdefines the actions taken based onMouseEvents.- Specified by:
getMouseHelperin interfaceMouseBehavior- Returns:
MouseHelperbeing used.
-
initialize
public void initialize()
Initialize this behavior. NOTE: Applications should not call this method. It is called by the Java 3D behavior scheduler.- Specified by:
initializein classjavax.media.j3d.Behavior
-
processStimulus
public void processStimulus(java.util.Enumeration criteria)
Process a stimulus meant for this behavior. This method is invoked when a key is pressed. NOTE: Applications should not call this method. It is called by the Java 3D behavior scheduler.- Specified by:
processStimulusin classjavax.media.j3d.Behavior- Parameters:
criteria- an enumeration of triggered wakeup criteria
-
findRay
public VisADRay findRay(int screen_x, int screen_y)
Return the VisAD ray corresponding to the component coordinates.- Specified by:
findRayin interfaceMouseBehavior- Parameters:
screen_x- x coordinate of the componentscreen_y- y coordinate of the component- Returns:
- corresponding VisADRay
- See Also:
VisADRay,LocalDisplay.getComponent()
-
cursorRay
public VisADRay cursorRay(double[] cursor)
Return the VisAD ray corresponding to the VisAD cursor coordinates.- Specified by:
cursorRayin interfaceMouseBehavior- Parameters:
cursor- array (x,y,z) of cursor location- Returns:
- corresponding VisADRay
- See Also:
VisADRay,DisplayRenderer.getCursor()
-
getScreenCoords
public int[] getScreenCoords(double[] position)
Return the screen coordinates corresponding to the VisAD coordinates.- Specified by:
getScreenCoordsin interfaceMouseBehavior- Parameters:
position- array of VisAD coordinates- Returns:
- corresponding (x, y) screen coordinates
-
getPlateCoords
public double[] getPlateCoords(double[] position)
Return the screen coordinates corresponding to the VisAD coordinates.- Parameters:
position- array of VisAD coordinates- Returns:
- corresponding (x, y) plate coordinates (in meters)
-
make_translate
public double[] make_translate(double transx, double transy, double transz)Create a translation matrix.- Specified by:
make_translatein interfaceMouseBehavior- Parameters:
transx- x translation amounttransy- y translation amounttransz- z translation amount- Returns:
- new translation matrix. This can be used to translate the current matrix
- See Also:
multiply_matrix(double[] a, double[] b)
-
make_translate
public double[] make_translate(double transx, double transy)Create a translation matrix. no translation in Z direction (useful for 2D in Java 3D.- Specified by:
make_translatein interfaceMouseBehavior- Parameters:
transx- x translation amounttransy- y translation amount- Returns:
- new translation matrix. This can be used to translate the current matrix
- See Also:
multiply_matrix(double[] a, double[] b)
-
multiply_matrix
public double[] multiply_matrix(double[] a, double[] b)Multiply the two matrices together.- Specified by:
multiply_matrixin interfaceMouseBehavior- Parameters:
a- first matrixb- second matrix- Returns:
- new resulting matrix
- See Also:
static_multiply_matrix(double[], double[])
-
static_multiply_matrix
public static double[] static_multiply_matrix(double[] a, double[] b)Multiply the two matrices together. Static version of multiply_matrix.- Parameters:
a- first matrixb- second matrix- Returns:
- new resulting matrix
- See Also:
multiply_matrix(double[] a, double[] b)
-
make_matrix
public double[] make_matrix(double rotx, double roty, double rotz, double scale, double transx, double transy, double transz)Make a transformation matrix to perform the given rotation, scale and translation. This function uses the fast matrix post-concatenation techniques from Graphics Gems.- Specified by:
make_matrixin interfaceMouseBehavior- Parameters:
rotx- x rotationroty- y rotationrotz- z rotationscale- scaling factortransx- x translationtransy- y translationtransz- z translation- Returns:
- new matrix
-
make_matrix
public double[] make_matrix(double rotx, double roty, double rotz, double scalex, double scaley, double scalez, double transx, double transy, double transz)Make a transformation matrix to perform the given rotation, scale and translation. This function uses the fast matrix post-concatenation techniques from Graphics Gems.- Specified by:
make_matrixin interfaceMouseBehavior- Parameters:
rotx- x rotationroty- y rotationrotz- z rotationscalex- x scaling factorscaley- y scaling factorscalez- z scaling factortransx- x translationtransy- y translationtransz- z translation- Returns:
- new matrix
-
static_make_matrix
public static double[] static_make_matrix(double rotx, double roty, double rotz, double scale, double transx, double transy, double transz)Make a transformation matrix to perform the given rotation, scale and translation. This function uses the fast matrix post-concatenation techniques from Graphics Gems. Static version of make_matrix.- Parameters:
rotx- x rotationroty- y rotationrotz- z rotationscale- scaling factortransx- x translationtransy- y translationtransz- z translation- Returns:
- new matrix
- See Also:
make_matrix(double rotx, double roty, double rotz, double scale, double transx, double transy, double transz)
-
static_make_matrix
public static double[] static_make_matrix(double rotx, double roty, double rotz, double scalex, double scaley, double scalez, double transx, double transy, double transz)Make a transformation matrix to perform the given rotation, scale and translation. This function uses the fast matrix post-concatenation techniques from Graphics Gems. Static version of make_matrix.- Parameters:
rotx- x rotationroty- y rotationrotz- z rotationscalex- x scaling factorscaley- y scaling factorscalez- z scaling factortransx- x translationtransy- y translationtransz- z translation- Returns:
- new matrix
- See Also:
make_matrix(double rotx, double roty, double rotz, double scale, double transx, double transy, double transz)
-
instance_unmake_matrix
public void instance_unmake_matrix(double[] rot, double[] scale, double[] trans, double[] matrix)Get the rotation, scale and translation parameters for the specified matrix. Results are not valid for non-uniform aspect (scale).- Specified by:
instance_unmake_matrixin interfaceMouseBehavior- Parameters:
rot- array to hold x,y,z rotation valuesscale- array to hold scale valuetrans- array to hold x,y,z translation values
-
unmake_matrix
public static void unmake_matrix(double[] rot, double[] scale, double[] trans, double[] matrix)Get the rotation, scale and translation parameters for the specified matrix. Results are not valid for non-uniform aspect (scale). Static version ofinstance_unmake_matrix.- Parameters:
rot- array to hold x,y,z rotation valuesscale- array to hold scale value(s). If length == 1, assumes uniform scaling.trans- array to hold x,y,z translation values
-
-
DMelt 3.0 © DataMelt by jWork.ORG