Aviatrix3D
2.1.0

org.j3d.aviatrix3d
Class SimpleScene

java.lang.Object
  extended by org.j3d.aviatrix3d.SceneGraphObject
      extended by org.j3d.aviatrix3d.Scene
          extended by org.j3d.aviatrix3d.SimpleScene
All Implemented Interfaces:
Cullable, RenderPassCullable, SceneCullable

public class SimpleScene
extends Scene
implements SceneCullable, RenderPassCullable

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

A scene encapsulates a viewpoint that is used to view the scene from, the geometry structure to render, data defining the view environment (eg projection type) and global data, such as the background, global fog etc.

Internationalisation Resource Names

Version:
$Revision: 2.10 $
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
SimpleScene()
          Create a default instance of this scene with no content provided.
 
Method Summary
 BufferStateRenderable getAccumBufferRenderable()
          Fetch renderable information about the accumulation buffer.
 Background getActiveBackground()
          Get the currently set active background.
 Fog getActiveFog()
          Get the currently set active fog.
 Viewpoint getActiveView()
          Get the currently set active view.
 EnvironmentCullable getBackgroundCullable()
          Get the cullable object representing the active background that in this environment.
 BufferStateRenderable getColorBufferRenderable()
          Fetch renderable information about the colour buffer.
 RenderPassCullable getCullablePass(int passIndex)
          Get the cullable layer child that for the given layer index.
 BufferStateRenderable getDepthBufferRenderable()
          Fetch renderable information about the depth buffer.
 LeafCullable getFogCullable()
          Get the cullable object representing the active fog in this environment.
 BufferStateRenderable getGeneralBufferRenderable()
          Fetch renderable information about the general buffer.
 Group getRenderedGeometry()
          Get the root of the currently rendered scene.
 Cullable getRootCullable()
          Get the primary cullable that represents the root of the scene graph.
 BufferStateRenderable getStencilBufferRenderable()
          Fetch renderable information about the stencil buffer.
 ViewEnvironmentCullable getViewCullable()
          Get the primary view environment information.
 EnvironmentCullable getViewpointCullable()
          Get the cullable object representing the active viewpoint that in this environment.
 ViewportRenderable getViewportRenderable()
          Fetch the renderable used to control the viewport setting.
 boolean is2D()
          Check to see if this represents a 2D scene that has no 3D rendering capabilities.
 boolean isAudioSource()
          Check to see if this render pass is the one that also has the spatialised audio to be rendered for this frame.
 boolean isEnabled()
          Check to see if this render pass is valid to render for this frame.
 boolean isMultipassScene()
          Check to see if this is a multipass cullable or single pass.
 int numCullableChildren()
          Returns the number of valid cullable rendering passes to process.
 void setActiveBackground(Background bg)
          Set the background path that should be applied to the current surface.
 void setActiveFog(Fog fog)
          Set the fog 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
 
Methods inherited from interface org.j3d.aviatrix3d.rendering.SceneCullable
getRenderEffectsProcessor, getUserData
 
Methods inherited from interface org.j3d.aviatrix3d.rendering.RenderPassCullable
getUserData
 

Constructor Detail

SimpleScene

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

Method Detail

isEnabled

public boolean isEnabled()
Check to see if this render pass is valid to render for this frame. Simple scenes cannot be disabled.

Specified by:
isEnabled in interface RenderPassCullable
Returns:
true always

isMultipassScene

public boolean isMultipassScene()
Check to see if this is a multipass cullable or single pass.

Specified by:
isMultipassScene in interface SceneCullable
Returns:
true if this is a multipass cullable

isAudioSource

public boolean isAudioSource()
Check to see if this render pass is the one that also has the spatialised audio to be rendered for this frame. If this is a multipass layer then there is must return false and potentially one of the render passes will be the active audio source. See the package documentation for more information about how this state is managed.

Specified by:
isAudioSource in interface RenderPassCullable
Returns:
true if this is the source that should be rendered this this frame.

getViewCullable

public ViewEnvironmentCullable getViewCullable()
Get the primary view environment information. This applies to the whole scene before any multipass processing is done. If this is a multipass scene, the frustum information is ignored as each pass applies separately.

