Aviatrix3D
2.1.0

org.j3d.aviatrix3d
Class Scene2D

java.lang.Object
  extended by org.j3d.aviatrix3d.SceneGraphObject
      extended by org.j3d.aviatrix3d.Scene
          extended by org.j3d.aviatrix3d.Scene2D

public class Scene2D
extends Scene

Representation of the top level structure of a piece of scene graph that can form a coherent rendering in 2D.

A 2D scene has a fixed view environment that is not editable by the end users. The viewpoint is required to be an ortho viewport and is constructed so that a OpenGL value of 1.0 corresponds to a single pixel. The viewpoint continually updates its ortho params based on the viewport size. Note that although a viewpoint is specified here, all the parameters of it are ignored. All we use is the transformation information from the root of scene graph to this viewpoint location in order to know where to place the view information in 2D space (ie it provides the ability to pan and zoom.

Internationalisation Resource Names

Version:
$Revision: 2.4 $
Author:
Justin Couch

Field Summary
 
Fields inherited from class org.j3d.aviatrix3d.Scene
processor, viewEnvironment
 
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler
 
Constructor Summary
Scene2D()
          Create a default instance of this scene with no content provided.
 
Method Summary
 Background getActiveBackground()
          Get the currently set active background.
 Viewpoint getActiveView()
          Get the currently set active view.
 Group getRenderedGeometry()
          Get the root of the currently rendered scene.
 void setActiveBackground(Background bg)
          Set the background path that should be applied to the current surface.
 void setActiveView(Viewpoint vp)
          Set the viewpoint path that should be applied to the current surface.
protected  void setLive(boolean state)
          Notification that this object is live now.
 void setRenderedGeometry(Group geom)
          Set the collection of geometry that should be rendered to this texture.
protected  void setUpdateHandler(NodeUpdateHandler handler)
          Set the scenegraph update handler for this node.
 
Methods inherited from class org.j3d.aviatrix3d.Scene
getRenderEffectsProcessor, getViewEnvironment, setRenderEffectsProcessor
 
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject
checkForCyclicChild, checkForCyclicParent, dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Scene2D

public Scene2D()
Create a default instance of this scene with no content provided.

Method Detail

setLive

protected void setLive(boolean state)
Notification that this object is live now. Overridden to make sure that the live state of the nodes represents the same state as the parent scene graph.

Overrides:
setLive in class Scene
Parameters:
state - true if this should be marked as live now

setUpdateHandler

protected void setUpdateHandler(NodeUpdateHandler handler)
Set the scenegraph update handler for this node. It will notify all its children of the value. A null value will clear the current handler.

Overrides:
setUpdateHandler in class Scene
Parameters:
handler - The instance to use as a handler

setRenderedGeometry

public void setRenderedGeometry(Group geom)
                         throws InvalidWriteTimingException
Set the collection of geometry that should be rendered to this texture. A null value will clear the current geometry and result in only rendering the background, if set. if not set, then whatever the default colour is, is used (typically black).

Parameters:
geom - The new geometry to use or null
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the ApplicationUpdateObserver callback method

getRenderedGeometry

public Group getRenderedGeometry()
Get the root of the currently rendered scene. If none is set, this will return null.

Returns:
The current scene root or null.

setActiveView

public void setActiveView(Viewpoint vp)
                   throws InvalidWriteTimingException,
                          java.lang.IllegalArgumentException
Set the viewpoint path that should be applied to the current surface. The output drawn will be a combination of this information and that of the view environment.

Parameters:
vp - The instance of the active viewpoint to use
Throws:
java.lang.IllegalArgumentException - The path contains a SharedGroup or the node is not live
InvalidWriteTimingException - An attempt was made to write outside of the ApplicationUpdateObserver callback method

getActiveView

public Viewpoint getActiveView()
Get the currently set active view. If none is set, return null.

Returns:
The current view instance or null

setActiveBackground

public void setActiveBackground(Background bg)
                         throws InvalidWriteTimingException,
                                java.lang.IllegalArgumentException
Set the background path that should be applied to the current surface. The output drawn will be a combination of this information and that of the view environment.

Parameters:
bg - The instance of the active background
Throws:
java.lang.IllegalArgumentException - The path contains a SharedGroup or the node is not live
InvalidWriteTimingException - An attempt was made to write outside of the ApplicationUpdateObserver callback method

getActiveBackground

public Background getActiveBackground()
Get the currently set active background. If none is set, return null.

Returns:
The current view instance or null

Aviatrix3D
2.1.0

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - 2009 j3d.org