Xj3D 2.0 VRML/X3D Code API

org.web3d.vrml.renderer.ogl.input
Class DefaultPickingManager

java.lang.Object
  extended by org.web3d.vrml.renderer.ogl.input.DefaultPickingManager
All Implemented Interfaces:
OGLPickingFlagConvertor, PickingManager

public class DefaultPickingManager
extends java.lang.Object
implements PickingManager, OGLPickingFlagConvertor

Manager for processing the functionality of the Picking Utilities component.

Picking and, ultimately, n-body object collision detection is handled by this manager.

Version:
$Revision: 1.9 $
Author:
Justin Couch

Constructor Summary
DefaultPickingManager()
          Construct a new instance of this class.
 
Method Summary
 int addObjectType(java.lang.String type)
          Add a new flag to the system and get told what bitmask to use.
 void addSensor(VRMLPickingSensorNodeType sensor)
          Add a new sensor instance to the system for processing.
 void clear()
          Force clearing all state from this manager now.
 void loadScene(BasicScene scene)
          Load the contents of this scene into the sensor manager.
 void processPickSensors(double time)
          Process the list of picking sensors now.
 void removeObjectType(java.lang.String type)
          Notify the system that the flag is no longer being used by this node.
 void removeSensor(VRMLPickingSensorNodeType sensor)
          Cleanup the given sensors and remove them from the list of processing to be done each frame.
 void setErrorReporter(ErrorReporter reporter)
          Register an error reporter with the engine so that any errors generated by the loading of script code can be reported in a nice, pretty fashion.
 void unloadScene(BasicScene scene)
          Unload the contents of this scene into the sensor manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultPickingManager

public DefaultPickingManager()
Construct a new instance of this class.

Method Detail

setErrorReporter

public void setErrorReporter(ErrorReporter reporter)
Register an error reporter with the engine so that any errors generated by the loading of script code can be reported in a nice, pretty fashion. Setting a value of null will clear the currently set reporter. If one is already set, the new value replaces the old.

Specified by:
setErrorReporter in interface PickingManager
Parameters:
reporter - The instance to use or null

processPickSensors

public void processPickSensors(double time)
Process the list of picking sensors now.

Specified by:
processPickSensors in interface PickingManager
Parameters:
time - The timestamp for "now"

addSensor

public void addSensor(VRMLPickingSensorNodeType sensor)
Add a new sensor instance to the system for processing.

Specified by:
addSensor in interface PickingManager
Parameters:
sensor - The sensor instance to add

removeSensor

public void removeSensor(VRMLPickingSensorNodeType sensor)
Cleanup the given sensors and remove them from the list of processing to be done each frame. The list will be created elsewhere (typically the per-frame behaviour as a result of the event model processing) and passed to this manager. The given list will contain instances of VRMLSensorNodeType. There will be no protos as this is just the raw sensor nodes internally.

Specified by:
removeSensor in interface PickingManager
Parameters:
sensor - The sensor instance to remove

loadScene

public void loadScene(BasicScene scene)
Load the contents of this scene into the sensor manager. The call does not need to be recursive as it is expected the external caller will work with this.

Specified by:
loadScene in interface PickingManager
Parameters:
scene - The scene to source data from

unloadScene

public void unloadScene(BasicScene scene)
Unload the contents of this scene into the sensor manager. The call does not need to be recursive as it is expected the external caller will work with this.

Specified by:
unloadScene in interface PickingManager
Parameters:
scene - The scene to source data from

clear

public void clear()
Force clearing all state from this manager now. This is used to indicate that a new world is about to be loaded and everything should be cleaned out now.

Specified by:
clear in interface PickingManager

addObjectType

public int addObjectType(java.lang.String type)
Add a new flag to the system and get told what bitmask to use.

Specified by:
addObjectType in interface OGLPickingFlagConvertor
Parameters:
type - The type string to use
Returns:
An int bit mask to be applied

removeObjectType

public void removeObjectType(java.lang.String type)
Notify the system that the flag is no longer being used by this node.

Specified by:
removeObjectType in interface OGLPickingFlagConvertor
Parameters:
type - The type string to use

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium