Aviatrix3D
2.1.0

org.j3d.aviatrix3d.management
Class SingleDisplayCollection

java.lang.Object
  extended by org.j3d.aviatrix3d.management.DisplayCollection
      extended by org.j3d.aviatrix3d.management.SingleDisplayCollection

public class SingleDisplayCollection
extends DisplayCollection

Display collection that manages just a single set of audio + graphics pipeline and a single output surface.

Version:
$Revision: 1.9 $
Author:
Justin Couch

Field Summary
 
Fields inherited from class org.j3d.aviatrix3d.management.DisplayCollection
ACTIVE_RENDERING_MSG, deletionList, enabled, errorReporter, LAYER_SET_SIZE_ERR, LAYER_TIMING_MSG, numDeletables, numShaderInit, numShaderLog, shaderInitList, shaderLogList, terminate, writeEnabled
 
Constructor Summary
SingleDisplayCollection()
          Create a new instance of this collection with no pipelines preset.
SingleDisplayCollection(GraphicsRenderPipeline graphicsPipe)
          Constructs a new collection for a single channel
SingleDisplayCollection(GraphicsRenderPipeline graphicsPipe, AudioRenderPipeline audioPipe)
          Constructs a new collection for a single channel based on the give audio and graphics pipelines.
 
Method Summary
 void addPipeline(RenderPipeline pipe)
          Add a pipeline to be rendered to the manager.
 boolean displayOnly()
          Cause the surface to redraw the next frame only, with no processing of the pipeline.
 void getLayers(Layer[] layers)
          Fetch the current layers that are set.
 void halt()
          Force a halt of the current processing.
 boolean isDisposed()
          Check to see if this pipeline is now inoperable.
 boolean isEnabled()
          Get the current render state of the manager.
 int numLayers()
          Get the number of layers that are currently set.
 boolean process()
          Force a single render of all pipelines now contained in this collection now.
 void removePipeline(RenderPipeline pipe)
          Remove an already registered pipeline from the manager.
 void setEnabled(boolean state)
          Tell render to start or stop management.
 void setErrorReporter(org.j3d.util.ErrorReporter reporter)
          Register an error reporter with the engine so that any errors generated by the node's internals can be reported in a nice, pretty fashion.
 void setLayers(Layer[] layers, int numLayers)
          Set the set of layers for this manager.
protected  void setUpdateHandler(NodeUpdateHandler handler)
          Set the update handler that controls synchronisations of write/read process to the scene graph.
 void shutdown()
          Notification to shutdown the internals of the renderer because the application is about to exit.
 
Methods inherited from class org.j3d.aviatrix3d.management.DisplayCollection
enableLayerChange, queueDeletedObjects, queueShaderObjects
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleDisplayCollection

public SingleDisplayCollection()
Create a new instance of this collection with no pipelines preset.


SingleDisplayCollection

public SingleDisplayCollection(GraphicsRenderPipeline graphicsPipe)
Constructs a new collection for a single channel

Parameters:
graphicsPipe - The graphics pipeline instance to be used

SingleDisplayCollection

public SingleDisplayCollection(GraphicsRenderPipeline graphicsPipe,
                               AudioRenderPipeline audioPipe)
Constructs a new collection for a single channel based on the give audio and graphics pipelines.

Parameters:
graphicsPipe - The graphics pipeline instance to be used
Method Detail

setErrorReporter

public void setErrorReporter(org.j3d.util.ErrorReporter reporter)
Register an error reporter with the engine so that any errors generated by the node's internals can be reported in a nice, pretty fashion. Setting a value of null will clear the currently set reporter. If one is already set, the new value replaces the old.

Overrides:
setErrorReporter in class DisplayCollection
Parameters:
reporter - The instance to use or null

setEnabled

public void setEnabled(boolean state)
Tell render to start or stop management. If currently running, it will wait until all the pipelines have completed their current cycle and will then halt.

Overrides:
setEnabled in class DisplayCollection
Parameters:
state - True if to enable management

isEnabled

public boolean isEnabled()
Get the current render state of the manager.

Overrides:
isEnabled in class DisplayCollection
Returns:
true if the manager is currently running

process

