Xj3D VRML/X3D Code API

org.web3d.vrml.nodes.runtime
Interface EventModelEvaluator

All Known Implementing Classes:
GeneralisedEventModelEvaluator

public interface EventModelEvaluator

An abstract representation of a class that would be responsible for performing all the event model computations and organisation on a per-frame basis.

This class allows extensibility of the event model implementation by both providing an abstract view of the event model, but also allowing individual node types to have their own managers that are dealt with by the event model.

Version:
$Revision: 1.14 $
Author:
Justin Couch

Method Summary
 void addExternalView(ExternalView view)
          Add an external view to the evaluator.
 void clear()
          Force clearing all state from this manager now.
 void evaluate(long time)
          Run the event model for this frame now.
 BindableNodeManager getBindableManager(int type)
          Get the bindable node manager for the given node type.
 ExternalLoadManager getContentLoader()
          Get the content loader in use by the evaluator.
 FrameStateManager getFrameStateManager()
          Get the frame state manager in use by the evaluator.
 NodeManager[] getNodeManagers()
          Get the list of external node managers currently in use.
 RouteManager getRouteManager()
          Get the route manager in use by the evaluator.
 ScriptManager getScriptManager()
          Get the script manager in use by the evaluator.
 SensorManager getSensorManager()
          Get the sensor manager in use by the evaluator.
 VRMLClock getVRMLClock()
          Get the VRMLClock instance in use by this evaluator.
 void initialize(ScriptManager scripts, RouteManager router, SensorManager sensors, FrameStateManager fsm, ExternalLoadManager elm, ViewpointManager vm, NodeManager[] extManagers)
          Initialise the evaluator with the given managers.
 void removeExternalView(ExternalView view)
          Remove the external view from this evaluator.
 void setDefaultBindables(VRMLViewpointNodeType dvp, VRMLNavigationInfoNodeType dni, VRMLBackgroundNodeType dbg, VRMLFogNodeType dfg)
          Set the default bindable instances to use.
 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 setInitListener(EventModelInitListener l)
          Set the listener for intialisation information.
 void setScene(VRMLScene scene, java.lang.String useView)
          Used to set the scene to the new content.
 void shutdown()
          Shutdown the node manager now.
 

Method Detail

initialize

public void initialize(ScriptManager scripts,
                       RouteManager router,
                       SensorManager sensors,
                       FrameStateManager fsm,
                       ExternalLoadManager elm,
                       ViewpointManager vm,
                       NodeManager[] extManagers)
Initialise the evaluator with the given managers.

Parameters:
scripts - The manager for loading scripts
router - The manager for handling routes
sensors - The manager for all sensors
fsm - State manager for the frame
elm - Manager for loading external content
extManagers - List of external managers to handle

shutdown

public void shutdown()
Shutdown the node manager now. If this is using any external resources it should remove those now as the entire application is about to die


setDefaultBindables

public void setDefaultBindables(VRMLViewpointNodeType dvp,
                                VRMLNavigationInfoNodeType dni,
                                VRMLBackgroundNodeType dbg,
                                VRMLFogNodeType dfg)
Set the default bindable instances to use. These are kept around between scenes so that the defaults can always be used when none are supplied by the incoming scene.

Parameters:
dvp - The default Viewpoint to use
dni - The default NavigationInfo to use
dbg - The default Background to use
dfg - The default Fog to use

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.

Parameters:
reporter - The instance to use or null

addExternalView

public void addExternalView(ExternalView view)
Add an external view to the evaluator. A view can only be added once. If the view is added more than once, the second and subsequent calls are ignored.

Parameters:
view - The new view to add

removeExternalView

public void removeExternalView(ExternalView view)
Remove the external view from this evaluator. If the view is not currently registered, the request is silently ignored.

Parameters:
view - The new view to remove

getBindableManager

public BindableNodeManager getBindableManager(int type)
Get the bindable node manager for the given node type. If the node type does not have a bindable manager for it, one will be created.

Parameters:
type - The type constant of the node type for the manager
Returns:
The bindable manager for it
See Also:
TypeConstants

getVRMLClock

public VRMLClock getVRMLClock()
Get the VRMLClock instance in use by this evaluator.

Returns:
A reference to the clock

evaluate

public void evaluate(long time)
Run the event model for this frame now. This is a blocking call and does not return until the event model is complete for this frame. The time should be system clock time, not VRML time.

Parameters:
time - The timestamp of this frame to evaluate

setScene

public void setScene(VRMLScene scene,
                     java.lang.String useView)
Used to set the scene to the new content. Will automatically shutdown the old scene. Assumes a valid scene instance is passed. Also assumes that no clock ticks will be recieved during the setup phase.

Parameters:
scene - The new scene instance to use.
useView - The initial viewpoint DEF name to bind to, Null means normal speced viewpoint.

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.


getSensorManager

public SensorManager getSensorManager()
Get the sensor manager in use by the evaluator.

Returns:
The sensor manager implementation

getScriptManager

public ScriptManager getScriptManager()
Get the script manager in use by the evaluator.

Returns:
The script manager implementation

getRouteManager

public RouteManager getRouteManager()
Get the route manager in use by the evaluator.

Returns:
The route manager implementation

getContentLoader

public ExternalLoadManager getContentLoader()
Get the content loader in use by the evaluator.

Returns:
The content loader implementation

getFrameStateManager

public FrameStateManager getFrameStateManager()
Get the frame state manager in use by the evaluator.

Returns:
The frame state manager implementation

getNodeManagers

public NodeManager[] getNodeManagers()
Get the list of external node managers currently in use. If there are no registered managers, returns null.

Returns:
An array of managers or null

setInitListener

public void setInitListener(EventModelInitListener l)
Set the listener for intialisation information. Setting null will clear the current instance.

Parameters:
l - The listener instance to set

Xj3D VRML/X3D Code API

Copyright © 2001 - 2005 Web3D Consortium