public class MouseBehaviorJ3D extends Behavior implements MouseBehavior
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 and Description |
---|
MouseBehaviorJ3D()
Default Constructor
|
MouseBehaviorJ3D(DisplayRendererJ3D r)
Construct a MouseBehavior for the DisplayRenderer specified
|
MouseBehaviorJ3D(DisplayRendererJ3D r,
Class mhClass)
Construct a MouseBehavior for the DisplayRenderer specified
|
Modifier and Type | Method and Description |
---|---|
VisADRay |
cursorRay(double[] cursor)
Return the VisAD ray corresponding to the VisAD cursor coordinates.
|
void |
destroy() |
VisADRay |
findRay(int screen_x,
int screen_y)
Return the VisAD ray corresponding to the component coordinates.
|
MouseHelper |
getMouseHelper()
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.
|
void |
initialize()
Initialize this behavior.
|
void |
instance_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.
|
void |
processStimulus(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 void |
unmake_matrix(double[] rot,
double[] scale,
double[] trans,
double[] matrix)
Get the rotation, scale and translation parameters for the specified
matrix.
|
getEnable, getNumSchedulingIntervals, getSchedulingBoundingLeaf, getSchedulingBounds, getSchedulingInterval, getView, getWakeupCondition, postId, setEnable, setSchedulingBoundingLeaf, setSchedulingBounds, setSchedulingInterval, updateNodeReferences, wakeupOn
cloneNode, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocale, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString
public MouseBehaviorJ3D()
public MouseBehaviorJ3D(DisplayRendererJ3D r)
r
- DisplayRenderer to usepublic MouseBehaviorJ3D(DisplayRendererJ3D r, Class mhClass)
r
- DisplayRenderer to usemhClass
- MouseHelper subclass to usepublic void destroy()
public MouseHelper getMouseHelper()
MouseHelper
defines the actions taken based
on MouseEvent
s.getMouseHelper
in interface MouseBehavior
MouseHelper
being used.public void initialize()
initialize
in class Behavior
public void processStimulus(Enumeration criteria)
processStimulus
in class Behavior
criteria
- an enumeration of triggered wakeup criteriapublic VisADRay findRay(int screen_x, int screen_y)
findRay
in interface MouseBehavior
screen_x
- x coordinate of the componentscreen_y
- y coordinate of the componentVisADRay
,
LocalDisplay.getComponent()
public VisADRay cursorRay(double[] cursor)
cursorRay
in interface MouseBehavior
cursor
- array (x,y,z) of cursor locationVisADRay
,
DisplayRenderer.getCursor()
public int[] getScreenCoords(double[] position)
getScreenCoords
in interface MouseBehavior
position
- array of VisAD coordinatespublic double[] getPlateCoords(double[] position)
position
- array of VisAD coordinatespublic double[] make_translate(double transx, double transy, double transz)
make_translate
in interface MouseBehavior
transx
- x translation amounttransy
- y translation amounttransz
- z translation amountmultiply_matrix(double[] a, double[] b)
public double[] make_translate(double transx, double transy)
make_translate
in interface MouseBehavior
transx
- x translation amounttransy
- y translation amountmultiply_matrix(double[] a, double[] b)
public double[] multiply_matrix(double[] a, double[] b)
multiply_matrix
in interface MouseBehavior
a
- first matrixb
- second matrixstatic_multiply_matrix(double[], double[])
public static double[] static_multiply_matrix(double[] a, double[] b)
a
- first matrixb
- second matrixmultiply_matrix(double[] a, double[] b)
public double[] make_matrix(double rotx, double roty, double rotz, double scale, double transx, double transy, double transz)
make_matrix
in interface MouseBehavior
rotx
- x rotationroty
- y rotationrotz
- z rotationscale
- scaling factortransx
- x translationtransy
- y translationtransz
- z translationpublic double[] make_matrix(double rotx, double roty, double rotz, double scalex, double scaley, double scalez, double transx, double transy, double transz)
make_matrix
in interface MouseBehavior
rotx
- x rotationroty
- y rotationrotz
- z rotationscalex
- x scaling factorscaley
- y scaling factorscalez
- z scaling factortransx
- x translationtransy
- y translationtransz
- z translationpublic static double[] static_make_matrix(double rotx, double roty, double rotz, double scale, double transx, double transy, double transz)
rotx
- x rotationroty
- y rotationrotz
- z rotationscale
- scaling factortransx
- x translationtransy
- y translationtransz
- z translationmake_matrix(double rotx, double roty, double rotz,
double scale, double transx, double transy, double transz)
public static double[] static_make_matrix(double rotx, double roty, double rotz, double scalex, double scaley, double scalez, double transx, double transy, double transz)
rotx
- x rotationroty
- y rotationrotz
- z rotationscalex
- x scaling factorscaley
- y scaling factorscalez
- z scaling factortransx
- x translationtransy
- y translationtransz
- z translationmake_matrix(double rotx, double roty, double rotz,
double scale, double transx, double transy, double transz)
public void instance_unmake_matrix(double[] rot, double[] scale, double[] trans, double[] matrix)
instance_unmake_matrix
in interface MouseBehavior
rot
- array to hold x,y,z rotation valuesscale
- array to hold scale valuetrans
- array to hold x,y,z translation valuespublic static void unmake_matrix(double[] rot, double[] scale, double[] trans, double[] matrix)
instance_unmake_matrix
.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 valuesCopyright © 1996–2023 The SSEC Visualization Project. All rights reserved.