Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

QGLVUWidget Class Reference

A QGLWidget with 3D graphics viewer features. More...

#include <qglvuwidget.h>

Inheritance diagram for QGLVUWidget::

List of all members.

Public Types

enum  WorldNavMode {
  NAV_MODE_TRACKBALL, NAV_MODE_HYPERBALL, NAV_MODE_DRIVE, NAV_MODE_TRANSLATE,
  NAV_MODE_LOOK, NAV_MODE_NUM_MODES
}
 World Navigation Modes. See SetWorldNavMode().

enum  CameraID {
  CAMERA_ONE, CAMERA_TWO, CAMERA_THREE, CAMERA_FOUR,
  CAMERA_NUM_CAMS
}
 Camera IDs. There are 4 default Cameras in a QGLVUWidget.


Public Slots

void SelectCam (int whichCam)
void AllCamsResetToOrig ()
void CyclePolygonMode ()
int SetWorldNavMode (WorldNavMode mode)
bool ToggleCamDisplay (int whichCam)
bool ToggleInOutMode ()
bool ToggleFaceCulling ()
bool ToggleLighting ()
bool ToggleMaterials ()
bool ToggleSmoothShading ()
void ToggleCullFace ()

Signals

void FPSUpdate (float rFPS)

Public Methods

 QGLVUWidget (QGLFormat &format=QGLFormat::defaultFormat(), QWidget *parent=0, const char *name=0)
virtual ~QGLVUWidget ()
virtual void DoneCurrent ()
void MakeContextCurrent ()
virtual void BeginFrame ()
virtual void EndFrame ()
void SetCurrentCam (Camera *pNewCam)
Camera * GetCurrentCam ()
Camera * GetCam (int whichCam)
void SetOrigCam (Camera *pCam)
void SetAllCams (Vec3f worldMin, Vec3f worldMax, Vec3f eye, Vec3f lookAtCntr, Vec3f viewup, float yFOV, float aspect, float nearFactor, float farFactor)
void AllCamsPerspectiveChange (float yFOV, float aspect, float nearDist, float farDist)
void AllCamsPerspectiveAspectChange (float aspect)
float * GetModelviewMatrix (float *pMatrix) const
float * GetProjectionMatrix (float *pMatrix) const
bool GetInOutMode () const
void SetInOutMode (bool bMode)
int GetWorldNavMode () const
const Vec3f & GetViewUp () const
const Vec3f & GetWorldCenter () const
float GetWorldRadius () const
void SetViewUp (Vec3f viewup)
void SetWorldCenter (const Vec3f &center)
void SetWorldRadius (float newRadius)
bool GetCamDisplayOn (int whichCam) const
bool GetInertiaOn () const
bool GetInertiaEnabled () const
int GetInertiaDelay () const
void SetInertiaOn (bool bEnable)
void SetInertiaEnabled (bool bEnable)
void SetInertiaDelay (int iMilliseconds)
int GetInertiaMinMove () const
void SetInertiaMinMove (int iAmount)
void StartFPSClock ()
void StopFPSClock ()
float GetFPS () const
void SetFPSIntegrateInterval (float rInterval)
void UpdateFPS ()
ButtonState GetButtonState () const
void GetMousePos (int &ix, int &iy) const
void TranslateX (int iOldX, int iNewX, int iWW)
void TranslateY (int iOldY, int iNewY, int iWH)
void DriveY (int iOldY, int iNewY, int iWH)
void LookX (int iOldX, int iNewX, int iWW)
void LookY (int iOldY, int iNewY, int iWH)
void TrackBallX (int iOldX, int iNewX, int iWW)
void TrackBallY (int iOldY, int iNewY, int iWH)
void HyperBall (int iOldX, int iOldY, int iNewX, int iNewY, int iWW, int iWH)
void SnapShot ()
void ReportGLError (char *msg)
QPixmap * CreateQGLVUPixmap () const
void SetPathFilename (const char *pFilename)
void StartRecording ()
void EndRecording ()
void StartPlayback ()
void EndPlayback ()
void StopRecordingPlayback ()
void SetInitializeGL (void(*f)(QGLVUWidget *))
void SetResizeGL (void(*f)(QGLVUWidget *, int, int))
void SetPaintGL (void(*f)(QGLVUWidget *))

