gnu.gleem
Class ExaminerViewer

java.lang.Object
  |
  +--gnu.gleem.ExaminerViewer

public class ExaminerViewer
extends java.lang.Object

This is an application-level class, not part of the manipulator hierarchy. It is an example of how you might integrate gleem with another application which uses the mouse.

For the given GLDrawable, the ExaminerViewer takes over the setting of the view position. It passes along mouse events it is not interested in to the ManipManager's mouse routines.


Constructor Summary
ExaminerViewer(int numMouseButtons)
          The constructor takes the number of mouse buttons on this system (couldn't figure out how to determine this internally)
 
Method Summary
 void attach(gl4java.drawable.GLDrawable window, BSphereProvider provider)
           Attaches this ExaminerViewer to the given GLDrawable.
 void detach()
          Detaches from the given window.
 void dollyFaster()
           
 void dollySlower()
           
 CameraParameters getCameraParameters()
          Get the camera parameters out of this Examiner Viewer (for example, to pass to ManipManager.updateCameraParameters())
 void rotateFaster()
          These routines can be hooked into a GUI by calling them from ActionEvent listeners for buttons elsewhere in the application.
 void rotateSlower()
           
 void update(gl4java.GLFunc gl, gl4java.GLUFunc glu)
          Call this at the end of your display() method to cause the Modelview matrix to be recomputed for the next frame.
 void viewAll(gl4java.GLFunc gl, gl4java.GLUFunc glu)
          Call this from within your display() method to cause the ExaminerViewer to recompute its position based on the visible geometry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExaminerViewer

public ExaminerViewer(int numMouseButtons)
The constructor takes the number of mouse buttons on this system (couldn't figure out how to determine this internally)

Method Detail

attach

public void attach(gl4java.drawable.GLDrawable window,
                   BSphereProvider provider)

Attaches this ExaminerViewer to the given GLDrawable. This causes the ManipManager's mouse routines to be removed from the window (using ManipManager.removeMouseListeners) and the ExaminerViewer's to be installed. The GLDrawable should be registered with the ManipManager before the ExaminerViewer is attached to it.

In order for the viewer to do anything useful, you need to provide a BSphereProvider to it to allow "view all" functionality.


detach

public void detach()
Detaches from the given window. This causes the ManipManager's mouse listeners to be reinstalled on the GLDrawable and the ExaminerViewer's to be removed.


update

public void update(gl4java.GLFunc gl,
                   gl4java.GLUFunc glu)
Call this at the end of your display() method to cause the Modelview matrix to be recomputed for the next frame.


viewAll

public void viewAll(gl4java.GLFunc gl,
                    gl4java.GLUFunc glu)
Call this from within your display() method to cause the ExaminerViewer to recompute its position based on the visible geometry. A BSphereProvider must have already been set or this method has no effect.


getCameraParameters

public CameraParameters getCameraParameters()
Get the camera parameters out of this Examiner Viewer (for example, to pass to ManipManager.updateCameraParameters())


rotateFaster

public void rotateFaster()
These routines can be hooked into a GUI by calling them from ActionEvent listeners for buttons elsewhere in the application.


rotateSlower

public void rotateSlower()

dollyFaster

public void dollyFaster()

dollySlower

public void dollySlower()