pickingExt
Class PickMouseBehavior

java.lang.Object
  |
  +--javax.media.j3d.SceneGraphObject
        |
        +--javax.media.j3d.Node
              |
              +--javax.media.j3d.Leaf
                    |
                    +--javax.media.j3d.Behavior
                          |
                          +--pickingExt.PickMouseBehavior
Direct Known Subclasses:
PickRotateBehavior, PickTranslateBehavior, PickZoomBehavior

public abstract class PickMouseBehavior
extends javax.media.j3d.Behavior

Base class that allows users to adding picking and mouse manipulation to his scene graph (see PickDragBehavior for an example of how to extend this base class). This class is useful for interactive apps.


Field Summary
protected  boolean buttonPress
           
protected  javax.media.j3d.WakeupCriterion[] conditions
           
protected  javax.media.j3d.TransformGroup currGrp
           
protected static boolean debug
           
protected  java.awt.event.MouseEvent mevent
           
protected  PickObject pickScene
          Portion of the scene graph to operate picking on.
protected  javax.media.j3d.WakeupOr wakeupCondition
           
 
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_PICK, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING
 
Constructor Summary
PickMouseBehavior(javax.media.j3d.Canvas3D canvas, javax.media.j3d.BranchGroup root, javax.media.j3d.Bounds bounds)
          Creates a PickMouseBehavior given current canvas, root of the tree to operate on, and the bounds.
 
Method Summary
 java.awt.Point[] getPickAperture()
          Returns the pick aperture for SHAPE_APERTURE mode for this behavior
 int getPickMode()
          Returns the pickMode for this behavior
 int getPickShapeMode()
          Returns the pick geometry shape type
 void initialize()
           
 void processStimulus(java.util.Enumeration criteria)
           
 void setPickAperture(java.awt.Point[] aperturePts)
          Sets the pick aperture for SHAPE_APERTURE mode for this behavior
 void setPickMode(int pickMode)
          Sets the pickMode for this behavior
 void setPickShapeMode(int type)
          Sets the pick geometry shape type for this behavior
abstract  void updateScene(int xpos, int ypos)
          Subclasses shall implement this update function
 
Methods inherited from class javax.media.j3d.Behavior
duplicateNode, getEnable, getSchedulingBoundingLeaf, getSchedulingBounds, getView, postId, setEnable, setSchedulingBoundingLeaf, setSchedulingBounds, updateNodeReferences, wakeupOn
 
Methods inherited from class javax.media.j3d.Node
cloneNode, cloneTree, cloneTree, cloneTree, getBounds, getBoundsAutoCompute, getCollidable, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable
 
Methods inherited from class javax.media.j3d.SceneGraphObject
clearCapability, duplicateSceneGraphObject, getCapability, getUserData, isCompiled, isLive, setCapability, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pickScene

protected PickObject pickScene
Portion of the scene graph to operate picking on.

conditions

protected javax.media.j3d.WakeupCriterion[] conditions

wakeupCondition

protected javax.media.j3d.WakeupOr wakeupCondition

buttonPress

protected boolean buttonPress

currGrp

protected javax.media.j3d.TransformGroup currGrp

debug

protected static final boolean debug

mevent

protected java.awt.event.MouseEvent mevent
Constructor Detail

PickMouseBehavior

public PickMouseBehavior(javax.media.j3d.Canvas3D canvas,
                         javax.media.j3d.BranchGroup root,
                         javax.media.j3d.Bounds bounds)
Creates a PickMouseBehavior given current canvas, root of the tree to operate on, and the bounds.
Method Detail

initialize

public void initialize()
Overrides:
initialize in class javax.media.j3d.Behavior

processStimulus

public void processStimulus(java.util.Enumeration criteria)
Overrides:
processStimulus in class javax.media.j3d.Behavior

setPickMode

public void setPickMode(int pickMode)
Sets the pickMode for this behavior
Parameters:
mode - The pick mode, either USE_GEOMETRY or USE_BOUNDS

getPickMode

public int getPickMode()
Returns the pickMode for this behavior

setPickShapeMode

public void setPickShapeMode(int type)
Sets the pick geometry shape type for this behavior
Parameters:
type - The pick shape type, either SHAPE_RAY, SHAPE_APERTURE or SHAPE_RAY_APERTURE. The default is SHAPE_RAY.

getPickShapeMode

public int getPickShapeMode()
Returns the pick geometry shape type

setPickAperture

public void setPickAperture(java.awt.Point[] aperturePts)
Sets the pick aperture for SHAPE_APERTURE mode for this behavior
Parameters:
Point[] - aperturePts The pick aperture, which should be a convex, counter-clockwise loop of Points around 0,0

getPickAperture

public java.awt.Point[] getPickAperture()
Returns the pick aperture for SHAPE_APERTURE mode for this behavior

updateScene

public abstract void updateScene(int xpos,
                                 int ypos)
Subclasses shall implement this update function