Static Public Methods

void DefaultInitializeGL (QGLVUWidget *pGLVU)
void DefaultResizeGL (QGLVUWidget *pGLVU, int iw, int ih)
void DefaultPaintGL (QGLVUWidget *pGLVU)

Protected Methods

virtual void initializeGL ()
virtual void resizeGL (int iw, int ih)
virtual void paintGL ()
virtual void mousePressEvent (QMouseEvent *pEvent)
virtual void mouseReleaseEvent (QMouseEvent *pEvent)
virtual void mouseDoubleClickEvent (QMouseEvent *pEvent)
virtual void mouseMoveEvent (QMouseEvent *pEvent)
virtual void wheelEvent (QWheelEvent *pEvent)
virtual void keyPressEvent (QKeyEvent *pEvent)
virtual void keyReleaseEvent (QKeyEvent *pEvent)
virtual void timerEvent (QTimerEvent *pEvent)
bool _DoInertia ()
virtual void _Inertia (int x, int y)
void _DoRecordAndPlayback ()

Protected Attributes

Camera _pCams [CAMERA_NUM_CAMS]
Camera * _pCam
Camera _origCam
bool _pbCamDisplayOn [CAMERA_NUM_CAMS]
Vec3f _worldCenter
float _rWorldRadius
Vec3f _viewUp
bool _bInsideLookingOutMode
WorldNavMode _eWorldNavMode
int _iOldX
int _iOldY
int _iNewX
int _iNewY
float _rMoveSpeed
ButtonState _buttonState
bool _bInertiaOn
bool _bInertiaEnabled
int _iInertiaDelay
int _iInertiaTimerID
int _iInertiaMinMove
char * _pPathFilename
bool _bRecordingOn
bool _bPlaybackOn
FILE * _pPathFP
timeb _lastFPSClock
bool _bCalcFPS
float _rLastFPS
int _iLastFPSCount
int _iFPSDelay
int _iFPSTimerID
float _rFPSIntegrateInterval
void(* _pfInitializeGL )(QGLVUWidget *)
void(* _pfResizeGL )(QGLVUWidget *, int, int)
void(* _pfPaintGL )(QGLVUWidget *)

Detailed Description

A QGLWidget with 3D graphics viewer features.

Features include a full-featured Camera class [GetCamera()]; world navigation with multiple mouse control modes [SetWorldNavMode()] and "inertia" [SetInertiaEnabled()]; frame rate computation [GetFPS()]; screen capture [SnapShot()]; and a host of other features from view-frustum culling and object loading and rendering, via the auxiliary GLVU libraries.

To use a QGLVUWidget you have two options:

For the most control, you can subclass it and overridethe paintGL() method and optionally the initializeGL() and resizeGL() methods. You can also override the normal QWidget event methods, such as mouseMoveEvent() or timerEvent().

For an "EZ" way to get up and running with a QGLVUWidget, you can write your own stand alone paintGL() and/or initializeGL() and resizeGL() methods, following the interface of DefaultPaintGL(), DefaultInitializeGL(), and DefaultResizeGL(), respectively. Then pass then pass them to the QGLVUWidget via SetPaintGL(), SetInitializeGL(), and SetResizeGL().


Member Function Documentation

void QGLVUWidget::AllCamsPerspectiveAspectChange float   newAspect
 

Changes the aspect ratio of all cameras without affecting the other perspective parameters.

Parameters:
newAspect   pixel width / height.

void QGLVUWidget::AllCamsPerspectiveChange float   yFOV,
float   aspect,
float   nDist,
float   fDist
 

Changes the frustum dimensions of all Cameras to the specified parameters. Does not affect position and orientation.

Parameters:
yFOV   vertical Field Of View in degrees.
aspect   pixel width / height.
nearDist   distance to near plane.
farDist   distance to far plane.

