Aviatrix3D
2.1.0

org.j3d.aviatrix3d.output.graphics
Class SimpleAWTSurface

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.SimpleAWTSurface
All Implemented Interfaces:
GraphicsOutputDevice, OutputDevice

public class SimpleAWTSurface
extends BaseAWTSurface

Implementation of the most basic drawable surface, supporting the minimal number of features.

This implementation of GraphicsOutputDevice renders to a normal GLCanvas or GLJPanel (depending on if "lightweight" is true) instance and provides pBuffer support as needed. Stereo support is not provided and all associated methods always indicate negative returns on query about support.

Version:
$Revision: 3.12 $
Author:
Justin Couch

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.pipeline.graphics.GraphicsOutputDevice
ALTERNATE_FRAME_STEREO, NO_STEREO, QUAD_BUFFER_STEREO, TWO_CANVAS_STEREO
 
Constructor Summary
SimpleAWTSurface(javax.media.opengl.GLCapabilities caps)
          Construct a surface that requires the given set of capabilities.
SimpleAWTSurface(javax.media.opengl.GLCapabilities caps, BaseSurface sharedSurface)
          Construct a surface shares it's GL context with the given surface.
SimpleAWTSurface(javax.media.opengl.GLCapabilities caps, BaseSurface sharedSurface, boolean lightweight)
          Construct a surface shares it's GL context with the given surface.
SimpleAWTSurface(javax.media.opengl.GLCapabilities caps, boolean lightweight)
          Construct a surface that requires the given set of capabilities.
SimpleAWTSurface(javax.media.opengl.GLCapabilities caps, javax.media.opengl.GLCapabilitiesChooser chooser)
          Construct a surface that requires the given set of capabilities.
SimpleAWTSurface(javax.media.opengl.GLCapabilities caps, javax.media.opengl.GLCapabilitiesChooser chooser, BaseSurface sharedSurface)
          Construct a surface shares it's GL context with the given surface.
SimpleAWTSurface(javax.media.opengl.GLCapabilities caps, javax.media.opengl.GLCapabilitiesChooser chooser, BaseSurface sharedSurface, boolean lightweight)
          Construct a surface shares it's GL context with the given surface.
SimpleAWTSurface(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.
 
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
 

Constructor Detail

SimpleAWTSurface

public SimpleAWTSurface(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.

SimpleAWTSurface

public SimpleAWTSurface(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;

SimpleAWTSurface

public SimpleAWTSurface(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.

SimpleAWTSurface

public SimpleAWTSurface(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.

SimpleAWTSurface

public SimpleAWTSurface(javax.media.opengl.GLCapabilities caps,
                        BaseSurface sharedSurface)
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 sharedSurface 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.
sharedSurface - The surface that you'd like this surface to share the GL context with, if possible. May be null.

SimpleAWTSurface

public SimpleAWTSurface(javax.media.opengl.GLCapabilities caps,
                        javax.media.opengl.GLCapabilitiesChooser chooser,
                        BaseSurface sharedSurface)
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 sharedSurface 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;
sharedSurface - The surface that you'd like this surface to share the GL context with, if possible. May be null.

SimpleAWTSurface

public SimpleAWTSurface(javax.media.opengl.GLCapabilities caps,
                        BaseSurface sharedSurface,
                        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 sharedSurface 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.
sharedSurface - 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.

SimpleAWTSurface

public SimpleAWTSurface(javax.media.opengl.GLCapabilities caps,
                        javax.media.opengl.GLCapabilitiesChooser chooser,
                        BaseSurface sharedSurface,
                        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 sharedSurface 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;
sharedSurface - 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.

Returns:
The drawable surface representation

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