Xj3D 2.0 VRML/X3D Code API

org.web3d.vrml.nodes
Interface VRMLPickingSensorNodeType

All Superinterfaces:
FrameStateListener, VRMLChildNodeType, VRMLNode, VRMLNodeType, VRMLSensorNodeType, VRMLWorldRootChildNodeType
All Known Subinterfaces:
OGLPickingSensorNodeType

public interface VRMLPickingSensorNodeType
extends VRMLSensorNodeType

A sensor that handles pick intersection tests.

The picking sensor capabilities is an Xj3D extension specification. You can find more details about it at http://www.xj3d.org/extensions/picking.html

Version:
$Revision: 1.6 $
Author:
Justin Couch

Field Summary
static int BOX_PICK
          The picking type is box
static int CONE_PICK
          The picking type is cone
static int CYLINDER_PICK
          The picking type is cylinder
static int INTERSECT_BOUNDS
          Intersection test type is BOUNDS
static int INTERSECT_GEOMETRY
          Intersection test type is GEOMETRY
static int LINE_PICK
          The picking type is line
static int POINT_PICK
          The picking type is point
static int SORT_ALL
          Sort order is ALL
static int SORT_ALL_SORTED
          Sort order is ALL_SORTED
static int SORT_ANY
          Sort order is ANY
static int SORT_CLOSEST
          Sort order is CLOSEST
static int SPHERE_PICK
          The picking type is sphere
static int UNDEFINED_PICK
          The picking type is not defined because there isn't a pickGeometry given
static int VOLUME_PICK
          The picking type is polytope/volume
 
Method Summary
 int getIntersectionType()
          Get the intersection type requested for this node
 void getObjectType(java.lang.String[] val)
          Fetch the number of object type values in use currently.
 VRMLNodeType getPickingGeometry()
          Fetch the real node that is being used to pick the geometry.
 VRMLNodeType[] getPickingTargets()
          Get the list of nodes that are used for the target geometry.
 int getPickingType()
          Get the picking type that this class represents.
 int getSortOrder()
          Get the intersection type requested for this node
 void notifyPickChange(int numPicks, VRMLNodeType[] nodes, float[] points, float[] normals, float[] texCoords)
          Notify the drag sensor that a sensor is currently dragging this device and that it's position and orientation are as given.
 void notifyPickEnd()
          Notification that this sensor has finished a picking action.
 void notifyPickStart(int numPicks, VRMLNodeType[] nodes, float[] points, float[] normals, float[] texCoords)
          Notification that this sensor has just been clicked on to start the pick action.
 int numObjectType()
          Get the current number of valid object type strings.
 void setObjectType(java.lang.String[] types, int numValid)
          Set the list of picking targets that this object corresponds to.
 void setPickingGeometry(VRMLNodeType geom)
          Set the goemetry used to perform the picking.
 
Methods inherited from interface org.web3d.vrml.nodes.VRMLSensorNodeType
getEnabled, getIsActive, setEnabled
 
Methods inherited from interface org.web3d.vrml.nodes.VRMLNodeType
addNodeListener, clearRemovedLayerIds, getFieldValue, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, hasFieldChanged, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, sendRoute, setDEF, setFrameStateManager, setMetadataObject, setupFinished, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCount
 
Methods inherited from interface org.web3d.vrml.lang.VRMLNode
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, getPrimaryType, getSecondaryType, getUserData, getVRMLNodeName, isDEF, setErrorReporter, setUserData, setVersion
 
Methods inherited from interface org.web3d.vrml.nodes.FrameStateListener
allEventsComplete
 

Field Detail

UNDEFINED_PICK

static final int UNDEFINED_PICK
The picking type is not defined because there isn't a pickGeometry given

See Also:
Constant Field Values

POINT_PICK

static final int POINT_PICK
The picking type is point

See Also:
Constant Field Values

LINE_PICK

static final int LINE_PICK
The picking type is line

See Also:
Constant Field Values

SPHERE_PICK

static final int SPHERE_PICK
The picking type is sphere