Specified by:
getViewCullable in interface RenderPassCullable
Specified by:
getViewCullable in interface SceneCullable

getCullablePass

public RenderPassCullable getCullablePass(int passIndex)
Get the cullable layer child that for the given layer index. For a single pass scene this represents everything about the scene to be rendered. The view environment of this scene is the same as that of the first render pass.

Specified by:
getCullablePass in interface SceneCullable
Parameters:
passIndex - The index of the pass to fetch
Returns:
The layer cullable at the given index or null

numCullableChildren

public int numCullableChildren()
Returns the number of valid cullable rendering passes to process. In a single pass scene return 1.

Specified by:
numCullableChildren in interface SceneCullable
Returns:
A number greater than or equal to zero

is2D

public boolean is2D()
Check to see if this represents a 2D scene that has no 3D rendering capabilities. A purely 2D scene sets up the view environment quite different to a full 3D scene.

Specified by:
is2D in interface RenderPassCullable
Returns:
true if this is a 2D scene rather than a 3D version

getViewpointCullable

public EnvironmentCullable getViewpointCullable()
Get the cullable object representing the active viewpoint that in this environment.

Specified by:
getViewpointCullable in interface RenderPassCullable
Returns:
The viewpoint renderable to use

getBackgroundCullable

public EnvironmentCullable getBackgroundCullable()
Get the cullable object representing the active background that in this environment. If no background is set, this will return null.

Specified by:
getBackgroundCullable in interface RenderPassCullable
Returns:
The background renderable to use

getFogCullable

public LeafCullable getFogCullable()
Get the cullable object representing the active fog in this environment. If no fog is set or this is a pass in a multipass rendering, this will return null. If the underlying fog node is currently disabled or not labeled as global, then this method should return null.

Specified by:
getFogCullable in interface RenderPassCullable
Returns:
The fog renderable to use

getRootCullable

public Cullable getRootCullable()
Get the primary cullable that represents the root of the scene graph. If this is a multipass cullable, this should return null.

Specified by:
getRootCullable in interface RenderPassCullable

getViewportRenderable

public ViewportRenderable getViewportRenderable()
Fetch the renderable used to control the viewport setting. If the default environment is to be used, this will return null.

Specified by:
getViewportRenderable in interface RenderPassCullable
Returns:
A renderable instance if custom viewport handling is need or null if not

getGeneralBufferRenderable

public BufferStateRenderable getGeneralBufferRenderable()
Fetch renderable information about the general buffer. If this is a single pass scene, this will return null.

Specified by:
getGeneralBufferRenderable in interface RenderPassCullable
Returns:
The state representation for the general buffer

getColorBufferRenderable

public BufferStateRenderable getColorBufferRenderable()
Fetch renderable information about the colour buffer. If this is a single pass scene, this will return null.

Specified by:
getColorBufferRenderable in interface RenderPassCullable
Returns:
Null always as this is a single pass scene

getDepthBufferRenderable

public BufferStateRenderable getDepthBufferRenderable()
Fetch renderable information about the depth buffer. If this is a single pass scene, this will return null.

Specified by:
getDepthBufferRenderable in interface RenderPassCullable
Returns:
Null always as this is a single pass scene

getStencilBufferRenderable

public BufferStateRenderable getStencilBufferRenderable()
Fetch renderable information about the stencil buffer. If this is a single pass scene, this will return null.

Specified by:
getStencilBufferRenderable in interface RenderPassCullable
Returns:
Null always as this is a single pass scene

getAccumBufferRenderable

public BufferStateRenderable getAccumBufferRenderable()
Fetch renderable information about the accumulation buffer. If this is a single pass scene, this will return null.

Specified by:
getAccumBufferRenderable in interface RenderPassCullable
Returns:
Null always as this is a single pass scene

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

setActiveFog

public void setActiveFog(Fog fog)
                  throws InvalidWriteTimingException,
                         java.lang.IllegalArgumentException
Set the fog 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:
fog - The instance of the active fog node
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

getActiveFog

public Fog getActiveFog()
Get the currently set active fog. 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