|
Xj3D 2.0 VRML/X3D Code API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.web3d.vrml.renderer.ogl.browser.OGLBrowserCanvas
public class OGLBrowserCanvas
A single canvas that can display a VRML scene graph.
The aim of this canvas is to work in one of two modes - a single canvas that displays the full VRML content, or part of a series of canvases that are used together to form a common view of a single VRML scene graph. The first option represents your typical VRMLbrowser situation, where the latter represents an immersive environment like a CAVE or stereo glasses. The setup of the constructor determines which of these two modes you operate in.
To operate in multicanvas mode, you first start with a single canvas. This canvas is then used as the source of information for all the other canvases. They feed from this central item of information and work from there to build their extra scene information.
Startup of the canvas is a two-phase process. In the first phase, you get
Just the canvas and a bit of view information set up. There is no live
VRML scene graph at this point, and the various getter methods will
return null. After that, there is a second stage that is achieved by
calling the initialize() method. This creates the VRML
structures needed by this class. This second step is quite time consuming
so it allows the caller code to get a UI item on the screen as quickly as
possible and then call a separate thread to start the initialization
process in a separate thread.
As part of the startup process, a lot of loading of extra items needs to be performed. Instead of requiring the user to create their own, this class allows the information to be specified as a collection of system properties. The only part that is not loaded as part of this startup process are the scripting engines. The end user must create their own scripting engine(s) and register those with the ScriptManager, which is available from this class after initialize() has been called.
The following system properties can be defined as part of this class:
org.xj3d.script.loader.class The name of the class
that implements the ScriptLoader
interface, which is used for loading scripts.
org.xj3d.script.manager.class The name of the class
that implements the ScriptManager
interface, which is used for managing scripts.
org.xj3d.file.loader.class The name of the class
that implements the
ContentLoadManager interface,
which is used for loading content other than scripts.
org.xj3d.router.manager.class The name of the class
that implements the RouteManager
interface, which is used for managing routes.
org.xj3d.router.factory.class The name of the class
that implements the RouterFactory
interface, which is used for creating routers.
org.xj3d.frame.state.class The name of the class
that implements the FrameStateManager
interface, which is used for managing per-frame state.
org.xj3d.sensor.manager.class The name of the class
that implements the
SensorManager interface, which
is used for managing sensors.
org.xj3d.eventmodel.evaluator.class The name of the
class that implements the
EventModelEvaluator interface,
which is used for running the event model.
| Field Summary | |
|---|---|
static java.lang.String |
EVENT_MODEL_PROP
Property defining the manager implementation of the event model. |
static java.lang.String |
FILE_LOADER_PROP
Property defining the loader for external files to use. |
static java.lang.String |
HANIM_MANAGER_PROP
Property defining the manager implementation for hanim instances. |
static java.lang.String |
NETWORK_MANAGER_PROP
Property defining the manager implementation for network instances. |
static java.lang.String |
PARTICLE_MANAGER_PROP
Property defining the manager implementation for particle instances. |
static java.lang.String |
PHYSICS_MANAGER_PROP
Property defining the manager implementation for physics instances. |
static java.lang.String |
PICKING_MANAGER_PROP
Property defining the manager implementation for picking sensor interactions. |
static java.lang.String |
ROUTER_FACTORY_PROP
Property defining the factory implementation for providing router instances. |
static java.lang.String |
ROUTER_MANAGER_PROP
Property defining the manager implementation for providing router instances. |
static java.lang.String |
SCRIPT_LOADER_PROP
Property defining the script loader instance to use. |
static java.lang.String |
SCRIPT_MANAGER_PROP
Property defining the script loader instance to use. |
static java.lang.String |
SENSOR_MANAGER_PROP
Property defining the manager implementation for sensor instances. |
static java.lang.String |
STATE_MANAGER_PROP
Property defining the manager implementation for providing router instances. |
| Fields inherited from interface org.web3d.browser.SensorStatusListener |
|---|
TYPE_ANCHOR, TYPE_DRAG_SENSOR, TYPE_TOUCH_SENSOR |
| Constructor Summary | |
|---|---|
OGLBrowserCanvas(org.j3d.aviatrix3d.pipeline.graphics.GraphicsOutputDevice surface,
DeviceFactory deviceFactory,
BrowserConfig configParams)
Construct an empty canvase that contains a single view that is provided by the user. |
|
| Method Summary | |
|---|---|
void |
browserDisposed()
The browser has been disposed, all resources may be freed. |
void |
browserInitialized(VRMLScene scene)
Notification that a world has been loaded into the core of the browser. |
void |
browserShutdown()
Notification that the browser is shutting down the current content. |
void |
deviceActivated(int type)
Invoked when a tracker activates the sensor. |
void |
deviceNotOver(int type)
Invoked when a tracker leaves contact with a sensor. |
void |
deviceOver(int type,
java.lang.String desc)
Invoked when a sensor/anchor is in contact with a tracker capable of picking. |
void |
enableRenderPipeline(boolean enable)
Connect or disconnect the render pipeline as requested by the argument. |
ContentLoadManager |
getContentLoadManager()
Fetch the load manager in use by this class |
EventModelEvaluator |
getEventModelEvaluator()
Get the current event model handler in use with this class. |
FrameStateManager |
getFrameStateManager()
Get the current frame state manager in use with this class. |
LayerRenderingManager |
getLayerRenderingManager()
Fetch the layer rendering manager in use by this class |
RouteManager |
getRouteManager()
Get the current route manager in use with this class. |
ScriptManager |
getScriptManager()
Fetch the script loader in use by this class |
SensorManager |
getSensorManager()
Get the current sensor manager in use with this class. |
OGLStandardBrowserCore |
getUniverse()
Get the universe used by this instant. |
ViewpointManager |
getViewpointManager()
Fetch the viewpoint manager in use by this class. |
WorldLoaderManager |
getWorldLoaderManager()
Get the current world loader manager in use with this class. |
void |
initialize()
Make this canvas go through all its initialization process now. |
void |
linkActivated(java.lang.String[] url_list)
Invoked when a tracker follows a link. |
void |
loadWorld(java.lang.String url)
A request to load the world given by the URL string. |
void |
run()
Run method for the shutdown hook. |
void |
setEnabled(boolean state)
Control the rendering state. |
void |
setErrorReporter(ErrorReporter reporter)
Register an error reporter with the engine so that any errors generated by the script code can be reported in a nice, pretty fashion. |
void |
setMinimumFrameInterval(int millis,
boolean userSet)
Set the minimum frame interval time to limit the CPU resources taken up by the 3D renderer. |
void |
setSurface(org.j3d.aviatrix3d.pipeline.graphics.GraphicsOutputDevice surface,
DeviceFactory deviceFactory)
Set a new surface to use. |
void |
urlLoadFailed(java.lang.String msg)
The tried to load a URL and failed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String SCRIPT_LOADER_PROP
ScriptLoader interface.
public static final java.lang.String SCRIPT_MANAGER_PROP
ScriptManager interface.
public static final java.lang.String FILE_LOADER_PROP
ContentLoadManager interface.
public static final java.lang.String ROUTER_FACTORY_PROP
RouterFactory interface.
public static final java.lang.String ROUTER_MANAGER_PROP
RouteManager interface.
public static final java.lang.String STATE_MANAGER_PROP
FrameStateManager interface.
public static final java.lang.String SENSOR_MANAGER_PROP
SensorManager interface.
public static final java.lang.String PICKING_MANAGER_PROP
PickingManager interface.
public static final java.lang.String NETWORK_MANAGER_PROP
NetworkManager interface.
public static final java.lang.String HANIM_MANAGER_PROP
public static final java.lang.String PHYSICS_MANAGER_PROP
public static final java.lang.String PARTICLE_MANAGER_PROP
public static final java.lang.String EVENT_MODEL_PROP
EventModelEvaluator interface.
| Constructor Detail |
|---|
public OGLBrowserCanvas(org.j3d.aviatrix3d.pipeline.graphics.GraphicsOutputDevice surface,
DeviceFactory deviceFactory,
BrowserConfig configParams)
surface - The drawing component to usedeviceFactory - The factory for pointing and key sensor
devices associated with the surface.configParams - Browser configuration parameters| Method Detail |
|---|
public void setSurface(org.j3d.aviatrix3d.pipeline.graphics.GraphicsOutputDevice surface,
DeviceFactory deviceFactory)
surface - - The new surface.deviceFactory - - The factory for pointing and key sensor
devices associated with the surface.public void run()
run in interface java.lang.Runnable
public void deviceOver(int type,
java.lang.String desc)
deviceOver in interface SensorStatusListenertype - The sensor typedesc - The sensor's description stringpublic void deviceNotOver(int type)
deviceNotOver in interface SensorStatusListenertype - The sensor typepublic void deviceActivated(int type)
deviceActivated in interface SensorStatusListenertype - The sensor typepublic void linkActivated(java.lang.String[] url_list)
linkActivated in interface SensorStatusListenerurl_list - The url to load.public void browserShutdown()
browserShutdown in interface BrowserCoreListenerpublic void browserDisposed()
browserDisposed in interface BrowserCoreListenerpublic void urlLoadFailed(java.lang.String msg)
urlLoadFailed in interface BrowserCoreListenermsg - An error message to go with the failurepublic void browserInitialized(VRMLScene scene)
browserInitialized in interface BrowserCoreListenerscene - The new scene that has been loadedpublic void initialize()
public void setEnabled(boolean state)
state - true if this should be set to the running state
public void setMinimumFrameInterval(int millis,
boolean userSet)
millis - The minimum time in milleseconds.userSet - true if this is an end-user set minimumpublic void enableRenderPipeline(boolean enable)
enable - - true to connect the pipeline, false to disconnect.public void loadWorld(java.lang.String url)
url - The URL to attempt to loadpublic LayerRenderingManager getLayerRenderingManager()
public ScriptManager getScriptManager()
public ViewpointManager getViewpointManager()
public ContentLoadManager getContentLoadManager()
public RouteManager getRouteManager()
public SensorManager getSensorManager()
public WorldLoaderManager getWorldLoaderManager()
public FrameStateManager getFrameStateManager()
public EventModelEvaluator getEventModelEvaluator()
public OGLStandardBrowserCore getUniverse()
public void setErrorReporter(ErrorReporter reporter)
reporter - The instance to use or null
|
Xj3D 2.0 VRML/X3D Code API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||