See Also:
Constant Field Values

BOX_PICK

static final int BOX_PICK
The picking type is box

See Also:
Constant Field Values

CONE_PICK

static final int CONE_PICK
The picking type is cone

See Also:
Constant Field Values

CYLINDER_PICK

static final int CYLINDER_PICK
The picking type is cylinder

See Also:
Constant Field Values

VOLUME_PICK

static final int VOLUME_PICK
The picking type is polytope/volume

See Also:
Constant Field Values

SORT_CLOSEST

static final int SORT_CLOSEST
Sort order is CLOSEST

See Also:
Constant Field Values

SORT_ALL

static final int SORT_ALL
Sort order is ALL

See Also:
Constant Field Values

SORT_ALL_SORTED

static final int SORT_ALL_SORTED
Sort order is ALL_SORTED

See Also:
Constant Field Values

SORT_ANY

static final int SORT_ANY
Sort order is ANY

See Also:
Constant Field Values

INTERSECT_BOUNDS

static final int INTERSECT_BOUNDS
Intersection test type is BOUNDS

See Also:
Constant Field Values

INTERSECT_GEOMETRY

static final int INTERSECT_GEOMETRY
Intersection test type is GEOMETRY

See Also:
Constant Field Values
Method Detail

setObjectType

void setObjectType(java.lang.String[] types,
                   int numValid)
Set the list of picking targets that this object corresponds to. These can be an array of strings.

Parameters:
types - The list of object type strings to use
numValid - The number of valid values to read from the array

numObjectType

int numObjectType()
Get the current number of valid object type strings.

Returns:
a number >= 0

getObjectType

void getObjectType(java.lang.String[] val)
Fetch the number of object type values in use currently.

Parameters:
val - An array to copy the values to

getPickingType

int getPickingType()
Get the picking type that this class represents. A shortcut way of quickly determining the picking strategy to be used by the internal implementation to avoid unnessary calculations.

Returns:
One of the *_PICK constants

getSortOrder

int getSortOrder()
Get the intersection type requested for this node

Returns:
one of the SORT_* constants

getIntersectionType

int getIntersectionType()
Get the intersection type requested for this node

Returns:
one of the INTERSECT_* constants

setPickingGeometry

void setPickingGeometry(VRMLNodeType geom)
Set the goemetry used to perform the picking.

Parameters:
geom - VRMLGeometryNodeType
Throws:
InvalidFieldValueException - The geometry is not acceptable for this picking type.

getPickingGeometry

VRMLNodeType getPickingGeometry()
Fetch the real node that is being used to pick the geometry. This returns the real node that may be buried under one or more proto instances as part of the geometry picking scheme. If the picker is an externproto that hasn't resolved, obviously this will return null.

Returns:
The valid geometry node or null if not set

getPickingTargets

VRMLNodeType[] getPickingTargets()
Get the list of nodes that are used for the target geometry. This can be a internal listing of children. Any node valid entries in the can be set to null.


notifyPickStart

void notifyPickStart(int numPicks,
                     VRMLNodeType[] nodes,
                     float[] points,
                     float[] normals,
                     float[] texCoords)
Notification that this sensor has just been clicked on to start the pick action.

Parameters:
numPicks - The number of items picked in the array
nodes - The geometry that was picked
points - Optional array of points that are the intersection points
normals - Optional array of normals that are the intersection points
texCoords - Optional array of texture coordinates that are the intersection points

notifyPickChange

void notifyPickChange(int numPicks,
                      VRMLNodeType[] nodes,
                      float[] points,
                      float[] normals,
                      float[] texCoords)
Notify the drag sensor that a sensor is currently dragging this device and that it's position and orientation are as given.

Parameters:
numPicks - The number of items picked in the array
nodes - The geometry that was picked
points - Optional array of points that are the intersection points
normals - Optional array of normals that are the intersection points
texCoords - Optional array of texture coordinates that are the intersection points

notifyPickEnd

void notifyPickEnd()
Notification that this sensor has finished a picking action.


Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium