Aviatrix3D
2.1.0

org.j3d.aviatrix3d.output.graphics
Class ElumensAWTSurface

java.lang.Object
  extended by org.j3d.aviatrix3d.output.graphics.BaseSurface
      extended by org.j3d.aviatrix3d.output.graphics.BaseAWTSurface
          extended by org.j3d.aviatrix3d.output.graphics.ElumensAWTSurface
All Implemented Interfaces:
ElumensOutputDevice, GraphicsOutputDevice, OutputDevice

public class ElumensAWTSurface
extends BaseAWTSurface
implements ElumensOutputDevice

A surface which uses the Elumens SPI library to output to curved surfaces.

This implementation is capable of handling multichannel dome support with configurable number of channels. The number of channels used can be modified on the fly, but it is costly to do so as the render has to be reinitialized each time.

Currently stereo is not supported on this device, though it may be at a future time.

Version:
$Revision: 3.11 $
Author:
Alan Hudson

Field Summary
 
Fields inherited from class org.j3d.aviatrix3d.output.graphics.BaseAWTSurface
lightweight, resizer
 
Fields inherited from class org.j3d.aviatrix3d.output.graphics.BaseSurface
alphaCutoff, canCreatePBuffers, canvas, canvasContext, canvasDescriptor, canvasRenderer, errorReporter, FAILED_CONTEXT_MSG, initComplete, numRenderables, renderableList, rendererMap, sharedSurface, singleThreaded, surfaceMonitor, terminate, useTwoPassTransparent
 
Fields inherited from interface org.j3d.aviatrix3d.output.graphics.ElumensOutputDevice
SPI_1C_FRONT, SPI_2C_BORDER, SPI_2C_INSERT, SPI_2C_LEFT, SPI_2C_RIGHT, SPI_3C_LEFT, SPI_3C_RIGHT, SPI_3C_TOP, SPI_4C_BOTTOM, SPI_4C_LEFT, SPI_4C_RIGHT, SPI_4C_TOP, SPI_ALL_2_CHAN, SPI_ALL_3_CHAN, SPI_ALL_4_CHAN, SPI_ALL_CHAN, SPI_OC_FRONT
 
Fields inherited from interface org.j3d.aviatrix3d.pipeline.graphics.GraphicsOutputDevice
ALTERNATE_FRAME_STEREO, NO_STEREO, QUAD_BUFFER_STEREO, TWO_CANVAS_STEREO
 
Constructor Summary
ElumensAWTSurface(javax.media.opengl.GLCapabilities caps)
          Construct a surface that requires the given set of capabilities.
ElumensAWTSurface(javax.media.opengl.GLCapabilities caps, BaseSurface sharedWith)
          Construct a surface shares it's GL context with the given surface.
ElumensAWTSurface(javax.media.opengl.GLCapabilities caps, BaseSurface sharedWith, boolean lightweight)
          Construct a surface shares it's GL context with the given surface.
ElumensAWTSurface(javax.media.opengl.GLCapabilities caps, boolean lightweight)
          Construct a surface that requires the given set of capabilities.
ElumensAWTSurface(javax.media.opengl.GLCapabilities caps, javax.media.opengl.GLCapabilitiesChooser chooser)
          Construct a surface that requires the given set of capabilities.
ElumensAWTSurface(javax.media.opengl.GLCapabilities caps, javax.media.opengl.GLCapabilitiesChooser chooser, BaseSurface sharedWith)
          Construct a surface shares it's GL context with the given surface.
ElumensAWTSurface(javax.media.opengl.GLCapabilities caps, javax.media.opengl.GLCapabilitiesChooser chooser, BaseSurface sharedWith, boolean lightweight)
          Construct a surface shares it's GL context with the given surface.
ElumensAWTSurface(javax.media.opengl.GLCapabilities caps, javax.media.opengl.GLCapabilitiesChooser chooser, boolean lightweight)
          Construct a surface that requires the given set of capabilities.
 
Method Summary
protected  boolean createLightweightContext()
          Attempt to create a new lightweight canvas renderer now.
 java.lang.Object getSurfaceObject()
          Get the underlying object that this surface is rendered to.
 void setChannelEyePosition(int channel, float x, float y, float z)
          Set the channel eye position.
 void setChannelLensPosition(int channel, float x, float y, float z)
          Set the channel lens position.
 void setChannelSize(int channel, int height, int width)
          Set the channel size in pixels.
 void setNumberOfChannels(int channels)
          Set the number of channels to display.
 void setScreenOrientation(double r, double p, double v)
          Set the screen orientation.
 
Methods inherited from class org.j3d.aviatrix3d.output.graphics.BaseAWTSurface
addGraphicsResizeListener, draw, removeGraphicsResizeListener, setDrawableObjects, setErrorReporter, swap
 
Methods inherited from class org.j3d.aviatrix3d.output.graphics.BaseSurface
addSurfaceInfoListener, checkForExtension, completeCanvasInitialisation, createRenderingProcessor, dispose, disposeSingleThreadResources, enableSingleThreaded, enableTwoPassTransparentRendering, getAlphaTestCutoff, getCenterEyeInSurface, getGLContext, getPixelLocationInSurface, getSharedGLContext, getStereoEyeSeparation, getStereoRenderingPolicy, getSurfaceToVWorld, init, initCanvas, isDisposed, isQuadStereoAvailable, isShared, isStereoAvailable, isTwoPassTransparentEnabled, removeSurfaceInfoListener, setAlphaTestCutoff, setClearColor, setColorClearNeeded, setStereoEyeSeparation, setStereoRenderingPolicy
 
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.pipeline.graphics.GraphicsOutputDevice
addGraphicsResizeListener, addSurfaceInfoListener, enableTwoPassTransparentRendering, getAlphaTestCutoff, getCenterEyeInSurface, getPixelLocationInSurface, getStereoEyeSeparation, getStereoRenderingPolicy, getSurfaceToVWorld, isQuadStereoAvailable, isStereoAvailable, isTwoPassTransparentEnabled, removeGraphicsResizeListener, removeSurfaceInfoListener, setAlphaTestCutoff, setClearColor, setColorClearNeeded, setDrawableObjects, setStereoEyeSeparation, setStereoRenderingPolicy, swap
 
Methods inherited from interface org.j3d.aviatrix3d.pipeline.OutputDevice
dispose, disposeSingleThreadResources, draw, enableSingleThreaded, isDisposed, setErrorReporter
 

Constructor Detail

ElumensAWTSurface

public ElumensAWTSurface(javax.media.opengl.GLCapabilities caps)
Construct a surface that requires the given set of capabilities. This surface acts as a standalone canvas.

Parameters:
caps - A set of required capabilities for this canvas.

ElumensAWTSurface

public ElumensAWTSurface(javax.media.opengl.GLCapabilities caps,
                         javax.media.opengl.GLCapabilitiesChooser chooser)
Construct a surface that requires the given set of capabilities. This surface acts as a standalone canvas.

Parameters:
caps - A set of required capabilities for this canvas.
chooser - Custom algorithm for selecting one of the available GLCapabilities for the component;

ElumensAWTSurface

public ElumensAWTSurface(javax.media.opengl.GLCapabilities caps,
                         boolean lightweight)
Construct a surface that requires the given set of capabilities. This surface acts as a standalone canvas.

Parameters:
caps - A set of required capabilities for this canvas.
lightweight - If true, uses a GLJPanel (lightweight) JComponent, otherwise a GLCanvas. Note that setting this to true could negatively impact performance.

ElumensAWTSurface

public ElumensAWTSurface(javax.media.opengl.GLCapabilities caps,
                         javax.media.opengl.GLCapabilitiesChooser chooser,
                         boolean lightweight)
Construct a surface that requires the given set of capabilities. This surface acts as a standalone canvas.

Parameters:
caps - A set of required capabilities for this canvas.
chooser - Custom algorithm for selecting one of the available GLCapabilities for the component;
lightweight - If true, uses a GLJPanel (lightweight) JComponent, otherwise a GLCanvas. Note that setting this to true could negatively impact performance.

ElumensAWTSurface

public ElumensAWTSurface(javax.media.opengl.GLCapabilities caps,
                         BaseSurface sharedWith)
Construct a surface shares it's GL context with the given surface. This is useful for constructing multiple view displays of the same scene graph, but from different viewing directions, such as in a CAD application.

If the sharedWith parameter is null, then this is just treated as an ordinary non-shared frame. The return flag will be set appropriately.

Parameters:
caps - A set of required capabilities for this canvas.
sharedWith - The surface that you'd like this surface to share the GL context with, if possible. May be null.

ElumensAWTSurface

public ElumensAWTSurface(javax.media.opengl.GLCapabilities caps,
                         javax.media.opengl.GLCapabilitiesChooser chooser,
                         BaseSurface sharedWith)
