#include <GLEffect.h>
Inheritance diagram for GLEffect::
This abstract base class provides basic functionality common for all effects, i.e. instantiation/hiding/showing of child GUI controls, mouse/keyboard event handlers, a basic information structure, and some other useful functions. (See list of API functions for details). It also provides common predefined member variables than can be used by an effect to keep pointers to texture data, access current 2d/3d mouse coordinates, pressed keys, perspective projection parameters etc.
|
|
|
Destroys an effect object. The settings panel and local effectInfo struct are deleted here.
|
|
This is really just a wrapper for calling initialize() from outside. Although having such a simple function might seem silly(or stupid....), there are two important reasons for having it around: First, I tried to keep initialize() protected, as to not expose any unnecessary implementation details. Second, what it also does is set the perspective projection parameters in GLView that correspond to the selected effect. This guarantees that the selected effect will look correctly. (If you had to manually call the setProjectionParams() in initialize() and for some reason forgot to do it, your effect would probably look incorrectly).
|
|
|
|
void createControls(QWidget* parent) {}, if you don't need any control widgets. This will put up an empty frame with "No controls available" title in the right panel of the main window. Otherwise, here's how you build such a panel: The controlPanel member variable will already contain a pointer to the correct parent widget(depending on what you chose in createControlPanel() ) at the time this function is called. So, construct some kind of container first, a QVBox for instance, with controlPanel as the parent widget. Then construct your control widgets with your QVBox container as the parent, and don't forget to define suitable slots for these widgets in your class. Finally, establish all necessary signal/slot connections, and the panel is ready to use. Attention: When you have implemented the panel, its instantiation is taken care of automatically in GLEffect, so make sure you don't call this function from anywhere - the resulting behaviour of the program would be upredictable! Reimplemented in AccumEffect, CBSplineWrapperEffect, ContourWarpEffect, SimpleEffect, and Waterwaves. |
|
This function hides the control panel of the current effect. You should call it once at the end of your derived class' constructor so that the control panel of your effect is initially hidden from view (otherwise the main GUI will look weird...)
|
|
This shows an effect's control panel. Both showControls() and hideControls() are used internally by GLFramework::onSelectEffect() member of the GLFramework class to control the visibility of individual effects upon selection. You should never call showControls() explicitly.
|
|
This function is called when an effect is hidden. It is doesn't currently do much, except reset the parameters of the effect being hidden to their defaults. Some additional commands might be added here later. Reimplemented in CBSplineWrapperEffect, and ContourWarpEffect. |
|
This function is called when an effect is shown. May be later used for a variety of different purposes. Reimplemented in CBSplineWrapperEffect, and ContourWarpEffect. |
|
This function is used by GLFramework to ask an effect whether it wants to handle originally loaded image data. If you set the newRawTextures member of the EffectInfo struct to true, the loaded images will no longer be automatically converted to the most common openGL-compatible format (32-bit RGBA) and you will be responsible for handling the data yourself in an appropriate way. You may wish to do so if the automatic conversion doesn't meet your requirements for some reason. |
|
This function is used internally by image loading mechanism within GLFramework to notify the current effect when the user loads a new set of images. The texture pointers are set to first image frames from each of 3 possible image lists (depending on how many image lists there are). The scene is then immediately updated to reflect the changes.
|
|
This is the 'heart' of the effect rendering system. Derived classes will need to put implementation of their rendering algorithm into this function. Reimplemented in AccumEffect, CBSplineWrapperEffect, ContourWarpEffect, SimpleEffect, and Waterwaves. |
|
Reimplemented in CBSplineWrapperEffect, ContourWarpEffect, and ShadowCaster. |
|
Reimplemented in CBSplineWrapperEffect, ContourWarpEffect, and ShadowCaster. |
|
Reimplemented in CBSplineWrapperEffect, ContourWarpEffect, and ShadowCaster. |
|
Reimplemented in ContourWarpEffect, and ShadowCaster. |
|
Reimplemented in CBSplineWrapperEffect, and ShadowCaster. |
|
This function initializes the parameters of an effect and its associated GL modes/states. Default implementation does nothing, so override this as necessary. Be sure to set up and initialize any necessary variables / data here, and to enable/disable any required openGL states.
Reimplemented in AccumEffect, CBSplineWrapperEffect, ContourWarpEffect, SimpleEffect, and Waterwaves. |
|
This is the base implementation - it will simply redraw the GL window. If you need something more sophisticated before redraw, re-implement this in your class and don't forget to include glView->update(); as the last line of your implementation.
Reimplemented in ContourWarpEffect. |
|
Activates mouse tracking in GLView to track the mouse position regardless of mouse button states. This is useful in situations where you want your effect to react to mouse movements even if the button(s) aren't clicked. |
|
|