void QGLVUWidget::AllCamsResetToOrig   [slot]
 

Resets all cameras to the original settings set with SetAllCams().

void QGLVUWidget::BeginFrame   [virtual]
 

This function should be called before making any rendering calls in paintGL().

It does two things:

First, it loads the projection and modelview matrices from the current Camera. Second, it updates the FPS counters.

BeginFrame() is equivalent to the following code:

  GLfloat M[16];
  glMatrixMode(GL_PROJECTION);
  glLoadMatrixf( GetProjectionMatrix(M) );
  glMatrixMode(GL_MODELVIEW);
  glLoadMatrixf( GetModelviewMatrix(M) );
  UpdateFPS();

QPixmap * QGLVUWidget::CreateQGLVUPixmap   const
 

Creates the standard QGLVU logo as a 64x64 Pixmap, ideal for icons.

void QGLVUWidget::CyclePolygonMode   [slot]
 

Cycles the GL polygon mode between fill, wire, and point modes. The wire mode is by default set to disply front faces as wireframe, and back faces filled.

void QGLVUWidget::DefaultInitializeGL QGLVUWidget *   pGLVU [static]
 

The default implementation of initializeGL. Initially this is called by initializeGL(), but it can be overridden either by subclassing QGLVUWidget or by passing a function pointer to SetInitializeGL().

void QGLVUWidget::DefaultPaintGL QGLVUWidget *   pGLVU [static]
 

The default implementation of paintGL. Initially this is called by paintGL(), but it can be overridden either by subclassing QGLVUWidget or by passing a function pointer to SetPaintGL().

void QGLVUWidget::DefaultResizeGL QGLVUWidget *   pGLVU,
int   iw,
int   ih
[static]
 

The default implementation of resizeGL. Initially this is called by resizeGL(), but it can be overridden either by subclassing QGLVUWidget or by passing a function pointer to SetResizeGL().

void QGLVUWidget::DoneCurrent   [virtual]
 

Notifies the QGLVUWidget that it's context is no longer current. This is useful when using non-Qt created GL contexts, such as you might create using WGL or GLX calls (for example, when using pbuffers). Call this when you are done using the non-Qt context. This will cause the QGLVUWidget's context to be made current the next time one of initializeGL(), paintGL(), or resizeGL() is called.

void QGLVUWidget::DriveY int   iOldY,
int   iNewY,
int   iWH
 

Moves the active Camera forward or backward along its view axis based on mouse movement.

void QGLVUWidget::EndFrame   [virtual]
 

This function should be called last in paintGL(), or after making any rendering calls.

This base implementation simply displays camera frusta for Cameras that have their display flags set. (see ToggleCamDisplay()).

void QGLVUWidget::EndPlayback  
 

Ends Camera path playback.

void QGLVUWidget::EndRecording  
 

Ends path recording and closes the path file.

Qt::ButtonState QGLVUWidget::GetButtonState   const [inline]
 

Returns the current state of mouse buttons. Updated by mousePressEvent() and mouseReleaseEvent().

Camera * QGLVUWidget::GetCam int   whichCam [inline]
 

Returns a pointer to the specified camera.

bool QGLVUWidget::GetCamDisplayOn int   whichCam const [inline]
 

Returns the display status of the specified Camera.

Camera * QGLVUWidget::GetCurrentCam   [inline]
 

Returns a pointer to the active camera.

float QGLVUWidget::GetFPS   const [inline]
 

Returns the last calculated Frames Per Second measurement.

bool QGLVUWidget::GetInOutMode   const [inline]
 

Returns a boolean specifying whether the navigation mode is "inside looking out" (true) or "outside looking in" (false, the default). See SetInOutMode() and ToggleInOutMode().

int QGLVUWidget::GetInertiaDelay   const [inline]
 

Returns the current time delay (secs)between Inertia events when Inertia is active.

bool QGLVUWidget::GetInertiaEnabled   const [inline]
 

Returns whether or not Inertia is enabled, i.e. whether a Camera can be moved by Inertia.

