org.jzy3d.plot3d.rendering.view
Class Renderer3d

java.lang.Object
  extended by org.jzy3d.plot3d.rendering.view.Renderer3d
All Implemented Interfaces:
java.util.EventListener, javax.media.opengl.GLEventListener

public class Renderer3d
extends java.lang.Object
implements javax.media.opengl.GLEventListener

The Renderer object is a GLEventListener, that makes openGL calls necessary to initialize and render a Scene for its parent ICanvas. A Renderer is directly embedded and controlled by a Canvas3d and should not be controlled by the user in normal uses. However, since the Renderer implements the GLEventListener interface, it may be incorporated into one of these GLAutoDrawable provided by JOGL:


Constructor Summary
Renderer3d(View view)
          Initialize a Renderer attached to the given View.
Renderer3d(View view, boolean traceGL, boolean debugGL)
          Initialize a Renderer attached to the given View, and activate GL trace and errors to console.
 
Method Summary
 void display(javax.media.opengl.GLAutoDrawable canvas)
          Called when the GLDrawable requires a rendering.
 void displayChanged(javax.media.opengl.GLAutoDrawable canvas, boolean modeChanged, boolean deviceChanged)
          Called when the device or display mode change.
 void dispose()
           
 int getHeight()
          Return the height that was given after the last resize event.
 java.awt.image.BufferedImage getLastScreenshot()
           
 int getWidth()
          Return the width that was given after the last resize event.
 void init(javax.media.opengl.GLAutoDrawable canvas)
          Called when the GLDrawable is rendered for the first time.
 void nextDisplayUpdateScreenshot()
           
 void reshape(javax.media.opengl.GLAutoDrawable canvas, int x, int y, int width, int height)
          Called when the GLDrawable is resized.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Renderer3d

public Renderer3d(View view)
Initialize a Renderer attached to the given View.


Renderer3d

public Renderer3d(View view,
                  boolean traceGL,
                  boolean debugGL)
Initialize a Renderer attached to the given View, and activate GL trace and errors to console.

Method Detail

dispose

public void dispose()

init

public void init(javax.media.opengl.GLAutoDrawable canvas)
Called when the GLDrawable is rendered for the first time. When one calls Scene.init() function, this function is called and makes the OpenGL buffers initialization. Note: in this implementation, GL Exceptions are not triggered. To do so, make te following call at the beginning of the init() body: canvas.setGL( new DebugGL(canvas.getGL()) );

Specified by:
init in interface javax.media.opengl.GLEventListener

display

public void display(javax.media.opengl.GLAutoDrawable canvas)
Called when the GLDrawable requires a rendering. All call to rendering methods should appear here.

Specified by:
display in interface javax.media.opengl.GLEventListener

reshape

public void reshape(javax.media.opengl.GLAutoDrawable canvas,
                    int x,
                    int y,
                    int width,
                    int height)
Called when the GLDrawable is resized.

Specified by:
reshape in interface javax.media.opengl.GLEventListener

displayChanged

public void displayChanged(javax.media.opengl.GLAutoDrawable canvas,
                           boolean modeChanged,
                           boolean deviceChanged)
Called when the device or display mode change. Currently throw a RuntimeException: "Renderer: displayChanged not implemented.".

Specified by:
displayChanged in interface javax.media.opengl.GLEventListener

nextDisplayUpdateScreenshot

public void nextDisplayUpdateScreenshot()

getLastScreenshot

public java.awt.image.BufferedImage getLastScreenshot()

getWidth

public int getWidth()
Return the width that was given after the last resize event.


getHeight

public int getHeight()
Return the height that was given after the last resize event.