org.deegree.rendering.r3d.opengl.display
Class OpenGLEventHandler

java.lang.Object
  extended by org.deegree.rendering.r3d.opengl.display.OpenGLEventHandler
All Implemented Interfaces:
EventListener, javax.media.opengl.GLEventListener

public class OpenGLEventHandler
extends Object
implements javax.media.opengl.GLEventListener

The OpenGLEventHandler class renders a list of DataObjects and handles opengl callback functions delivered by a GLCanvas. It possesses a trackball which can roate the scene.

Version:
$Revision: 29127 $, $Date: 2011-01-10 16:13:35 +0100 (Mon, 10 Jan 2011) $
Author:
Rutger Bezema, last edited by: $Author: aschmitz $

Constructor Summary
OpenGLEventHandler(boolean renderTestObject)
           
 
Method Summary
 void addDataObjectToScene(WorldRenderableObject b)
          Adds the given branch group to the scene and set the appropriate distance etc.
 void calcViewParameters()
           
 void display(javax.media.opengl.GLAutoDrawable theDrawable)
           
 void displayChanged(javax.media.opengl.GLAutoDrawable d, boolean modeChanged, boolean deviceChanged)
           
 Envelope getBbox()
           
 TrackBall getTrackBall()
           
 void init(javax.media.opengl.GLAutoDrawable d)
           
 boolean isTestObjectRendered()
           
 void removeAllData()
           
 void renderTestObject(boolean renderTestObject)
           
 void reshape(javax.media.opengl.GLAutoDrawable d, int x, int y, int width, int height)
           
 boolean updateView(char keyTyped)
          Update the view by evaluating the given key,
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenGLEventHandler

public OpenGLEventHandler(boolean renderTestObject)
Parameters:
renderTestObject -
Method Detail

getBbox

public Envelope getBbox()

calcViewParameters

public void calcViewParameters()

display

public void display(javax.media.opengl.GLAutoDrawable theDrawable)
Specified by:
display in interface javax.media.opengl.GLEventListener

addDataObjectToScene

public void addDataObjectToScene(WorldRenderableObject b)
Adds the given branch group to the scene and set the appropriate distance etc. After adding the branch group to the rotation group which is controlled by the mouse rotator.

Parameters:
b - a list of WorldRenderableObjects, can be null.

updateView

public boolean updateView(char keyTyped)
Update the view by evaluating the given key,

Parameters:
keyTyped - r/R(reset view), all others will be ignored.
Returns:
true if the view should be redrawn, false otherwise.

displayChanged

public void displayChanged(javax.media.opengl.GLAutoDrawable d,
                           boolean modeChanged,
                           boolean deviceChanged)
Specified by:
displayChanged in interface javax.media.opengl.GLEventListener

init

public void init(javax.media.opengl.GLAutoDrawable d)
Specified by:
init in interface javax.media.opengl.GLEventListener

reshape

public void reshape(javax.media.opengl.GLAutoDrawable d,
                    int x,
                    int y,
                    int width,
                    int height)
Specified by:
reshape in interface javax.media.opengl.GLEventListener

getTrackBall

public TrackBall getTrackBall()
Returns:
the trackBall

removeAllData

public void removeAllData()

isTestObjectRendered

public final boolean isTestObjectRendered()
Returns:
the renderTestObject

renderTestObject

public final void renderTestObject(boolean renderTestObject)
Parameters:
renderTestObject - the renderTestObject to set


Copyright © 2011. All Rights Reserved.