int QGLVUWidget::GetInertiaMinMove   const [inline]
 

Returns the minimum number of pixels the mouse must be moved (with LeftButton pressed) in order to invoke Inertia.

bool QGLVUWidget::GetInertiaOn   const [inline]
 

Returns whether or not Inertia is currently "active", i.e. it is moving a Camera at the time of query.

float * QGLVUWidget::GetModelviewMatrix float *   pMatrix const
 

Returns the modelview matrix of the current Camera.

void QGLVUWidget::GetMousePos int &   ix,
int &   iy
const [inline]
 

Returns the last position of the mouse when a button was pressed. In the base QGLVUWidget implementation, mouse position is only stored on mousePressEvents.

float * QGLVUWidget::GetProjectionMatrix float *   pMatrix const
 

Returns the projection matrix of the current Camera.

const Vec3f & QGLVUWidget::GetViewUp   const [inline]
 

Returns the global "up" vector, as set by SetViewUp() or SetAllCams().

const Vec3f & QGLVUWidget::GetWorldCenter   const [inline]
 

Returns the global "center" of the world, as set by SetWorldCenter() or (indirectly) by SetAllCams().

int QGLVUWidget::GetWorldNavMode   const [inline]
 

Returns the current navigation mode. See SetWorldNavMode().

float QGLVUWidget::GetWorldRadius   const [inline]
 

Returns the global "radius" of the world, as set by SetWorldRadius() or (indirectly) by SetAllCams().

void QGLVUWidget::HyperBall int   iOldX,
int   iOldY,
int   iNewX,
int   iNewY,
int   iWW,
int   iWH
 

Implements the SGI "Hyperbolic Sheet" trackball mode to rotate the active Camera about the center of the world.

void QGLVUWidget::LookX int   iOldX,
int   iNewX,
int   iWW
 

Rotates the active Camera about its Up axis (through its origin) based on mouse movement.

void QGLVUWidget::LookY int   iOldY,
int   iNewY,
int   iWH
 

Rotates the active Camera about its side axis (through its origin) based on mouse movement.

void QGLVUWidget::MakeContextCurrent  
 

Simply calls DoneCurrent(), and then QGLWidget::makeCurrent(). Use this in cases when you are using a non-Qt context, and you don't have a chance to call DoneCurrent() before one of initializeGL(), paintGL(), or resizeGL() is called.

void QGLVUWidget::ReportGLError char *   message
 

A debugging method. Reports any current error in OpenGL, appending message to the end.

void QGLVUWidget::SelectCam int   whichCam [inline, slot]
 

Activates the specified Camera.

void QGLVUWidget::SetAllCams Vec3f   worldMin,
Vec3f   worldMax,
Vec3f   eye,
Vec3f   lookAtCntr,
Vec3f   viewUp,
float   yFOV,
float   aspect,
float   nearFactor,
float   farFactor
 

Sets all Cameras to the specified viewing parameters. Useful at application startup or reset. This stores a copy of the camera settings so it can be easily reset later with AllCamsResetToOrig().

