Aviatrix3D
2.1.0

org.j3d.aviatrix3d.pipeline.graphics
Class DefaultGraphicsPipeline

java.lang.Object
  extended by org.j3d.aviatrix3d.pipeline.graphics.DefaultGraphicsPipeline
All Implemented Interfaces:
GraphicsRenderPipeline, RenderPipeline

public class DefaultGraphicsPipeline
extends java.lang.Object
implements GraphicsRenderPipeline

The default implementation of the rendering pipeline usable by most applications.

This implementation is targeted towards single threaded architectures. After setting the stages, the render command will not return until everything is complete.

Version:
$Revision: 3.10 $
Author:
Justin Couch

Constructor Summary
DefaultGraphicsPipeline()
          Create an instance of the pipeline with nothing registered.
DefaultGraphicsPipeline(GraphicsCullStage cs, GraphicsSortStage ss)
          Construct a pipeline with the sort and cull stages provided.
 
Method Summary
 boolean displayOnly()
          Cause the surface to redraw the next frame only, with no processing of the pipeline.
 GraphicsOutputDevice getGraphicsOutputDevice()
          Get the currently registered drawable surface instance.
 void halt()
          Force a halt of the current processing.
 boolean render()
          Start the pipeline functioning now.
 void setCuller(GraphicsCullStage cs)
          Set the cull instance to be used.
 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 setEyePointOffset(float x, float y, float z)
          Set the eyepoint offset from the centre position.
 void setGraphicsOutputDevice(GraphicsOutputDevice device)
          Register a drawing surface that this pipeline will send its output to.
 void setRenderableLayers(LayerCullable[] layers, int numLayers)
          Set the set of layers to be used by this pipeline.
 void setRequestData(RenderableRequestData data)
          Set the request data that should be passed along with the next frame.
 void setScreenOrientation(float x, float y, float z, float a)
          Set the orientation of this screen relative to the user's normal view direction.
 void setSorter(GraphicsSortStage ss)
          Set the sorter instance to be used.
 void swapBuffers()
          Instruct the drawable at the end of this pipeline to swap the buffers now.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultGraphicsPipeline

public DefaultGraphicsPipeline()
Create an instance of the pipeline with nothing registered.


DefaultGraphicsPipeline

public DefaultGraphicsPipeline(GraphicsCullStage cs,
                               GraphicsSortStage ss)
Construct a pipeline with the sort and cull stages provided.

Parameters:
ss - The sort stage instance to use
cs - The cull stage instance to use
Method Detail

setGraphicsOutputDevice

public void setGraphicsOutputDevice(GraphicsOutputDevice device)
Register a drawing surface that this pipeline will send its output to. Setting a null value will remove the current drawable surface.

Specified by:
setGraphicsOutputDevice in interface GraphicsRenderPipeline
Parameters:
device - The device instance to use or replace

getGraphicsOutputDevice

public GraphicsOutputDevice getGraphicsOutputDevice()
Get the currently registered drawable surface instance. If none is set, return null.

Specified by:
getGraphicsOutputDevice in interface GraphicsRenderPipeline
Returns:
The currently set device instance or null

setEyePointOffset

public void setEyePointOffset(float x,
                              float y,
                              float z)
Set the eyepoint offset from the centre position. This is used to model offset view frustums, such as multiple displays or a powerwall. This method will be called with the appropriate values from the RenderPipeline that this culler is inserted into.

Specified by:
setEyePointOffset in interface GraphicsRenderPipeline
Parameters:
x - The x axis offset
y - The y axis offset
z - The z axis offset

setScreenOrientation

public void setScreenOrientation(float x,
                                 float y,
                                 float z,
                                 float a)
                          throws java.lang.IllegalArgumentException
Set the orientation of this screen relative to the user's normal view direction. The normal orientation of the screen is along the negative Z axis. This method provides and axis-angle reorientation of that direction to one that is facing the screen. Typically this will just involve a rotation around the Y axis of some amount (45 and 90 deg being the most common used in walls and caves). This method will be called with the appropriate values from the RenderPipeline that this culler is inserted into.

Specified by:
setScreenOrientation in interface GraphicsRenderPipeline
Parameters:
x - The x axis component
y - The y axis component
z - The z axis component
a - The angle to rotate around the axis in radians
Throws:
java.lang.IllegalArgumentException - The length of the axis is zero

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.

Specified by:
setErrorReporter in interface RenderPipeline
Parameters:
reporter - The instance to use or null

setRequestData

public void setRequestData(RenderableRequestData data)
Set the request data that should be passed along with the next frame. This is temporary that is passed along at the next render() or displayOnly() call and will be cleared after that.

This class expects the data to be Graphics-oriented.

Specified by:
setRequestData in interface RenderPipeline
Parameters:
data - The data instance to pass this next frame

render

public boolean render()
Start the pipeline functioning now. All steps will be called and this method will not return until all are completed and the surface has swapped.

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:
render in interface RenderPipeline
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 interface RenderPipeline
Returns:
true if the drawing succeeded, or false if not

swapBuffers

public void swapBuffers()
Instruct the drawable at the end of this pipeline to swap the buffers now.

Specified by:
swapBuffers in interface GraphicsRenderPipeline

setRenderableLayers

public void setRenderableLayers(LayerCullable[] layers,
                                int numLayers)
Set the set of layers to be used by this pipeline. Providing an argument of a zero number of layers remove the layers from being rendered, causing the pipeline to function as a no-op when rendered.

If a scene is currently set, and a non-zero number of layers is provided, this will remove the scene and use the layers instead.

Specified by:
setRenderableLayers in interface RenderPipeline
Parameters:
layers - The collection of layers, in order, to render
numLayers - The number of valid layers to use

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

setSorter

public void setSorter(GraphicsSortStage ss)
Set the sorter instance to be used. If the instance is null, the current sorter is removed.

Parameters:
ss - The sorter instance to use or null

setCuller

public void setCuller(GraphicsCullStage cs)
Set the cull instance to be used. If the instance is null, the current culler is removed.

Parameters:
cs - The cull instance to use or null

Aviatrix3D
2.1.0

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