Class dnx.lr.Scene
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class dnx.lr.Scene

java.lang.Object
   |
   +----dnx.util.DNXObject
           |
           +----dnx.util.DNXInstancedObject
                   |
                   +----dnx.util.DNXJavaStyleObservable
                           |
                           +----dnx.lr.Scene

public class Scene
extends DNXJavaStyleObservable
The "Scene" holds a scene graph. This is sort of the "master" object for the VRML world. A scene contains Node objects describing what's in the scene; however, each node object contains a SceneContext backpointer rather than a Scene backpointer. The SceneContext is a sanitized version of the Scene; this allows nodes to do only the operations on a Scene that they're "supposed to" do. A Scene is an DNXObservable in the sense that certain global scene changes (SceneObserverEvents) can get noticed by the registered observers. For example, if one of the Nodes requests that the NavigationInfo be changed, the Scene will generate a SceneObserverEvent and propagate it to any observers, e.g. a browser, which will change the viewer between walk, fly, examine, etc.

Variable Index

 o DELIVER_EVENTS_PASS
 o FRAME_UPDATE_PASS
 o GLOBAL_PASS
 o NO_PASS
 o RECONCILE_VIEW_POSITIONS_PASS
 o REDISPLAY_PASS

Constructor Index

 o Scene()
 o Scene(ReadAction)
 o Scene(ReadAction, boolean)
Read in and create a new scene.
 o Scene(SceneContents)
Create a live scene from a SceneContents object (a 'frozen' scene) The SceneContents is not copied.
 o Scene(SceneContents, boolean)
Create a live scene from a SceneContents object (a 'frozen' scene) The SceneContents is not copied.

Method Index

 o addRoute(Route)
 o addSyncNode(Node)
Sync nodes are nodes that get a synchronization event after all normal events have been processed.
 o addTimeSensor(Node)
 o addTopLevelNode(Node)
 o areEventsEnabled()
Return whether event delivery is enabled.
 o beginFrame(long)
 o beginFrameUpdate()
 o beginGlobalPass()
 o beginReconcileViewPositions()
 o beginRedisplay()
 o bindNode(Node)
Same as bindNodeInstance (node.getUniquifiedInstance()).
 o bindNodeInstance(NodeInstance)
Bind a node instance.
 o countTopLevelNodes()
Return the number of top-level nodes.
 o debugPrint()
 o deleteAllTopLevelNodes()
 o deleteRoute(Route)
 o deleteTopLevelNode(Node)
 o deliverEvents()
Process all queued up events.
 o disableEvents()
Disable event delivery.
 o discardEvents()
Throw out any pending events.
 o doGlobalPass(RenderState)
 o enableEvents()
Enable event delivery.
 o endFrame()
 o endFrameUpdate()
 o endGlobalPass()
 o endReconcileViewPositions()
 o endRedisplay()
 o enumerateNodesByName(String)
Return an enumeration of all nodes in the main scene context with the given name.
 o firstNodeWithName(String)
Return a node in the main scene context the given name, if such a node exists.
 o getBoundNodeInstance(Class)
Get the currently bound node instance of a specified type; returns null if no node of that type is bound.
 o getBoundNodeInstance(String)