Parameters:
worldMin   minimum corner of axis-aligned bounding box of the world.
worldMax   maximum corner of axis-aligned bounding box of the world.
eye   starting location of the camera origin (eye)
lookAtCntr   starting world point to look towards (usually model center)
viewUp   starting world up vector (usually [0,1,0])
yFOV   vertical Field Of View in degrees.
aspect   pixel width / height.
nearFactor   distance to near plane as factor times world bounding sphere radius (sphere that surrounds the given (WorldMin,WorldMax).
farFactor   distance to far plane as factor times world bounding sphere radius (sphere that surrounds the given (WorldMin,WorldMax).
NOTE: eye cannot equal lookAtCntr!!

void QGLVUWidget::SetCurrentCam Camera *   pNewCam [inline]
 

Sets the active camera.

Parameters:
pNewCam   the new camera to set.
NOTE: The new camera will not be owned by the QGLVUWidget. This sets the current camera temporarily to pNewCam.

void QGLVUWidget::SetFPSIntegrateInterval float   rInterval [inline]
 

Sets the interval over which frame time is integrated and then averaged to calculate FPS. This sets how often the averaging and updates occur.

void QGLVUWidget::SetInOutMode bool   bMode [inline]
 

Sets the navigation mode to either "inside looking out" (true) or "outside looking in" (false, the default). See SetInOutMode() and ToggleInOutMode().

void QGLVUWidget::SetInertiaDelay int   iMilliseconds [inline]
 

Sets the time delay (secs) between Inertia events.

void QGLVUWidget::SetInertiaEnabled bool   bEnable [inline]
 

Enables or disables Inertia functionality.

void QGLVUWidget::SetInertiaMinMove int   iAmount [inline]
 

Sets the minimum number of pixels the mouse must be moved (with LeftButton pressed) in order to invoke Inertia.

void QGLVUWidget::SetInertiaOn bool   bEnable
 

Activates Inertia. Normally only called internally in response to mouse action.

void QGLVUWidget::SetInitializeGL void(*   f)(QGLVUWidget *)
 

Sets the active initializeGL function to the function pointed to by f. By default initializeGL() calls DefaultInitializeGL().

void QGLVUWidget::SetOrigCam Camera *   pCam
 

Stores a copy of pCam so that Cameras can be reset to its parameters at a later time using AllCamsResetToOrig().

void QGLVUWidget::SetPaintGL void(*   f)(QGLVUWidget *)
 

Sets the active paintGL function to the function pointed to by f. By default paintGL() calls DefaultPaintGL().

void QGLVUWidget::SetPathFilename const char *   pFilename
 

Sets the filename to be used for path recording and playback to pFilename

void QGLVUWidget::SetResizeGL void(*   f)(QGLVUWidget *, int, int)
 

Sets the active resizeGL function to the function pointed to by f. By default resizeGL() calls DefaultResizeGL().

void QGLVUWidget::SetViewUp Vec3f   viewup [inline]
 

Sets the global "up" vector.

void QGLVUWidget::SetWorldCenter const Vec3f &   center [inline]
 

Sets the global "center" of the world.

int QGLVUWidget::SetWorldNavMode WorldNavMode   mode [inline, slot]
 

Sets the current World Navigation mode.

mode may be one of:

  • NAV_MODE_TRACKBALL: a simple trackball.
  • NAV_MODE_HYPERBALL: an "SGI-style trackball, with different rotation at the outside of the window than in the middle.
  • NAV_MODE_DRIVE: Left / Right to steer, Up / Down to move fore and aft.
  • NAV_MODE_TRANSLATE: translate the camera parallel to the view plane.
  • NAV_MODE_LOOK: Rotation about a fixed eye position.

void QGLVUWidget::SetWorldRadius float   newRadius [inline]
 

Sets the global "radius" of the world.

void QGLVUWidget::SnapShot  
 

Captures the current front GL draw buffer, and stores it as a PNG image. The image will have a filename of the form "snapNNNN.png", where "NNNN" is a zero-padded integer starting at 0000 and incrementing to avoid overwriting existing files.

void QGLVUWidget::StartFPSClock   [inline]
 

Starts the frame timer and resets the frame counter.

void QGLVUWidget::StartPlayback  
 

Begins path playback from the path file specified via SetPathFilename(). Updates the positions and orientations of all four Cameras.

void QGLVUWidget::StartRecording  
 

Begins path recording. Records the position and orientation of all four Cameras to the file specified with SetPathFilename(), or to "path0.dat" if none is specified.

void QGLVUWidget::StopFPSClock   [inline]
 

Stops the frame timer.

void QGLVUWidget::StopRecordingPlayback  
 

Stops both Camera path recording and playback if either is active.

bool QGLVUWidget::ToggleCamDisplay int   whichCam [slot]
 

Toggle the display flag for the camera specified in whichCam

void QGLVUWidget::ToggleCullFace   [slot]
 

Toggles culling between front and back face culling.

bool QGLVUWidget::ToggleFaceCulling   [slot]
 

Toggles face culling on and off.

bool QGLVUWidget::ToggleInOutMode   [slot]
 

Toggles the display mode between "inside looking out" and "outside looking in".

bool QGLVUWidget::ToggleLighting   [slot]
 

Toggles lighting on and off.

bool QGLVUWidget::ToggleMaterials   [slot]
 

Enables and disables "GL_COLOR_MATERIAL".

bool QGLVUWidget::ToggleSmoothShading   [slot]
 

Toggles between smooth and flat shading.

void QGLVUWidget::TrackBallX int   iOldX,
int   iNewX,
int   iWW
 

Rotates the active Camera about the center of the world around either the world "up" vector or the Camera "up" vector, depending on whether or not the navigation mode is set to "Inside Looking Out" mode (ToggleInOutMode()). Motion is based on mouse movement.

void QGLVUWidget::TrackBallY int   iOldY,
int   iNewY,
int   iWH
 

Rotates the active Camera about the center of the world around its side axis based on mouse movement.

void QGLVUWidget::TranslateX int   iOldX,
int   iNewX,
int   iWW
 

Translates the active camera in the X direction based on mouse movement.

void QGLVUWidget::TranslateY int   iOldY,
int   iNewY,
int   iWH
 

Translates the active camera in the Y direction based on mouse movement.

void QGLVUWidget::UpdateFPS  
 

If FPS calculation is enabled (StartFPSClock()), then this function updates the current Frames Per Second calculation. Call only if you are not using the default implementation of BeginFrame().

bool QGLVUWidget::_DoInertia   [protected]
 

Calls the inertia function using temporary copies of the mouse position.

Returns false if inertia is disabled, true otherwise.

void QGLVUWidget::_DoRecordAndPlayback   [protected]
 

Writes all Cameras to the path file if recording is on.

Reads all Cameras from the path file if playback is on.

void QGLVUWidget::_Inertia int   x,
int   y
[protected, virtual]
 

This function can be reimplemented in a subclass to perform custom inertia behavior.

Sends a fake mouse event when called. Used by the inertia system to move objects when they are "flung" with the mouse.

void QGLVUWidget::initializeGL   [protected, virtual]
 

This virtual function is called one time before the first call to paintGL() or resizeGL(), and then one time whenever the widget has been assigned a new QGLContext. Reimplement it in a subclass.

This function should take care of setting any required OpenGL context rendering flags, defining display lists, etc.

There is no need to call makeCurrent() because this has already been done when this function is called. QGLVU EXCEPTION: If you are using non-Qt GL contexts, such as with pbuffers, you will want to call DoneCurrent() after using the outside context and before initializeGL() is called. Otherwise you can call MakeContextCurrent() inside initializeGL().

void QGLVUWidget::keyPressEvent QKeyEvent *   pEvent [protected, virtual]
 

This event handler can be reimplemented in a subclass to receive key press events for the widget.

A widget must call setFocusPolicy() to accept focus initially and have focus in order to receive a key press event.

If you reimplement this handler, it is very important that you ignore() the event if you do not understand it, so that the widget's parent can interpret it.

The default implementation closes popup widgets if you hit escape. Otherwise the event is ignored.

See also keyReleaseEvent(), QKeyEvent::ignore(), setFocusPolicy(), focusInEvent(), focusOutEvent(), event() and QKeyEvent.

void QGLVUWidget::keyReleaseEvent QKeyEvent *   pEvent [protected, virtual]
 

This event handler can be reimplemented in a subclass to receive key release events for the widget.

A widget must accept focus initially and have focus in order to receive a key release event.

If you reimplement this handler, it is very important that you ignore() the release if you do not understand it, so that the widget's parent can interpret it.

The default implementation ignores the event.

See also keyPressEvent(), QKeyEvent::ignore(), setFocusPolicy(), focusInEvent(), focusOutEvent(), event() and QKeyEvent.

void QGLVUWidget::mouseDoubleClickEvent QMouseEvent *   pEvent [protected, virtual]
 

This event handler can be reimplemented in a subclass to receive mouse double click events for the widget.

The default implementation (which this calls) generates a normal mouse press event.

Note that the widgets gets a mousePressEvent() and a mouseReleaseEvent() before the mouseDoubleClickEvent().

See also mousePressEvent(), mouseReleaseEvent(), mouseMoveEvent(), and QMouseEvent.

void QGLVUWidget::mouseMoveEvent QMouseEvent *   pEvent [protected, virtual]
 

This event handler can be reimplemented in a subclass to receive mouse move events for the widget.

If mouse tracking is switched off, mouse move events only occur if a mouse button is down while the mouse is being moved. If mouse tracking is switched on, mouse move events occur even if no mouse button is down.

QMouseEvent::pos() reports the position of the mouse cursor, relative to this widget. For press and release events, the position is usually the same as the position of the last mouse move event, but it might be different if the user moves and clicks the mouse fast. This is a feature of the underlying window system, not Qt.

In QGLVUWidget, this method updates the old and new mouse (pressed) positions if a button is pressed, and if the button is the left button, it performs Camera movement based on the active WorldNavMode (SetWorldNavMode()).

See also setMouseTracking(), mousePressEvent(), mouseReleaseEvent(), mouseDoubleClickEvent(), and QMouseEvent.

void QGLVUWidget::mousePressEvent QMouseEvent *   pEvent [protected, virtual]
 

This event handler can be reimplemented in a subclass to receive mouse press events for the widget.

Currently this event stores the button state and the previous and new mouse positions. If the button is the left button, it deactivates inertia.

See also mouseReleaseEvent(), mouseDoubleClickEvent(), mouseMoveEvent(), and QMouseEvent

void QGLVUWidget::mouseReleaseEvent QMouseEvent *   pEvent [protected, virtual]
 

This event handler can be reimplemented in a subclass to receive mouse press events for the widget.

Currently this event measures the amount of movement between the last two events if the left button was pressed, and if it is greater than the inertia movement threshold, it activates inertia. If this is the case, it stores the button state before the event. If it is false or the right button was pressed, it stores the button state after the event.

See also mousePressEvent(), mouseDoubleClickEvent(), mouseMoveEvent(), and QMouseEvent

void QGLVUWidget::paintGL   [protected, virtual]
 

This virtual function is called whenever the widget needs to be painted. Reimplement it in a subclass.

There is no need to call makeCurrent() because this has already been done when this function is called. QGLVU EXCEPTION: If you are using non-Qt GL contexts, such as with pbuffers, you will want to call DoneCurrent() after using the outside context and before paintGL() is called. Otherwise you can call MakeContextCurrent() inside paintGL().

void QGLVUWidget::resizeGL int   iw,
int   ih
[protected, virtual]
 

This virtual function is called whenever the widget has been resized. Reimplement it in a subclass.

There is no need to call makeCurrent() because this has already been done when this function is called. QGLVU EXCEPTION: If you are using non-Qt GL contexts, such as with pbuffers, you will want to call DoneCurrent() after using the outside context and before resizeGL() is called. Otherwise you can call MakeContextCurrent() inside resizeGL().

void QGLVUWidget::timerEvent QTimerEvent *   pEvent [protected, virtual]
 

This event handler can be reimplemented in a subclass to receive timer events for the object.

This default timerEvent processes inertia and camera recording and playback.

QTimer provides a higher-level interface to the timer functionality, and also more general information about timers.

See also startTimer(), killTimer(), killTimers() and event().

void QGLVUWidget::wheelEvent QWheelEvent *   pEvent [protected, virtual]
 

This event handler can be reimplemented in a subclass to receive wheel events for the widget.

If you reimplement this handler, it is very important that you ignore() the event if you do not handle it, so that the widget's parent can interpret it.

The default implementation ignores the event.

See also QWheelEvent::ignore(), QWheelEvent::accept(), event() and QWheelEvent.


The documentation for this class was generated from the following files:
Generated at Fri Oct 12 15:12:23 2001 for GLVU by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001