Aviatrix3D
2.0 Dev

org.j3d.aviatrix3d.output.graphics
Class DebugAWTSurface

java.lang.Object
  extended byorg.j3d.aviatrix3d.output.graphics.BaseSurface
      extended byorg.j3d.aviatrix3d.output.graphics.BaseAWTSurface
          extended byorg.j3d.aviatrix3d.output.graphics.DebugAWTSurface
All Implemented Interfaces:
java.util.EventListener, GraphicsOutputDevice, java.awt.event.KeyListener, OutputDevice

public class DebugAWTSurface
extends BaseAWTSurface
implements java.awt.event.KeyListener

Implementation of drawable surface with the key mapping defined to allow the GL trace to be debugged for a single frame.

To dump a set of GL trace, the 'd' key is mapped to dump the next frame.

This implementation of GraphicsOutputDevice renders to a normal GLCanvas 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.6 $
Author:
Justin Couch

Field Summary
 
Fields inherited from class org.j3d.aviatrix3d.output.graphics.BaseAWTSurface
resizer
 
Fields inherited from class org.j3d.aviatrix3d.output.graphics.BaseSurface
canCreatePBuffers, canvas, canvasContext, canvasRenderer, errorReporter, FAILED_CONTEXT_MSG, initComplete, numRenderables, renderableList, sharedSurface, singleThreaded, terminate
 
Fields inherited from interface org.j3d.aviatrix3d.pipeline.graphics.GraphicsOutputDevice
ALTERNATE_FRAME_STEREO, NO_STEREO, QUAD_BUFFER_STEREO, TWO_CANVAS_STEREO
 
Constructor Summary
DebugAWTSurface(javax.media.opengl.GLCapabilities caps)
          Construct a surface that requires the given set of capabilities.
DebugAWTSurface(javax.media.opengl.GLCapabilities caps, BaseSurface sharedSurface)
          Construct a surface shares it's GL context with the given surface.
DebugAWTSurface(javax.media.opengl.GLCapabilities caps, BaseSurface sharedSurface, boolean lightweight)
          Construct a surface shares it's GL context with the given surface.
DebugAWTSurface(javax.media.opengl.GLCapabilities caps, boolean lightweight)
          Construct a surface that requires the given set of capabilities.
DebugAWTSurface(javax.media.opengl.GLCapabilities caps, javax.media.opengl.GLCapabilitiesChooser chooser)
          Construct a surface that requires the given set of capabilities.
DebugAWTSurface(javax.media.opengl.GLCapabilities caps, javax.media.opengl.GLCapabilitiesChooser chooser, BaseSurface sharedSurface)
          Construct a surface shares it's GL context with the given surface.
DebugAWTSurface(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.
DebugAWTSurface(javax.media.opengl.GLCapabilities caps, javax.media.opengl.GLCapabilitiesChooser chooser, boolean lightweight)
          Construct a surface that requires the given set of capabilities.
 
Method Summary
 java.lang.Object getSurfaceObject()
          Get the underlying object that this surface is rendered to.
 void keyPressed(java.awt.event.KeyEvent evt)
          Notification of a key press event.
 void keyReleased(java.awt.event.KeyEvent evt)
          Notification of a key release event.
 void keyTyped(java.awt.event.KeyEvent evt)
          Notification of a key type (press and release) event.
 
Methods inherited from class org.j3d.aviatrix3d.output.graphics.BaseAWTSurface
addGraphicsResizeListener, removeGraphicsResizeListener, setErrorReporter
 
Methods inherited from class org.j3d.aviatrix3d.output.graphics.BaseSurface
checkForExtension, completeCanvasInitialisation, dispose, disposeSingleThreadResources, draw, enableSingleThreaded, getCenterEyeInSurface, getPixelLocationInSurface, getStereoEyeSeparation, getStereoRenderingPolicy, getSurfaceToVWorld, init, initCanvas, isDisposed, isQuadStereoAvailable, isShared, isStereoAvailable, queueDeletedObject, queueShaderRequests, setClearColor, setColorClearNeeded, setDrawableObjects, setStereoEyeSeparation, setStereoRenderingPolicy, swap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DebugAWTSurface

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

DebugAWTSurface

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

DebugAWTSurface

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

DebugAWTSurface

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

DebugAWTSurface

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

DebugAWTSurface

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

DebugAWTSurface

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

DebugAWTSurface

public DebugAWTSurface(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

keyPressed

public void keyPressed(java.awt.event.KeyEvent evt)
Notification of a key press event. When the 'd' key is pressed, dump the next frame to stdout.

Specified by:
keyPressed in interface java.awt.event.KeyListener
Parameters:
evt - The key event that caused this method to be called

keyReleased

public void keyReleased(java.awt.event.KeyEvent evt)
Notification of a key release event. Does nothing for this implementation.

Specified by:
keyReleased in interface java.awt.event.KeyListener
Parameters:
evt - The key event that caused this method to be called

keyTyped

public void keyTyped(java.awt.event.KeyEvent evt)
Notification of a key type (press and release) event. This will any one of the key value fields depending on the value.

Specified by:
keyTyped in interface java.awt.event.KeyListener
Parameters:
evt - The key event that caused this method to be called

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

Aviatrix3D
2.0 Dev

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