#include <GLView.h>
This class encapsulates the GL rendering viewport and provides basic rendering functionality. The viewport calls in the user-defined implementation of render() from the selected effect to display it. Also contained in the class are event hadlers for keyboard and mouse (see descriptions for details), as well as functions that automatically set and handle all necessary view/projection tranformations as well as resizing and updates.
|
|
|
Destroys the object. Empty for now, but may be modified later to include removal of dynamically allocated memory. |
|
|
|
|
|
|
|
|
|
This is called to perform any initialization that's necessary before the widget is displayed, but is too early to be called from the class constructor. Does nothing for now but may be modified later if required.
|
|
|
|
|
|
Resets the camera orientation (but not the zoom extents/FOV)
|
|
Resets the FOV (or zoom extents when in orhtographic mode)
|
|
This function ask the user to specify a file name on disk and uses it to save the current rendering to a file. If no name is specified or the dialog is cancelled, the image will not be saved.
|
|
This function initializes internal states and parameters. It also sets the size of GL viewport and establishes the perspective projection according to fovAngle, nearClipPlane, farClipPlane, and aspect ratio of the viewport, whose values are obtained from the currently selected effect. The projection parameters are kept until a new effect is set. Most basic openGL functionality is initially de-activated here in order to reset the GL rendering context when calling a new effect. This is done to avoid such situations as one effect enabling GL_ALPHA_TEST and accidentally leaving it enabled, and the next selected effect looking incorrectly as a result because it didn't want GL_ALPHA_TEST.
|
|
Positions the camera and draws the window. Displaying the currently selected effect is accomplished by invoking its render() function. The rendering context is double-buffered by default. This method also renders the axis tripod and axes visual aids when in virtual trackball mode. |
|
|
|
This event handler also calculates the rotation axis and angle when in virtual trackball mode, or changes the zoom extents when in zoom mode. |
|
|
|
|
|
|
|
|
|
This function reports back general openGL capabilities. The output is sent to the console.
|