Construct a surface shares it's GL context with the given surface. This is useful for constructing multiple view displays of the same scene graph, but from different viewing directions, such as in a CAD application.

If the sharedWith parameter is null, then this is just treated as an ordinary non-shared frame. The return flag will be set appropriately.

Parameters:
caps - A set of required capabilities for this canvas.
chooser - Custom algorithm for selecting one of the available GLCapabilities for the component;
sharedWith - The surface that you'd like this surface to share the GL context with, if possible. May be null.

ElumensAWTSurface

public ElumensAWTSurface(javax.media.opengl.GLCapabilities caps,
                         BaseSurface sharedWith,
                         boolean lightweight)
Construct a surface shares it's GL context with the given surface. This is useful for constructing multiple view displays of the same scene graph, but from different viewing directions, such as in a CAD application.

If the sharedWith parameter is null, then this is just treated as an ordinary non-shared frame. The return flag will be set appropriately.

Parameters:
caps - A set of required capabilities for this canvas.
sharedWith - The surface that you'd like this surface to share the GL context with, if possible. May be null.
lightweight - If true, uses a GLJPanel (lightweight) JComponent, otherwise a GLCanvas. Note that setting this to true could negatively impact performance.

ElumensAWTSurface

public ElumensAWTSurface(javax.media.opengl.GLCapabilities caps,
                         javax.media.opengl.GLCapabilitiesChooser chooser,
                         BaseSurface sharedWith,
                         boolean lightweight)
Construct a surface shares it's GL context with the given surface. This is useful for constructing multiple view displays of the same scene graph, but from different viewing directions, such as in a CAD application.

If the sharedWith parameter is null, then this is just treated as an ordinary non-shared frame. The return flag will be set appropriately.

Parameters:
caps - A set of required capabilities for this canvas.
chooser - Custom algorithm for selecting one of the available GLCapabilities for the component;
sharedWith - The surface that you'd like this surface to share the GL context with, if possible. May be null.
lightweight - If true, uses a GLJPanel (lightweight) JComponent, otherwise a GLCanvas. Note that setting this to true could negatively impact performance.
Method Detail

getSurfaceObject

public java.lang.Object getSurfaceObject()
Get the underlying object that this surface is rendered to. If it is a screen display device, the surface can be one of AWT Component or Swing JComponent. An off-screen buffer would be a form of AWT Image etc.

Specified by:
getSurfaceObject in interface OutputDevice
Returns:
The drawable surface representation

setNumberOfChannels

public void setNumberOfChannels(int channels)
Set the number of channels to display. Calling this will cause a reinitialization of renderer.

Specified by:
setNumberOfChannels in interface ElumensOutputDevice
Parameters:
channels - The number of channels to render.

setChannelLensPosition

public void setChannelLensPosition(int channel,
                                   float x,
                                   float y,
                                   float z)
Set the channel lens position.

Specified by:
setChannelLensPosition in interface ElumensOutputDevice
Parameters:
channel - The ID of the channel(s) to affect
x - The x position
y - The y position
z - The z position

setChannelEyePosition

public void setChannelEyePosition(int channel,
                                  float x,
                                  float y,
                                  float z)
Set the channel eye position.

Specified by:
setChannelEyePosition in interface ElumensOutputDevice
Parameters:
channel - The ID of the channel(s) to affect
x - The x position
y - The y position
z - The z position

setScreenOrientation

public void setScreenOrientation(double r,
                                 double p,
                                 double v)
Set the screen orientation. Allows the project to rotated in software for different hardware setups.

Specified by:
setScreenOrientation in interface ElumensOutputDevice
Parameters:
r - The roll
p - The pitch
v - The yaw

setChannelSize

public void setChannelSize(int channel,
                           int height,
                           int width)
Set the channel size in pixels.

Specified by:
setChannelSize in interface ElumensOutputDevice
Parameters:
channel - The ID of the channel(s) to affect
height - The height in pixels
width - The width in pixels

createLightweightContext

protected boolean createLightweightContext()
Attempt to create a new lightweight canvas renderer now. This will only be called whenever the user has signalled that this is a lightweight renderer and we do not yet have a canvasRenderer instance created. If this fails, silently exit. We'll attempt to do this next frame.

Specified by:
createLightweightContext in class BaseAWTSurface
Returns:
true if this creation succeeded

Aviatrix3D
2.1.0

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