Get the currently bound node of a specified type (e.g.
 o getCurrentFrameRate()
Return the current frame rate (in frames/second), if known (otherwise 0).
 o getCurrentPass()
 o getCurrentSpeed()
Return the speed at which the viewpoint is moving (in meters/second), if known (otherwise 0).
 o getMediaFetcher()
Get the currently installed media fetcher.
 o getRootNode()
Return the root node of the scene -- self explanatory.
 o getRootNodeInstance()
Return the root node instance of the scene -- self explanatory.
 o getRoute(Node, int, Node, int)
 o getSceneContext()
Return the scene context corresponding to this scene.
 o getSceneURL()
Return the URL from which the scene was described.
 o getTime()
Return the current time in the scene.
 o getWorldInfo()
Return an array of information strings; returns null if there is no info.
 o getWorldName()
Get the name of the world described by the scene; it will have been set using setWorldName.
 o hasFakeGroupRootNode()
 o inFrame()
Return whether we are currently processing a scene frame.
 o isBound(Node)
See if a node is bound (i.e.
 o isBound(NodeInstance)
See if a node instance is bound (i.e.
 o isOnBindingStack(Node)
See if an instance of a node is somewhere on its respective binding stack.
 o isOnBindingStack(NodeInstance)
See if a node instance is somewhere on its respective binding stack.
 o isStopped()
Return whether the scene has been stopped with stop().
 o print(PrintAction)
Print out the scene.
 o processEvents()
 o processSyncNodes()
 o processTimeSensors(double)
 o queueBypassingEvent(Field, Node, int)
Queue a "bypassing" event to be delivered to a node.
 o removeSyncNode(Node)
 o removeTimeSensor(Node)
 o resetTime()
Reset the time to zero.
 o resetTime(double)
Reset the time to a specified value.
 o restart()
Restart a scene; calls the restart() method on the nodes in the scene.
 o setMediaFetcher(MediaFetcher)
Set the media fetcher for the scene; the media fetcher is an interface used by nodes to get image, audio, and other media.
 o setRootFromContents()
 o setWorldInfo(String[])
Set the world information strings.
 o setWorldName(String)
Set the name of the world described by the scene; this is called from a WorldInfo node.
 o stop()
Stop a scene; calls the stop() method on the nodes in the scene.
 o swapQueues()
 o unbindNode(Node)
Unbind a node.
 o updateObservers(Object)

Variables

 o NO_PASS
  public final static int NO_PASS
 o FRAME_UPDATE_PASS
  public final static int FRAME_UPDATE_PASS
 o RECONCILE_VIEW_POSITIONS_PASS
  public final static int RECONCILE_VIEW_POSITIONS_PASS
 o GLOBAL_PASS
  public final static int GLOBAL_PASS
 o DELIVER_EVENTS_PASS
  public final static int DELIVER_EVENTS_PASS
 o REDISPLAY_PASS
  public final static int REDISPLAY_PASS

Constructors

 o Scene
  public Scene()
 o Scene
  public Scene(ReadAction a,
               boolean setRoot) throws MalformedURLException, IOException, VRMLSyntaxException
Read in and create a new scene. The ReadAction specifies where to read the VRML from, and can come from any of a number of sources (URL, input stream, etc.). @see ReadAction
 o Scene
  public Scene(ReadAction a) throws MalformedURLException, IOException, VRMLSyntaxException
 o Scene
  public Scene(SceneContents contents)
Create a live scene from a SceneContents object (a 'frozen' scene) The SceneContents is not copied.
 o Scene
  public Scene(SceneContents contents,
               boolean setRoot)
Create a live scene from a SceneContents object (a 'frozen' scene) The SceneContents is not copied. If setRoot is false, don't actually set the root node yet. (Setting the root node causes various SceneObserverEvents to get sent out, and you may want to set things up after creating the scene so that these events can be properly processed.)

Methods

 o updateObservers
  public void updateObservers(Object obj)
Overrides:
updateObservers in class DNXJavaStyleObservable
 o enableEvents
  public void enableEvents()
Enable event delivery.
 o disableEvents
  public void disableEvents()
Disable event delivery.
 o areEventsEnabled
  public boolean areEventsEnabled()
Return whether event delivery is enabled.
 o setMediaFetcher
  public void setMediaFetcher(MediaFetcher m)
Set the media fetcher for the scene; the media fetcher is an interface used by nodes to get image, audio, and other media.
 o getMediaFetcher
  public MediaFetcher getMediaFetcher()
Get the currently installed media fetcher.
 o getSceneContext
  public SceneContext getSceneContext()
Return the scene context corresponding to this scene.
 o setRootFromContents
  public void setRootFromContents()
 o getRootNode
  public Node getRootNode()
Return the root node of the scene -- self explanatory.
 o getRootNodeInstance
  public NodeInstance getRootNodeInstance()
Return the root node instance of the scene -- self explanatory.
 o addTopLevelNode
  public void addTopLevelNode(Node node)
 o deleteAllTopLevelNodes
  public void deleteAllTopLevelNodes()
 o deleteTopLevelNode
  public void deleteTopLevelNode(Node node)
 o countTopLevelNodes
  public int countTopLevelNodes()
Return the number of top-level nodes.
 o hasFakeGroupRootNode
  public boolean hasFakeGroupRootNode()
 o getWorldName
  public String getWorldName()
Get the name of the world described by the scene; it will have been set using setWorldName.
 o getWorldInfo
  public String[] getWorldInfo()
Return an array of information strings; returns null if there is no info.
 o setWorldName
  public void setWorldName(String name)
Set the name of the world described by the scene; this is called from a WorldInfo node.
 o setWorldInfo
  public void setWorldInfo(String info[])
Set the world information strings.
 o getCurrentSpeed
  public float getCurrentSpeed()
Return the speed at which the viewpoint is moving (in meters/second), if known (otherwise 0).
 o getCurrentFrameRate
  public float getCurrentFrameRate()
Return the current frame rate (in frames/second), if known (otherwise 0).
 o getSceneURL
  public URL getSceneURL()
Return the URL from which the scene was described. This can be null (i.e. the scene came from a generic InputStream).
 o isBound
  public synchronized boolean isBound(NodeInstance inst)
See if a node instance is bound (i.e. on the top of its respective binding stack).
 o isOnBindingStack
  public synchronized boolean isOnBindingStack(NodeInstance inst)
See if a node instance is somewhere on its respective binding stack.
 o isBound
  public synchronized boolean isBound(Node node)
See if a node is bound (i.e. an instance of it is on the top of its respective binding stack).
 o isOnBindingStack
  public synchronized boolean isOnBindingStack(Node node)
See if an instance of a node is somewhere on its respective binding stack.
 o bindNodeInstance
  public synchronized void bindNodeInstance(NodeInstance inst)
Bind a node instance.
 o bindNode
  public void bindNode(Node node)
Same as bindNodeInstance (node.getUniquifiedInstance()).
 o unbindNode
  public synchronized boolean unbindNode(Node node)
Unbind a node. Returns true if the node was previously at the top of its binding stack. (There is no unbindNodeInstance() because its semantics could not be defined consistently given the VRML 2.0 spec's bindable-node behavior. If you want to remove the node instance at the top of the stack, call getActualNode() and then call unbindNode() on the result.)
 o getBoundNodeInstance
  public synchronized NodeInstance getBoundNodeInstance(Class nodeClass)
Get the currently bound node instance of a specified type; returns null if no node of that type is bound.
 o getBoundNodeInstance
  public synchronized NodeInstance getBoundNodeInstance(String nodeTypeName)
Get the currently bound node of a specified type (e.g. "NavigationInfo", "Fog"); returns null if no node of that type is bound.
 o restart
  public void restart()
Restart a scene; calls the restart() method on the nodes in the scene.
 o stop
  public void stop()
Stop a scene; calls the stop() method on the nodes in the scene.
 o isStopped
  public boolean isStopped()
Return whether the scene has been stopped with stop().
 o firstNodeWithName
  public Node firstNodeWithName(String name)
Return a node in the main scene context the given name, if such a node exists. Note that there may be more than one node with the same name; use enumerateNodesByName() if you want all of them. Note also that this will not return nodes in sub-contexts (e.g. inside of loaded inlines or in prototypes).
 o enumerateNodesByName
  public Enumeration enumerateNodesByName(String name)
Return an enumeration of all nodes in the main scene context with the given name. Note that this will not return nodes in sub-contexts (e.g. inside of loaded inlines or in prototypes).
 o print
  public void print(PrintAction a)
Print out the scene. This prints out the root node and subgraph thereof, and any prototypes and routes.
 o debugPrint
  public void debugPrint()
 o beginFrame
  public void beginFrame(long time)
 o endFrame
  public void endFrame()
 o beginFrameUpdate
  public void beginFrameUpdate()
 o endFrameUpdate
  public void endFrameUpdate()
 o beginReconcileViewPositions
  public void beginReconcileViewPositions()
 o endReconcileViewPositions
  public void endReconcileViewPositions()
 o beginGlobalPass
  public void beginGlobalPass()
 o endGlobalPass
  public void endGlobalPass()
 o beginRedisplay
  public void beginRedisplay()
 o endRedisplay
  public void endRedisplay()
 o doGlobalPass
  public void doGlobalPass(RenderState state)
 o deliverEvents
  public synchronized void deliverEvents()
Process all queued up events. Called at the end of each render/process-events cycle. (When executing a VRML world in a browser, we continually loop through this cycle.) The times passed to the frame call must be in non-decreasing order; resetTime() may be used to 'replay' a scene.
 o discardEvents
  public synchronized void discardEvents()
Throw out any pending events.
 o resetTime
  public synchronized void resetTime(double time)
Reset the time to a specified value.
 o resetTime
  public synchronized void resetTime()
Reset the time to zero.
 o getTime
  public synchronized double getTime()
Return the current time in the scene. The current time is the argument of the last frame() or resetTime() call.
 o inFrame
  public boolean inFrame()
Return whether we are currently processing a scene frame. The frame time is returned by calling getTime().
 o getCurrentPass
  public int getCurrentPass()
 o addRoute
  public void addRoute(Route r)
 o deleteRoute
  public void deleteRoute(Route r)
 o getRoute
  public Route getRoute(Node from,
                        int eventOut,
                        Node to,
                        int eventIn)
 o addTimeSensor
  public void addTimeSensor(Node node)
 o removeTimeSensor
  public void removeTimeSensor(Node node)
 o processTimeSensors
  public void processTimeSensors(double time)
 o queueBypassingEvent
  public void queueBypassingEvent(Field value,
                                  Node node,
                                  int eventIn)
Queue a "bypassing" event to be delivered to a node. This event bypasses routes and delivers directly to a particular node. This exists to support some bogus aspects of the Script interface.
 o addSyncNode
  public void addSyncNode(Node node)
Sync nodes are nodes that get a synchronization event after all normal events have been processed. See processEvents()
 o removeSyncNode
  public void removeSyncNode(Node node)
 o processSyncNodes
  public void processSyncNodes()
 o processEvents
  protected void processEvents()
 o swapQueues
  protected synchronized void swapQueues()

All Packages  Class Hierarchy  This Package  Previous  Next  Index