gumbo.graphic.probe
Class AbstractPickSensor

java.lang.Object
  |
  +--gumbo.graphic.probe.AbstractPickSensor
All Implemented Interfaces:
PickSensor

public class AbstractPickSensor
extends java.lang.Object
implements PickSensor

A full implementation of the PickSensor interface. The default implementation assumes 2D picking, with a point as the picker shape and the input space as the pickable.

Version:
$Revision: 1.1 $
Author:
Jon Barrilleaux (jonb@jmbaai.com) of JMB and Associates Inc.

Constructor Summary
AbstractPickSensor(java.util.Set specs, PickEngine engine)
          Creates an instance, with the specified pickables.
 
Method Summary
protected  PickResult doPick(java.util.Set specs, PickEngine engine)
          Called by the system to perform a pick operation before outputting a result.
 BooleanField.EventIn getPickActiveIn()
          While false, picking geometry inputs are assumed invalid, with pick requests generating a null pick result.
 BooleanField.EventIn getPickDiscreteIn()
          If true, a pick occurs only when a pick request is received (getPickRequestIn()); otherwise, a pick request is generated each time the pick geometry (position, orientation) changes.
 BooleanField.EventIn getPickEnableIn()
          Enables/disables this sensor.
 Point3Field.EventIn getPickPositionIn()
          The position of the picker shape's origin relative to the pick space input.
 NotifyNode.EventIn getPickRequestIn()
          A pick is performed using the current pick geometry.
 PickResultField.EventOut getPickResultOut()
          Sends an event each time a pick is requested.
 SpaceNodeField.EventIn getPickSpaceIn()
          The reference space for the pick position input.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPickSensor

public AbstractPickSensor(java.util.Set specs,
                          PickEngine engine)
Creates an instance, with the specified pickables. Master constructor.

Parameters:
specs - Pick specs that are compatible with the pick engine. None if null.
engine - Reference to a pick engine that can handle a Point3 picker and IntersectableGraphic pickables (such as AbstractPickEngine). Never null
Method Detail

doPick

protected PickResult doPick(java.util.Set specs,
                            PickEngine engine)
Called by the system to perform a pick operation before outputting a result. Default implementation: Performs a pick using a point at the input position as the picker, and the input space as the pickable.

Parameters:
specs - Pick specs provided at construction time. Never null.
engine - Pick engine provided at construction time. Never null.
Returns:
New pick result. Null if the pick operation is benignly invalid (picking is inactive) or should be ignored (consumed by the native graphic system).

getPickEnableIn

public BooleanField.EventIn getPickEnableIn()
Description copied from interface: PickSensor
Enables/disables this sensor. While disabled, inputs are ignored and there are no outputs. May cause re-initialization of internal state (such as discovery of pickables). The default is true.

Specified by:
getPickEnableIn in interface PickSensor

getPickActiveIn

public BooleanField.EventIn getPickActiveIn()
Description copied from interface: PickSensor
While false, picking geometry inputs are assumed invalid, with pick requests generating a null pick result. The default is false.

Specified by:
getPickActiveIn in interface PickSensor

getPickDiscreteIn

public BooleanField.EventIn getPickDiscreteIn()
Description copied from interface: PickSensor
If true, a pick occurs only when a pick request is received (getPickRequestIn()); otherwise, a pick request is generated each time the pick geometry (position, orientation) changes. The default is false (continuous picking).

Specified by:
getPickDiscreteIn in interface PickSensor

getPickRequestIn

public NotifyNode.EventIn getPickRequestIn()
Description copied from interface: PickSensor
A pick is performed using the current pick geometry.

Specified by:
getPickRequestIn in interface PickSensor

getPickSpaceIn

public SpaceNodeField.EventIn getPickSpaceIn()
Description copied from interface: PickSensor
The reference space for the pick position input. Never null while active.

Specified by:
getPickSpaceIn in interface PickSensor

getPickPositionIn

public Point3Field.EventIn getPickPositionIn()
Description copied from interface: PickSensor
The position of the picker shape's origin relative to the pick space input. Never null while active.

Specified by:
getPickPositionIn in interface PickSensor

getPickResultOut

public PickResultField.EventOut getPickResultOut()
Description copied from interface: PickSensor
Sends an event each time a pick is requested. If the pick is valid, contains none or more hits; otherwise, sends null, which occurs if the pick operation is benignly invalid (picking is inactive) or should be ignored (consumed by the native graphic system). If discrete in is false (continuous picking), outputs a null result before active in goes false.

Specified by:
getPickResultOut in interface PickSensor