public boolean process()
Force a single render of all pipelines now contained in this collection now. Blocks until all rendering is complete (based on the definition of the implementing class).

In general, it is inadvisable that method be called by end users as it is normally managed by the RenderManager. The return value indicates success or failure in the ability to render this frame. Typically it will indicate failure if the underlying surface has been disposed of, either directly through the calling of the method on this interface, or through an internal check mechanism. If failure is indicated, then check to see if the surface has been disposed of and discontinue rendering if it has.

Specified by:
process in class DisplayCollection
Returns:
true if the drawing succeeded, or false if not

displayOnly

public boolean displayOnly()
Cause the surface to redraw the next frame only, with no processing of the pipeline. This is typically an optimisation step when nothing has changed in user land, so there's no processing that needs to be done. Skip the processing and tell the drawable surface to render again what it already has set from the previous frame.

The return value indicates success or failure in the ability to render this frame. Typically it will indicate failure if the underlying surface has been disposed of, either directly through the calling of the method on this interface, or through an internal check mechanism. If failure is indicated, then check to see if the surface has been disposed of and discontinue rendering if it has.

Specified by:
displayOnly in class DisplayCollection
Returns:
true if the drawing succeeded, or false if not

halt

public void halt()
Force a halt of the current processing. Any processing in progress should exit immediately. Used to abort the current scene processing due to application shutdown or complete scene replacement.

Specified by:
halt in class DisplayCollection

setLayers

public void setLayers(Layer[] layers,
                      int numLayers)
               throws java.lang.IllegalArgumentException,
                      InvalidWriteTimingException
Set the set of layers for this manager. Setting a value of null will remove the currently set of layers. If this is set while a current scene is set, then the scene will be cleared. Layers are presented in depth order - layers[0] is rendered before layers[1] etc.

If this render manager is currently running, this method can only be called during the main update

Specified by:
setLayers in class DisplayCollection
Parameters:
layers - The collection of layers, in order, to render
numLayers - The number of valid layers to use
Throws:
java.lang.IllegalArgumentException - The length of the layers array is less than numLayers
InvalidWriteTimingException - The method was called with the system enabled and not during the app observer callback

numLayers

public int numLayers()
Get the number of layers that are currently set. If no layers are set, or a scene is set, this will return zero.

Specified by:
numLayers in class DisplayCollection
Returns:
a value greater than or equal to zero

getLayers

public void getLayers(Layer[] layers)
Fetch the current layers that are set. The values will be copied into the user-provided array. That array must be at least numLayers() in length. If not, this method does nothing (the provided array will be unchanged).

Specified by:
getLayers in class DisplayCollection
Parameters:
layers - An array to copy the values into

addPipeline

public void addPipeline(RenderPipeline pipe)
                 throws java.lang.IllegalStateException
Add a pipeline to be rendered to the manager. A duplicate registration or null value is ignored.

Specified by:
addPipeline in class DisplayCollection
Parameters:
pipe - The new pipe instance to be added
Throws:
java.lang.IllegalStateException - The system is currently management and should be disabled first.

removePipeline

public void removePipeline(RenderPipeline pipe)
                    throws java.lang.IllegalStateException
Remove an already registered pipeline from the manager. A or null value or one that is not currently registered is ignored.

Specified by:
removePipeline in class DisplayCollection
Parameters:
pipe - The pipe instance to be removed
Throws:
java.lang.IllegalStateException - The system is currently management and should be disabled first.

setUpdateHandler

protected void setUpdateHandler(NodeUpdateHandler handler)
Set the update handler that controls synchronisations of write/read process to the scene graph.

Specified by:
setUpdateHandler in class DisplayCollection
Parameters:
handler - The new handler instance to use

shutdown

public void shutdown()
Notification to shutdown the internals of the renderer because the application is about to exit. Normally this will be called by the containing RenderManager and should not need to be called by end users.

Overrides:
shutdown in class DisplayCollection

isDisposed

public boolean isDisposed()
Check to see if this pipeline is now inoperable. It may be inoperable for one of many reasons, such as the output device is terminated, user terminated or some abnormal internal condition.

Overrides:
isDisposed in class DisplayCollection
Returns:
true if the collection is no longer operable

Aviatrix3D
2.1.0

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