Aviatrix3D
2.1.0

org.j3d.aviatrix3d
Class MultipassScene

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

public class MultipassScene
extends Scene
implements SceneCullable

Representation of the top level structure of a piece of scene graph that permits multipass rendering to be performed.

A multipass scene consists of a set of consecutive rendering passes over a single set of buffers. Buffers may or may not be cleared on each pass, depending on the buffer state attributes that are set. The end result is a single image that forms the content of a layer.

A multipass scene has a single background node that is rendered at the start of the first pass and not applied to any other passes. Fog and viewpoints are applied on a per-pass basis.

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
MultipassScene()
          Create a default instance of this scene with no content provided.
 
Method Summary
 void addRenderPass(RenderPass pass)
          Add a new pass to the end of the current rendering list.
 Background getActiveBackground()
          Get the currently set active view.
 RenderPassCullable getCullablePass(int passIndex)
          Get the cullable layer child that for the given layer index.
 RenderPass getRenderPass(int passNumber)
          Get the render pass at the given pass number.
 void getRenderPasses(RenderPass[] passes)
          Get all the render passes currently registered.
 ViewEnvironmentCullable getViewCullable()
          Get the primary view environment information.
 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.
 int numRenderPasses()
          Request the number of rendering passes currently registered with this scene.
 void removeRenderPass(int passNumber)
          Remove the render pass at the given index.
 void setActiveBackground(Background bg)
          Set the background path that should be applied to the current surface.
protected  void setLive(boolean state)
          Notification that this object is live now.
 void setRenderPass(int passNumber, RenderPass pass)
          Replace the render pass at the given index with a different pass representation.
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
 

Constructor Detail

MultipassScene

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

Method Detail

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

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 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

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

addRenderPass

public void addRenderPass(RenderPass pass)
                   throws InvalidWriteTimingException,
                          java.lang.IllegalArgumentException
Add a new pass to the end of the current rendering list.

Parameters:
pass - The rendering pass description to use
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the ApplicationUpdateObserver callback method
java.lang.IllegalArgumentException - The object passed was null

setRenderPass

public void setRenderPass(int passNumber,
                          RenderPass pass)
                   throws InvalidWriteTimingException,
                          java.lang.IllegalArgumentException
Replace the render pass at the given index with a different pass representation.

Parameters:
passNumber - The index of the pass to return, zero based
pass - The rendering pass description to use
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the ApplicationUpdateObserver callback method
java.lang.IllegalArgumentException - The index is out of range or the pass object was null

removeRenderPass

public void removeRenderPass(int passNumber)
                      throws InvalidWriteTimingException,
                             java.lang.IllegalArgumentException
Remove the render pass at the given index.

Parameters:
passNumber - The index of the pass to return, zero based
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the ApplicationUpdateObserver callback method
java.lang.IllegalArgumentException - The index is out of range

getRenderPass

public RenderPass getRenderPass(int passNumber)
                         throws java.lang.IllegalArgumentException
Get the render pass at the given pass number.

Parameters:
passNumber - The index of the pass to return, zero based
Returns:
The pass container at the given index
Throws:
java.lang.IllegalArgumentException - The index is out of range

getRenderPasses

public void getRenderPasses(RenderPass[] passes)
                     throws java.lang.IllegalArgumentException
Get all the render passes currently registered.

Parameters:
passes - An array to copy everything into
Throws:
java.lang.IllegalArgumentException - The index is out of range

numRenderPasses

public int numRenderPasses()
Request the number of rendering passes currently registered with this scene.

Returns:
A non-negative value

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 view. 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