Main Page   Class Hierarchy   Compound List   Compound Members  

QGLViewer Class Reference

An OpenGL viewer based on QGLWidget. Provides a moving camera and snapshot facilities. More...

List of all members.

Display of visual hints

bool axisIsDrawn () const
bool gridIsDrawn () const
bool fpsIsDisplayed () const
bool textIsEnabled () const
bool cameraPathIsEdited () const
bool isFullScreen () const
bool displaysInStereo () const
void toggleDrawAxis ()
void toggleDrawGrid ()
void toggleDisplayFPS ()
void toggleEnableText ()
void toggleCameraPathEditor ()
void toggleFullScreen ()
void toggleStereoDisplay ()
void setDrawAxis (bool f=true)
void setDrawGrid (bool f=true)
void setDisplayFPS (bool f=true)
void setEnableText (bool f=true)
void editCameraPath (bool edit=true)
void setFullScreen (bool f=true)
void setStereoDisplay (bool f=true)

Display functions

void drawAxis (float scale=1.0)
void drawGrid ()
virtual void startScreenCoordinatesSystem () const
virtual void stopScreenCoordinatesSystem () const
virtual void drawLight (GLenum light)
virtual void displayFPS () const
void drawText (GLfloat x, GLfloat y, const char *text, GLfloat height=15.0) const
void draw3DText (const qglviewer::Vec &pos, const qglviewer::Vec &normal, const QString &string, GLfloat height=0.1) const

Scene related parameters and methods

float aspectRatio () const
float sceneRadius () const
void getSceneCenter (float &x, float &y, float &z) const
qglviewer::Vec sceneCenter () const
void getRevolveAroundPoint (float &x, float &y, float &z) const
qglviewer::Vec revolveAroundPoint () const
qglviewer::ManipulatedFramemanipulatedFrame () const
float currentFPS ()
qglviewer::Camera camera
void setSceneRadius (float r)
void setSceneCenter (const qglviewer::Vec &sc)
void setSceneCenter (float x, float y, float z)
void showEntireScene ()
void setManipulatedFrame (qglviewer::ManipulatedFrame *fr)

Snapshots

const QString & snapshotFilename () const
const QString & snapshotFormat () const
void saveSnapshot (bool automatic=false)
void setSnapshotFilename (const QString &n)
void setSnapshotFormat (const QString &f)

Animation

bool animationIsStarted () const
int animationPeriod () const
void setAnimationPeriod (int msecs)
virtual void startAnimation (int msecs=-1)
virtual void stopAnimation ()
void toggleAnimationMode ()

Key customization

enum  ShortcutAction {
  DrawAxis, DrawGrid, DisplayFPS, EnableText, Exit, SaveScreenshot,
  CameraMode, FullScreen, Stereo, Animation, Help, EditCameraPaths
}
enum  MouseBehavior { CAMERA, FRAME }
virtual void setShortcutKey (ShortcutAction action, int key)
virtual void setShortcutStateKey (ShortcutAction action, ushort skey)
Qt::Key shortcutKey (const ShortcutAction action) const
Qt::ButtonState shortcutStateKey (ShortcutAction action) const
virtual void setKeyFrameKey (int nb, int key)
virtual void setAddKeyFrameStateKey (ushort skey)
virtual void setPlayKeyFramePathStateKey (ushort skey)
virtual void setDeleteKeyFrameStateKey (ushort skey)
Qt::Key keyFrameKey (int nb)
Qt::ButtonState addKeyFrameStateKey ()
Qt::ButtonState playKeyFramePathStateKey ()
Qt::ButtonState deleteKeyFrameStateKey ()
virtual void setMouseStateKey (MouseBehavior behavior, ushort skey)
Qt::ButtonState mouseStateKey (MouseBehavior behavior) const

Signals

void message (const QString &)
void viewerInitialized ()
void drawNeeded ()
void animateNeeded ()
void helpRequired ()
void axisDrawn (bool on)
void gridDrawn (bool on)
void fpsDisplayed (bool on)
void textEnabled (bool on)
void cameraPathEdited (bool on)
void fullScreenChanged (bool on)
void stereoChanged (bool on)

Public Methods

 QGLViewer (QWidget *parent=NULL, const char *name=0, const QGLWidget *shareWidget=0, WFlags f=0)
 QGLViewer (const QGLFormat &format, QWidget *parent=0, const char *name=0, const QGLWidget *shareWidget=0, WFlags f=0)
virtual ~QGLViewer ()
virtual void select (QMouseEvent *)
 Temp ! Change ! Kept for backward compatibility - Removed in version 1.3.

void selectWarning ()
 Temp ! Change ! select warning message - Removed in version 1.3. More...

void convertClickToLine (const QMouseEvent *, float orig[3], float dir[3]) const
void convertClickToLine (const QMouseEvent *, qglviewer::Vec &orig, qglviewer::Vec &dir) const
Save and restore state
virtual void saveToFile (const QString &fileName="")
virtual void restoreFromFile (const QString &fileName="")
virtual QDomElement domElement (const QString &name, QDomDocument &doc) const
virtual void initFromDOMElement (const QDomElement &de)

Static Public Methods

Static methods for all the viewers
All the created QGLViewers are stored in a pool. These methods allow you to use this pool.

void connectSignalToAllViewers (const QObject *sender, const char *signal, const char *member=SLOT(updateGL()))
void disconnectSignalToAllViewers (const QObject *sender, const char *signal, const char *member=SLOT(updateGL()))
void updateGLForAllViewers ()
void saveToFileForAllViewers ()

Protected Types


Protected Methods

virtual void resizeGL (int w, int h)
virtual void initializeGL ()
virtual void init ()
virtual void help ()
virtual void paintGL ()
virtual void preDraw ()
virtual void preDrawStereo (bool leftBuffer=true)
virtual void draw ()
virtual void fastDraw ()
virtual void postDraw ()
virtual void animate ()
QWidget * rootWidget () const
OpenGL matrices
virtual void loadProjectionMatrix (bool reset=true) const
virtual void getProjectionMatrix (float *m) const
virtual void getProjectionMatrix (double *m) const
virtual void loadModelViewMatrix (bool reset=true) const
virtual void getModelViewMatrix (GLdouble m[16]) const
virtual void getModelViewMatrix (GLfloat m[16]) const
Mouse and keyboard handlers
virtual void mousePressEvent (QMouseEvent *)
virtual void mouseDoubleClickEvent (QMouseEvent *)
virtual void mouseReleaseEvent (QMouseEvent *)
virtual void mouseMoveEvent (QMouseEvent *)
virtual void wheelEvent (QWheelEvent *)
virtual void timerEvent (QTimerEvent *)
virtual void keyPressEvent (QKeyEvent *)


Detailed Description

An OpenGL viewer based on QGLWidget. Provides a moving camera and snapshot facilities.

To use it, you can derive a class from it and overload the draw() virtual method. See the simpleViewer example for an introduction.

  // The Viewer class inherits from QGLViewer and overloads the draw function.
  class Viewer : public QGLViewer
  {
    Q_OBJECT // Include this if you use Qt signals/slots
  public:
    Viewer()
      : QGLViewer()
      {}
      
  protected:
    virtual void draw();
    {
    // Your OpenGL drawing code goes here...
    }
  };

An other method is to connect your drawing methods to the signals emited by the QGLViewer (clean callback mechanism). See the callback example for a complete example.

 // A Scene class holds the scene data and provides a drawScene() function.
 class Scene : public QObject
 {
   Q_OBJECT // Needed in order to use the Qt signals/slots mechanism
  
   public :
     Scene(const QGLViewer* const v);
  
   public slots:
     void drawScene();
 };

 Scene::Scene(const QGLViewer* const viewer)
 : QObject()
 {
   // Connect the viewer signal to our draw function slot
   connect(viewer, SIGNAL(drawNeeded()), this, SLOT(drawScene()));
 }
The mouse and keyboard behaviors are defined with default values. Redefine the shortcuts or overload the methods to define your own behavior.

Many functionalities are implemented : snapshots savings, camera displacement with keyFramed paths, manipulated frames with hierarchies and constraints. Try the numerous simple examples to discover the possibilities and understand how it works.


Member Enumeration Documentation

enum MouseBehavior [protected]
 

Defines the different mouse behavior modes : Camera or Frame motion. Use mouseStateKey() and setMouseStateKey() to select which key must be pressed to enable each one. See the mouse page for details.

enum ShortcutAction [protected]
 

Defines the different actions that can directly be associated with a keyboard shortcut. Used by setShortcutKey(), setShortcutStateKey(), shortcutKey() and shortcutStateKey().

See the QGLViewer shortcuts page for details.


Constructor & Destructor Documentation

QGLViewer QWidget *    parent = NULL,
const char *    name = 0,
const QGLWidget *    shareWidget = 0,
WFlags    f = 0
 

Set default display flags (all false), initializes camera and other parameters. Calls the QGLWidget constructor with the same parameters. Calls Camera::setDistanceToScreen(4.0) and Camera::setPhysicalScreenWidth(10.0) when screen aspect ratio > 2 (Reality Center).

QGLViewer const QGLFormat &    format,
QWidget *    parent = 0,
const char *    name = 0,
const QGLWidget *    shareWidget = 0,
WFlags    f = 0
 

Set default display flags (all false), initializes camera and other parameters. format is used to ask for specific GL context properties. Calls the QGLWidget constructor with the same parameters. Calls Camera::setDistanceToScreen(4.0) and Camera::setPhysicalScreenWidth(10.0) when screen aspect ratio > 2 (Reality Center).

virtual ~QGLViewer   [inline, virtual]
 

Virtual destructor. Remove object from QGLViewer pool (see updateGLForAllViewers()) and calls saveToFile().


Member Function Documentation

Qt::ButtonState addKeyFrameStateKey   [protected]
 

Returns the state key (Qt::AltButton, Qt::ShiftButton, Qt::ControlButton) that must be pressed with the keyFrameKey() to add a KeyFrame to a camera KeyFrame path. Default value is Qt::AltButton. See setAddKeyFrameStateKey() for details.

See also keyFrameKey(), playKeyFramePathStateKey() and deleteKeyFrameStateKey().

See the QGLViewer shortcuts page for details.

virtual void animate   [inline, protected, virtual]
 

Scene animation function. Once startAnimation() has been called, an infinite loop calls animate() and draw().

void animateNeeded   [signal]
 

Signal emitted by the default QGLViewer::animate() function. Connect this signal to your scene animation function.

Use this signal-slot mechanism ONLY IF you don't inherit your viewer from QGLViewer (in that case, simply overload the animate() function).

bool animationIsStarted   const [inline]
 

Return true when the animation loop is started, i.e. viewer calls animate() and draw(). See startAnimation() and animate()

int animationPeriod   const [inline]
 

The animation loop period, in milliseconds. See startAnimation() and animate().

float aspectRatio   const [inline]
 

Returns the aspect ratio of the GL widget. That is the ratio between its width and height (see the QGLWidget documentation).

void axisDrawn bool    on [signal]
 

This signal is emitted whenever axisIsDrawn() changes value. This can be done with setDrawAxis() or toggleDrawAxis().

bool axisIsDrawn   const [inline]
 

Returns true if the world axis is drawn by the viewer. Set by setDrawAxis() or toggleDrawAxis().

void cameraPathEdited bool    on [signal]
 

This signal is emitted whenever cameraPathIsEdited() changes value. This can be done with editCameraPath() or toggleCameraPathEditor().

bool cameraPathIsEdited   const [inline]
 

Returns true if the camera paths are being edited in the viewer. Set by editCameraPath() or toggleCameraPathEditor() (C key shortcut).

void connectSignalToAllViewers const QObject *    sender,
const char *    signal,
const char *    member = SLOT(updateGL())
[static]
 

Connect a signal to a signal or a slot of all the QGLViewers.

Typical usage would be:

connectSignalToAllViewers(myScene, SIGNAL(needsRedisplay));

The default target signal is updateGL(), but any other signal/slot can be used. This function will silently ignore the connections that cannot be established.

See also disconnectSignalToAllViewers() and updateGLForAllViewers().

void convertClickToLine const QMouseEvent *    e,
qglviewer::Vec   orig,
qglviewer::Vec   dir
const
 

This function should be called by your select() function to transform a window x,y coordinate to a (world coordinates) half line, for analytical intersection process.

The origin of the half line (eye position) is stored in orig, while dir contains the properly oriented and normalized direction of the half line.

See the select example for illustration.

void convertClickToLine const QMouseEvent *    e,
float    orig[3],
float    dir[3]
const
 

Same as convertClickToLine(), but the result is returned as a float[3].

float currentFPS   [inline]
 

Returns the current viewer frame rate, as displayed by displayFPS() (see setDisplayFPS() and toggleDisplayFPS()).

This function is useful for true real-time applications that may adapt the computationnal load according to frame rate evolution in order to maintain a given frequency.

Note that for stability reasons this value is averaged over 25 frames, and hence will only change every 25 frames. As Qt redraws the window only when needed, this value is meaningfull only when startAnimation() is called, when you use Camera::playKeyFramePath() or when the camera is manipulated with the mouse, so that draw() is called in a loop.

Qt::ButtonState deleteKeyFrameStateKey   [protected]
 

Returns the state key (Qt::AltButton, Qt::ShiftButton, Qt::ControlButton) that must be pressed with the keyFrameKey() to delete a camera KeyFrame path. Default value is Qt::ControlButton.

Once a path has been delete, trying to re-play the path (using keyFrameKey() and playKFStateKey()) will do nothing until new key frames are added (using keyFrameKey() and addKeyFrameStateKey()). Use setDeleteKeyFrameStateKey() to change this value.

See the QGLViewer shortcuts page for details.

void disconnectSignalToAllViewers const QObject *    sender,
const char *    signal,
const char *    member = SLOT(updateGL())
[static]
 

Disconnect a signal to a signal or a slot of all the QGLViewers. Used in conjunction with connectSignalToAllViewers().

The default target signal is updateGL(), but any other signal/slot can be used. This function will silently ignore the connections that cannot be removed. See also updateGLForAllViewers().

virtual void displayFPS   const [inline, protected, virtual]
 

Display the frame rate in the lower left corner. The frame rate is computed as an average and updateGL() must be called in a loop in order to have a meaningfull value (this is the case when animationIsStarted()). The FPS display can be toggled with toggleDisplayFPS() or with setDisplayFPS(). See also currentFPS().

bool displaysInStereo   const [inline]
 

Returns true if the viewer displays in stereo. Set by setStereoDisplay() or toggleStereoDisplay(). Default value is false.

QDomElement domElement const QString &    name,
QDomDocument &    doc
const [virtual]
 

Creates an XML QDomElement that represents the QGLViewer. name is the name of the QDomElement tag. You need to provide the QDomDocument doc that will hold the resulting element.

Use initFromDOMElement() to restore the QGLViewer state from the resulting domElement. Merges the ManipulatedFrame::domElement(), Camera::domElement(), ... elements.

Attention:
For the manipulatedFrame(), Frame::constraint() and Frame::referenceFrame() are not saved. See Frame::domElement().

void draw   [protected, virtual]
 

The core function of the viewer, called to draw the scene.

If you build a class that inherits from QGLViewer, this is the function you want to overload. See the simpleViewer example for an illustration.

If you choose to use a callback mechanism instead, the default behavior of this function is to emit the drawNeeded() signal, which can be connected to your draw function. See the callback example for details.

Attention:
The GL_PROJECTION matrix must not be changed by this function, so that the viewer hints (axis, grid, FPS...) that are displayed in postDraw() are correctly displayed. Use push/pop or call camera.loadProjectionMatrix() at the end of draw() if you need to change the projection matrix (unlikely). The GL_MODELVIEW matrix can be changed and left in a different state as it will be reloaded in postDraw() anyhow.

void draw3DText const qglviewer::Vec   pos,
const qglviewer::Vec   normal,
const QString &    string,
GLfloat    height = 0.1
const [protected]
 

Similar to drawText(), but the text is considered as a classical object of the 3D scene.

pos and normal respectly represent the 3D coordinate of the text and the normal to the text plane. They are expressed with respect to the current GL_MODELVIEW matrix.

height is the text height, expressed in openGL scene units (measured when the text is in the screen plane).

void drawAxis float    size = 1.0
 

Displays an XYZ axis, with a given size (default is 1.0). The axis is not attached to a specific frame(), and its position only depends on the current modelview matrix.

  glPushMatrix();
  glTranslatef(x,y,z);
  glRotatef(90.,0.,1.,0.);
  drawAxis(0.2);
  glPopMatrix();
Or using a Frame():
  glPushMatrix();
  glMultMatrixd(frame.matrix());
  drawAxis(0.2);
  glPopMatrix();

Note:
The current matrix mode should be GL_MODELVIEW.

void drawGrid   [inline]
 

Displays a XY grid. The calling function should set the modelView matrix and scale factor before calling this function.

void drawLight GLenum    light [protected, virtual]
 

This debugging function draws a representation of light. The drawing depends on the type of light (spot, directionnal...). Typically used in your draw function:

  drawLight(GL_LIGHT0)

void drawNeeded   [signal]
 

Signal emitted by the default QGLViewer::draw() function. Connect this signal to your main drawing function. preDraw() is called before this signal is emited and will call loadProjectionMatrix() and loadModelViewMatrix() to set the viewing matrices. postDraw() will be called after this signal is answered. pre (resp. post) draw can be tuned by adding code at the beginning (resp. end) of your draw slot.

You can check whether the camera is manipulated to call a fast draw version :

   if (viewer.camera->isManipulated())
   fastDrawMethod();
   else
   normalDrawMethod();

Use this signal-slot mechanism ONLY IF you don't inherit your viewer from QGLViewer (in that case, simply overload the draw() and fastDraw() function).

void drawText GLfloat    x,
GLfloat    y,
const char *    text,
GLfloat    height = 15.0
const [protected]
 

Draws a text at position x, y (in pixels), with a given scale (in pixels). Can be called in draw() to easily display some information on the screen.

Text is displayed only when isTextEnabled() returns true (default). Use toggleEnableText() or setEnableText() to change this value (default shortcut key is '?'). This mechanism allows the user to conveniently remove all the displayed text with a shortcut key. Set the shortcut key to 0 if you want to forbid this behavior.

This function can be used in conjunction with the Camera::projectedCoordinatesOf() function to display a text attached to an object. In your draw() function call:

   qglviewer::Vec screenPos = camera.projectedCoordinatesOf(myFrame.position());
   drawText(screenPos[0], screenPos[1], "My Object");

Text is displayed using the GLUT glutStrokeCharacter() function. The GL_MODELVIEW and GL_PROJECTION matrices are not modified by this function.

The (0,0) coordinates is the lower left corner of the window. See startScreenCoordinatesSystem() for details.

See also the draw3DText() function.

Note:
Each call to drawText() changes the camera projection matrix and restores it back (using startScreenCoordinatesSystem() and stopScreenCoordinatesSystem()). If you call this function several times and it slows down your frame rate, consider factorizing the context changes. You may also want to try the QT image overlay mechanism which may be more efficient when your text does not change over time).

void editCameraPath bool    edit = true [inline, slot]
 

Start (default, edit=\p true) or stop (edit=\p false) the edition of the camera paths. Default viewer value is false. See also toggleCameraPathEditor().

void fastDraw   [protected, virtual]
 

Fast draw of the scene. Called instead of draw() when the camera is manipulated. Usefull for interactive displacements in a complex scene. Default behavior calls draw(). See the fastDraw exemple for an illustration.

void fpsDisplayed bool    on [signal]
 

This signal is emitted whenever fpsIsDisplayed() changes value. This can be done with setDisplayFPS() or toggleDisplayFPS().

bool fpsIsDisplayed   const [inline]
 

Returns true if a displayFPS() is called by the viewer. Set by setDisplayFPS() or toggleDisplayFPS(). See currentFPS().

void fullScreenChanged bool    on [signal]
 

This signal is emitted whenever isFullScreen() changes value. This can be done with setFullScreen() or toggleFullScreen().

virtual void getModelViewMatrix GLfloat    m[16] const [inline, protected, virtual]
 

Simply calls Camera::getModelViewMatrix(). Usefull for inheriting classes as it is a protected Camera method.

virtual void getModelViewMatrix GLdouble    m[16] const [inline, protected, virtual]
 

Simply calls Camera::getModelViewMatrix(). Usefull for inheriting classes as it is a protected Camera method.

virtual void getProjectionMatrix double *    m const [inline, protected, virtual]
 

Simply calls Camera::getProjectionMatrix(). Usefull for inheriting classes as it is a protected Camera method.

virtual void getProjectionMatrix float *    m const [inline, protected, virtual]
 

Simply calls Camera::getProjectionMatrix(). Usefull for inheriting classes as it is a protected Camera method.

void getRevolveAroundPoint float &    x,
float &    y,
float &    z
const [inline]
 

float version of revolveAroundPoint().

void getSceneCenter float &    x,
float &    y,
float &    z
const
 

float version of sceneCenter().

void gridDrawn bool    on [signal]
 

This signal is emitted whenever gridIsDrawn() changes value. This can be done with setDrawGrid() or toggleDrawGrid().

bool gridIsDrawn   const [inline]
 

Returns true if a grid is drawn by the viewer. Set by setDrawGrid() or toggleDrawGrid().

void help   [protected, virtual]
 

This function is called when the user presses the HELP_KEY (default is H). It should display a brief help or start a more complex help browser.

The default behavior (defined in QGLViewer::help()) is to display a short description of the different key and mouse bindings and emits the helpRequired() signal. You can add your own shortcuts description with this kind of code:

  QGLViewer::help();
  cout << "Z\tSet the foo to zero" << endl;
  cout << "O\tChanges default output" << endl;
  ...

void helpRequired   [signal]
 

Signal emitted by the default QGLViewer::help() function. Connect this signal to your own help function.

Use this signal-slot mechanism ONLY IF you don't inherit your viewer from QGLViewer (in that case, simply overload the help() function).

virtual void init   [inline, protected, virtual]
 

Initialisation of the viewer. Called in initializeGL(), before the first drawing. Can be used to set the camera (Camera::setPosition(), Camera::setFieldOfView(), ...) or to make the camera fit the scene (see Camera::showEntireScene()). OpenGL flags can also be (re)defined here. Default flags are set in initializeGL() but only the glEnable(GL_COLOR_MATERIAL) is not set to the OpenGL default value.

Attention:
You should not call updateGL() (or any function that calls it) in this function, as it will create an infinite loop (this comes from the QT initializeGL() function). The different QGLViewer set function (setDrawGrid(), setDrawAxis()...) are protected against this problem and can safely be called.
Attention:
This function should only be used for viewer dependent initializations (camera, openGL state). Other data initialisations (program parameters parsing, scene dependent initializations...) should be made in a separate function, called by your main or any other initialization function. On the other hand, all the openGL specific initializations must be done in this function: the GL context is not yet created in your viewer constructor.

void initFromDOMElement const QDomElement &    de [virtual]
 

Restores the QGLViewer state from a QDomElement created by domElement(). See also Camera::initFromDOMElement(), ManipulatedFrame::initFromDOMElement().

Note:
isFullScreen() cannot be properly restored in constructor. It requires initializeGL() to be completed before.

void initializeGL   [protected, virtual]
 

Initialization of the GL context, creation of some viewer display lists. Calls init() at the end.

Defines the following default GL parameters :

glClearColor(0.2, 0.2, 0.2, 1.0);

glEnable(GL_LIGHT0);

glEnable(GL_LIGHTING);

glEnable(GL_DEPTH_TEST);

glEnable(GL_COLOR_MATERIAL);

init() is called at the end, and the openGL flags can be re-defined there. This function should not be overloaded. Use init() for viewer initialisation. In case of overloading, call QGLViewer::initializeGL() at the beginning of your new initializeGL() function.

bool isFullScreen   const [inline]
 

Returns true if the viewer is in fullScreen mode. Set by setFullScreen() or toggleFullScreen().

Qt::Key keyFrameKey int    nb [protected]
 

Returns the camera Key Frame path shortcut key for index nb. nb should not exceed Camera::nbPaths(). Default values are F1..F12 for indexes 0..11. See setKeyFrameKey() for details.

See also addKeyFrameStateKey(), playKeyFramePathStateKey() and deleteKeyFrameStateKey().

See the QGLViewer shortcuts page for details.

void keyPressEvent QKeyEvent *    e [protected, virtual]
 

Key pressed callback function. Some default keybindings are implemented. The different keys can easily be redefined using the associated static values (see the Static Protected Attributes section).

Overload this function to implement your own key behavior. You should call the original function in the default case of your switch to preserve the default viewer key bindings :

 void Viewer::keyPressEvent(QKeyEvent *e)
 {
   switch (e->key())
     {
       case Qt::Key_R : reset(); break;
       // and so on...
       default:
         QGLViewer::keyPressEvent(e);
     }
 }

virtual void loadModelViewMatrix bool    reset = true const [inline, protected, virtual]
 

Simply calls Camera::loadModelViewMatrix(). Usefull for inheriting classes as it is a camera protected Camera method.

virtual void loadProjectionMatrix bool    reset = true const [inline, protected, virtual]
 

Simply calls Camera::loadProjectionMatrix(). Usefull for inheriting classes as it is a camera protected Camera method.

qglviewer::ManipulatedFrame* manipulatedFrame   const [inline]
 

Returns the current manipulated frame, which will be applied the mouse motion when the shortcutKey() of ShortcutAction::Frame is pressed (default is Alt). Value is undefined when no frame has been associated with the viewer (by using setManipulatedFrame()).

void message const QString &    [signal]
 

Standard message transmission. Used for progress bar for instance

void mouseDoubleClickEvent QMouseEvent *    e [protected, virtual]
 

When the user double clicks on the mouse :

Left button aligns the camera viewing direction to the closest axis (if any).

Middle button fits the zoom so that the entire scene is visible (see setSceneRadius() and showEntireScene()).

Right button moves the camera such that the scene center is projected in the center of the screen.

void mouseMoveEvent QMouseEvent *    e [protected, virtual]
 

Maintaining a button pressed while moving the mouse updates the camera or the manipulated frame. See mousePressEvent() for a description of the different possible actions.

If you want to define your own mouse behavior, do something like this :

 void Viewer::mousePressEvent(QMouseEvent* e)
 {
   if ((e->state() & ~Qt::MouseButtonMask) == (Your personnal Shift/Control/Alt combinaison))
     myMouseBehavior = true;
   else
     QGLViewer::mousePressEvent(e);
 }

 void mouseMoveEvent(QMouseEvent *e)
 {
   if (myMouseBehavior)
     // Use e->x() and e->y() as you want...
   else
     QGLViewer::mouseMoveEvent(e);
 }

 void mouseReleaseEvent(QMouseEvent* e)
 {
   if (myMouseBehavior)
     myMouseBehavior = false;
   else
     QGLViewer::mouseReleaseEvent(e);
 }

Many other event handlers can be customized : mouseDoubleClickEvent(), wheelEvent(), mouseReleaseEvent()... See the Qt::QWidget protected members documentation for a complete list.

Use setMouseStateKey() if you simply want to change the state key associated with the default behavior. See also setShortcutKey() and setShortcutStateKey().

void mousePressEvent QMouseEvent *    e [protected, virtual]
 

There are two different mouse behaviors : camera or frame motion.

The behavior depends on the state keys (Shift, Alt...) that are pressed when the click occurs. The different state keys can be tuned using setMouseStateKey().

For camera and frame motion, there are two modes (see see Camera::mode() or ManipulatedFrame::Mode()) :

In REVOLVE mode :

Left button rotates the scene around revolveAroundPoint(). Spining is possible with a fast motion. Middle button and whell changes the camera zoom. Right button translates the camera in the camera XY plane.

In FLY mode :

Left button changes the view direction and goes forward. Middle button changes the viewing direction. No motion. Right button changes the view direction and goes backward.

See the mouse behavior and customization HTML page for details.

See the mouseMoveEvent() documentation for an exemple of mouse behavior customization. Use the Qt::MouseButtonMask to separate the Control/Alt/Shift state key from the mouse (left/middle/right) buttons.

 if ((e->state() & ~Qt::MouseButtonMask) == MY_COMBINAISON_OF_Qt::ButtonState, Alt, Control, Shift)
    myBehaviorPressEvent(e);
 else
    QGLViewer::mousePressEvent(e);

void mouseReleaseEvent QMouseEvent *    e [protected, virtual]
 

When the user releases the mouse button, the camera action is stopped. If the action was a rotation (REVOLVE CameraMode), a continuous spining is possible if the speed of the cursor is large enough when the button is released. Press the rotate button again to stop the spining.

See the mouseMoveEvent() documentation for an exemple of mouse behavior customization.

Qt::ButtonState mouseStateKey MouseBehavior    behavior const [protected]
 

Returns the value of the key that should be pressed when clicking the mouse to select between the two mouse behaviors. The different mouse behaviors are represented in the MouseBehavior enum. The default values are Qt::NoButton for the Camera motion and Qt::AltButton for the Frame displacement.

The state key can be Qt::NoButton, Qt::ControlButton, Qt::ShiftButton, Qt::AltButton or any bitwise combinaison (& or |) of these (such as Qt::ControlButton & Qt::ShiftButton). This value can be changed with setMouseStateKey() to tune the behavior of the viewer.

See the QGLViewer mouse page for details.

void paintGL   [protected, virtual]
 

The paint method. Calls preDraw(), draw() (or fastDraw()) and postDraw() in that order. Should not be overloaded. Overload the internal functions instead.

If you choose to overload, the GL_Context must not be changed between two succesive calls to draw(), so that the user can feel free to set his/her openGL flags once for all.

If viewer displaysInStereo(), calls preDrawStereo(flag), draw(), postDraw(), first with flag = true and then flag = false to draw successively in left and right buffers.

Qt::ButtonState playKeyFramePathStateKey   [protected]
 

Returns the state key (Qt::AltButton, Qt::ShiftButton, Qt::ControlButton) that must be pressed with the keyFrameKey() to play a camera KeyFrame path. Default value is Qt::NoButton. See setPlayKeyFramePathStateKey() for details.

See also keyFrameKey(), addKeyFrameStateKey() and deleteKeyFrameStateKey().

See the QGLViewer shortcuts page for details.

void postDraw   [protected, virtual]
 

Done after draw(). Default behavior displays axis, grid, FPS... when the respective flags are enabled. The GLContext (color, LIGHTING, BLEND...) should not be changed by this function, so that in draw(), the user can rely on the OpenGL context. Respect this convention (by pushing/popping the different attributes) if you overload this function. Assumes the GL_PROJECTION matrix was not changed by draw(), reset the GL_MODELVIEW matrix.

void preDraw   [protected, virtual]
 

Called before draw(). Default behavior clears screen and set the projection and model view matrices :

  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);    

  // GL_PROJECTION matrix
  camera.loadProjectionMatrix();
  // GL_MODELVIEW matrix
  camera.loadModelViewMatrix();

void preDrawStereo bool    leftBuffer = true [protected, virtual]
 

Called before draw. Default behavior clear screen and pops camera model view matrix.

void resizeGL int    w,
int    h
[protected, virtual]
 

Called when the window size is modified. If you overide this function, be very careful to call first the inherited method.

  void Viewer::resizeGL( int w, int h )
  {
    QGLViewer::resizeGL(w,h);
    // ...
  }

void restoreFromFile const QString &    fileName = "" [virtual]
 

Restores the QGLViewer from a state saved in fileName with saveToFile().

If fileName is empty (default), the filename is automatically generated. See the saveToFile() documentation.

This function is automatically called in the QGLViewer constructor. As saveToFile() is automatically called when a viewer is destroyed, the previous viewer state is restored when you restart your application.

If you want some parameters (camera position for instance) to always be the same when your application is started, you should set their value directly in the init() function:

  camera.setPosition(0.0, 0.0, 3*sceneRadius());
  camera.setOrientation(Quaternion());

If you viewer starts with a black screen, remember that the mouse double clicks automatically fit the orientation, zoom and placement of the camera. If sceneCenter() and sceneRadius() are properly defined, you no longer should have an empty screen.

qglviewer::Vec revolveAroundPoint   const [inline]
 

When the camera is in REVOLVE mode (see mode()), this is the point the camera revolves around. Default value is the sceneCenter().

This method simply calls Camera::revolveAroundPoint().

QWidget * rootWidget   const [protected]
 

Recursively call parentWidget() until the root widget is found.

void saveSnapshot bool    automatic = false [slot]
 

Save a snapshot of the current image displayed by the widget. If no snapshot filename is defined (see snapshotFilename()) or if automatic is false, a file dialog is opened to ask for the filename.

Otherwise (automatic is true and there is a snapshot filename) the filename is the snapshot filename plus "-#", where # is an increasing number (using 4 digits). The image is then saved and if a dialog was opened, the snapshot filename is set to the filename that was choosen.

Save formats are those available in the QT installation, plus some vectorial formats (EPS, PS, fig).

Some artifacts may appear when displaying the PS and EPS result. Simply remove the antialias option in ghostview to get the correct display. Printed output will be fine. The libEPSRender library was written by Cyril Soler (Cyril.Soler@imag.fr).

void saveToFile const QString &    fileName = "" [virtual]
 

Saves in fileName an XML representation of the QGLViewer state, obtained from domElement(). Use restoreFromFile() to restore the viewer.

If no filename is provided (default), the generated filename will be ".qglviewer.xml". If several viewers were created in this application, the files will be numbered (".qglviewer0.xml, .qglviewer1.xml,...). Each viewer will then read back its own information in restoreFromFile(), provided that the viewers are created in the same order, which is usually the case.

This function is called by the QGLViewer destructor.

void saveToFileForAllViewers   [static]
 

Calls saveToFile() for all the created QGLViewers. Called when you press the Exit shortcut key (see setShortcutKey).

qglviewer::Vec sceneCenter   const [inline]
 

Scene should be included in a sphere centered on this point. See the Camera::sceneCenter() documentation.

float sceneRadius   const [inline]
 

Returns the scene radius (used by the camera to set Camera::zNear() and Camera::zFar()). The entire scene must be included in a sphere of radius sceneRadius(), centered on sceneCenter().

void selectWarning  
 

Temp ! Change ! select warning message - Removed in version 1.3.

select() is deprecated. Simply prints a message explaining how to implement objet selection.

void setAddKeyFrameStateKey ushort    skey [protected, virtual]
 

Defines the shortcut state key (Alt, Shift, Control) that must be pressed in conjuction with the keyFrameKey(i) to add a Key Frame to the camera Key Frame path of index i. Default state key is Qt::AltButton.

The state key can be set to Qt::NoButton, Qt::ControlButton, Qt::ShiftButton, Qt::AltButton, or a combinaison of these (use the bit '|' operator, see setMouseStateKey()).

Use setKeyFrameKey() to define the associated Key Frame key. See also setPlayKeyFramePathStateKey() and setDeleteKeyFrameStateKey().

See the QGLViewer shortcuts page for details.

void setAnimationPeriod int    msecs [inline, slot]
 

Set the period (in milliseconds) between the calls to animate(). Default is 40 msecs (25 Hz). The frame rate (keybinding 'F') will be set accordingly, provided that your animate() function is fast enough.

void setDeleteKeyFrameStateKey ushort    skey [protected, virtual]
 

Defines the shortcut state key (Alt, Shift, Control) that must be pressed in conjuction with the keyFrameKey(i) to delete the camera Key Frame path of index i. Default state key is Qt::ControlButton.

The state key can be set to Qt::NoButton, Qt::ControlButton, Qt::ShiftButton, Qt::AltButton, or a combinaison of these (use the bit '|' operator, see setMouseStateKey()).

Use setKeyFrameKey() to define the associated Key Frame key. See also setAddKeyFrameStateKey() and setPlayKeyFramePathStateKey().

See the QGLViewer shortcuts page for details.

void setDisplayFPS bool    f = true [inline, slot]
 

Set the state of fpsIsDisplayed(). displayFPS() is called or not. See also toggleDisplayFPS() and currentFPS().

void setDrawAxis bool    f = true [inline, slot]
 

Set the state of the axisIsDrawn(). World axis is drawn or not. See also toggleDrawAxis().

void setDrawGrid bool    f = true [inline, slot]
 

Set the state of the gridIsDrawn(). A XY grid is drawn or not. See also toggleDrawGrid().

void setEnableText bool    f = true [inline, slot]
 

Set the state of textIsEnabled() : drawText() and draw3DText() actually draw text or not (default is yes). See also toggleEnableText().

void setFullScreen bool    f = true [slot]
 

Viewer is set in full screen mode (true, default) or not (false). Get current value from isFullScreen(). See also toggleFullScreen() and its S shortcut key.

void setKeyFrameKey int    nb,
int    key
[protected, virtual]
 

Defines the shortcut key associated with the camera Key Frame path of index nb. The number of available indexes is returned by Camera::nbPaths(). The default keys are F1..F12 for indexes 0..11.

Use setAddKeyFrameStateKey(), setPlayKeyFramePathStateKey() and setDeleteKeyFrameStateKey() to define the state key that must be pressed with this key to add, play or delete the Key Frame.

Use setShortcutKey() to define other shortcut keys.

See the QGLViewer shortcuts page for details.

void setManipulatedFrame qglviewer::ManipulatedFrame   fr [slot]
 

The frame fr becomes the new manipulated frame. The manipulated frame will be moved with the mouse when the Alt key is pressed. You can change this using setMouseStateKey() with (QGLViewer::Frame, Qt::xxxButton) as arguments.

You can use a manipulated frame to move an object in the scene. Your code will look like this (see the manipulatedFrame exemple):

  void Viewer::init()
  {
    ManipulatedFrame* myFrame = new ManipulatedFrame();
    setManipulatedFrame(myFrame);
  }

  void draw()
  {
    glPushMatrix(); // Save previous state
    glMultMatrixd(myFrame->matrix());
    // Your object drawing code goes here
    glPopMatrix();  // Restore previous state
  }

Note that the camera can also be manipulated, just like a regular frame. Simply use:

The value of the currently manipulated frame is retrieved with manipulatedFrame().

void setMouseStateKey MouseBehavior    behavior,
ushort    skey
[protected, virtual]
 

Defines which key should be pressed when clicking the mouse to select one of the two mouse behaviors. The different mouse behaviors are represented in the MouseBehavior enum. The default values are Qt::NoButton for the Camera motion and Qt::AltButton for the manipulated Frame.

The state key can be set to Qt::NoButton, Qt::ControlButton, Qt::ShiftButton, Qt::AltButton or any bitwise combinaison (& or |) of these (such as Qt::ControlButton & Qt::ShiftButton). Use mouseStateKey() to get the current values. Set to 0 to forbid a given mouse behavior.

This exemple shows how to swap the camera and frame state keys:

  setMouseStateKey(QGLViewer::FRAME,  Qt::NoButton);
  setMouseStateKey(QGLViewer::CAMERA, Qt::AltButton);

With the following code, you will have to press the Alt and the Control key in order to move the camera:

  setMouseStateKey(QGLViewer::CAMERA, Qt::AltButton|Qt::ControlButton);

If you want to move the camera with the Alt or the Control key, you need to overload the mousePressEvent() function:

  if (((e->state() & ~Qt::MouseButtonMask) == Qt::AltButton) ||
      ((e->state() & ~Qt::MouseButtonMask) == Qt::ControlButton))
    camera.frame.mousePressEvent(e);
  else
    QGLViewer::mousePressEvent(e);

See the QGLViewer mouse page for details.

void setPlayKeyFramePathStateKey ushort    skey [protected, virtual]
 

Defines the shortcut state key (Alt, Shift, Control) that must be pressed in conjuction with the keyFrameKey(i) to start playing the camera Key Frame path of index i. Default state key is Qt::NoButton.

The state key can be set to Qt::NoButton, Qt::ControlButton, Qt::ShiftButton, Qt::AltButton, or a combinaison of these (use the bit '|' operator, see setMouseStateKey()).

Use setKeyFrameKey() to define the associated Key Frame key. See also setAddKeyFrameStateKey() and setDeleteKeyFrameStateKey().

See the QGLViewer shortcuts page for details.

void setSceneCenter float    x,
float    y,
float    z
[inline, slot]
 

float version of setSceneCenter().

void setSceneCenter const qglviewer::Vec   sc [inline, slot]
 

Set the center of the scene, defined in world coordinates. The entire scene should be include in a sphere of radius sceneRadius(), centered on sceneCenter(). Default value is (0,0,0), the world coordinate system origin.

This method should typically be called in the init() function, when the drawn scene is not centered on the world origin (so that sceneRadius(), Camera::zNear() and Camera::zFar() can be tightly fitted to the scene). It should normally not be modified after.

   Viewer::init()
   {
     setSceneCenter(10,20,0);
     setSceneRadius(3.0);
     showEntireScene();
   }

revolveAroundPoint() has a different meaning, and is probably the value you want to change while the program is running (see Camera::setRevolveAroundPoint()).

Attention:
The revolveAroundPoint() is set to the sceneCenter() value by this method.

void setSceneRadius float    r [inline, slot]
 

Scene radius is used by the camera to scale axis and grid display, and to optimally set Camera::zNear() and Camera::zFar(). The entire scene must be included in a sphere centered on sceneCenter(), with radius sceneRadius(). Current value can be retrieved from sceneRadius().

You will typically use this function in QGLViewer::init() :

By default the sceneRadius() is 1.0 is called in the QGLViewer constructor.

void setShortcutKey ShortcutAction    action,
int    key
[protected, virtual]
 

Defines the shortcut key associated with a given action of the viewer. All the possible actions are defined by the QGLViewer::ShortcutAction enum.

key is defined by the Qt::Key enum and is of the form Qt::Key_X (see the Qt documentation). Set the key to 0 to forbid the action shortcut. Use setShortcutStateKey() to define a shortcut state key and shortcutKey() to get the current value. See also setSavePOVShortcutKey(), setRestorePOVShortcutKey() and setMouseStateKey().

For example, this code defines Alt-M as the new Camera::toggleMode() shortcut:

  setShortcutKey     (QGLViewer::CameraMode, Qt::Key_M);
  setShortcutStateKey(QGLViewer::CameraMode, Qt::AltButton);

See the QGLViewer shortcuts page for details and default values.

void setShortcutStateKey ShortcutAction    action,
ushort    skey
[protected, virtual]
 

Defines the shortcut state key (Alt, Shift, Control...) that should be pressed while pressing a given action shortcutKey(). All the possible actions are defined by the ShortcutAction enum.

The state key can be set to Qt::NoButton, Qt::ControlButton, Qt::ShiftButton, Qt::AltButton, or a combinaison of these (use the bit '|' operator, see setMouseStateKey()).

For example, this code defines Alt-M as the new Camera::toggleMode() shortcut:

  setShortcutKey     (QGLViewer::CameraMode, Qt::Key_M);
  setShortcutStateKey(QGLViewer::CameraMode, Qt::AltButton);

Use setShortcutKey() to define the shortcut key and shortcutStateKey() to get the current value. See also setSavePOVShortcutStateKey(), setRestorePOVShortcutStateKey() and setMouseStateKey().

See the QGLViewer shortcuts page for details and default values.

void setSnapshotFilename const QString &    n [slot]
 

Sets the filename to use (incrementally) when saving snapshot with saveSnapshot(). If the filename is relative, the current working directory at the moment of the function call is added. snapshotFilename() returns the current snapshot file name.

void setSnapshotFormat const QString &    f [inline, slot]
 

Defines the snapshot file format. This format will be used by saveSnapshot() in automatic mode. In non-automatic mode, this will be the default format of the saveAs dialog box.

The available formats are those handled by Qt. Classical values are "JPEG" (default snapshotFormat()), "PNG", "PPM, "BMP". Use the following code to get the actual list:

     QStringList formatList = QImage::outputFormatList();
     for (QStringList::Iterator it = formatList.begin(); it != formatList.end(); ++it)
       cout << (*it) << endl;

If the library was compiled with the EPSRender option, three additional vectorial formats are available: "EPS", "PS" and "XFIG".

Attention:
No verification is performed on the provided format validity. The next call to saveSnapshot() may fail if the format string is not supported by the QT QImage class.

void setStereoDisplay bool    f = true [slot]
 

Activates stereo mode (resp. switch back to mono when flag is false). Checks if the display system is able to handle stereovision using QGLWidget::format()). Should be called in init() or toggled with the S key shortcut (see toggleStereoDisplay()). Get current value from displaysInStereo().

The QGLViewer instance must be created with a stereo format to handle stereovision:

     QGLFormat format;
     format.setStereoDisplay( TRUE );
     QGLViewer viewer(format);
See the stereoViewer example.

Qt::Key shortcutKey const ShortcutAction    action const [protected]
 

Returns the current shortcut value as defined with setShortcutKey(). action is defined by the QGLViewer::ShortcutAction enum.

See the QGLViewer shortcuts page for details and default values.

Qt::ButtonState shortcutStateKey ShortcutAction    action const [protected]
 

Returns the current shortcut state value as defined with setShortcutKey(). action is defined by the QGLViewer::ShortcutAction enum.

See the QGLViewer shortcuts page for details and default values.

void showEntireScene   [inline, slot]
 

Set camera so that the entire scene is visible. This method should be called in init(), once the sceneRadius() and sceneCenter() have been properly set (use setSceneCenter() and setSceneRadius()). Simply calls Camera::showEntireScene().

const QString& snapshotFilename   const [inline]
 

Returns the current snapshot filename. Set by setSnapshotFilename(). Used in saveSnapshot().

const QString& snapshotFormat   const [inline]
 

Returns the current snapshot file format. Defined from the File Dialog window or with setSnapshotFormat(). Default value is "JPEG".

void startAnimation int    msecs = -1 [virtual, slot]
 

Start the animation loop. animate() and draw() will be called in a loop.

If msecs is negative (default with no parameter), the loop frequency is the one defined by setAnimationPeriod() (default is 25Hz). Otherwise animationPeriod() is set to msecs (in milliseconds). See stopAnimation() and animate().

You may also be interested in KeyFrameInterpolator::startInterpolation().

void startScreenCoordinatesSystem   const [virtual]
 

Use this function when you want to start drawing directly with the 2D screen coordinates system in your draw() function. Once this function has been called, the x, y coordinates correspond to the screen coordinates : the lower left corner in (0,0) and the upper right corner at (width(), height()). The projection matrix is set to ORTHO, GL_LIGHTING is disabled and anti-aliasing is activated (GL_BLEND and GL_LINE_SMOOTH). glMatrixMode is set to GL_MODELVIEW.

Use Camera::projectedCoordinatesOf() to computed the 2D projection on screen of a 3D point.

You need to call stopScreenCoordinatesSystem() at the end of the drawing block to restore the previous camera matrix. This function is called by drawText().

void stereoChanged bool    on [signal]
 

This signal is emitted whenever displaysInStereo() changes value. This can be done with setStereoDisplay() or toggleStereoDisplay().

void stopAnimation   [virtual, slot]
 

Stop an animation started with startAnimation() or toggleAnimationMode().

void stopScreenCoordinatesSystem   const [virtual]
 

This function closes the screen coordinates drawing block that was started by startScreenCoordinatesSystem(). The GL attributes that may have been changed in startScreenCoordinatesSystem() are restored. glMatrixMode is set to GL_MODELVIEW.

Attention:
Calling this function when no startScreenCoordinatesSystem() was called will probably result in a crash.

void textEnabled bool    on [signal]
 

This signal is emitted whenever textIsEnabled() changes value. This can be done with setEnableText() or toggleEnableText().

bool textIsEnabled   const [inline]
 

Returns true if drawText() and draw3DText() actually display text. Set by setEnableText() or toggleEnableText(). Convenient to remove all the possibly displayed text with a single key.

void timerEvent QTimerEvent *    [protected, virtual]
 

Overloading of the timer function. Calls animate() (if animationIsStarted()) and then draw(), at a frequency set by setAnimationPeriod().

void toggleAnimationMode   [inline, slot]
 

Calls startAnimation() or stopAnimation(), depending on animationIsStarted().

void toggleCameraPathEditor   [inline, slot]
 

Start/stop the edition of the camera paths (C shortcut key). See cameraPathIsEdited(). See also editCameraPath().

void toggleDisplayFPS   [inline, slot]
 

Toggle the state of fpsIsDisplayed(). displayFPS() is called or not (F shortcut key). See also setDisplayFPS() and currentFPS().

void toggleDrawAxis   [inline, slot]
 

Toggle the state of axisIsDrawn(). A wordl axis is drawn or not (A shortcut key). See also setDrawAxis().

void toggleDrawGrid   [inline, slot]
 

Toggle the state of gridIsDrawn() flag. A XY grid is drawn or not (G shortcut key). See also setDrawGrid().

void toggleEnableText   [inline, slot]
 

Toggle the state of textIsEnabled() : drawText() and draw3DText() actually draw text or not (default is yes) (? shortcut key). See also setEnableText().

void toggleFullScreen   [slot]
 

Viewer is toggled between normal and full screen mode (shortcut key Alt-Enter). See setFullScreen() and isFullScreen().

void toggleStereoDisplay   [inline, slot]
 

Toggle the state of displaysInStereo() (S shortcut key). See also setStereoDisplay().

void updateGLForAllViewers   [static]
 

updateGL() is called on all the created QGLViewers. All the viewers will have their display updated.

See connectSignalToAllViewers() and disconnectSignalToAllViewers() for more complex connections.

void viewerInitialized   [signal]
 

Signal emitted by the default QGLViewer::init() function. Connect this signal to the functions that need to be called before any drawing (if any), to initialize your viewer.

Use this signal-slot mechanism ONLY IF you don't inherit your viewer from QGLViewer (in that case, simply overload the init() function).

void wheelEvent QWheelEvent *    e [protected, virtual]
 

Using the wheel is equivalent to using the mouse middle button (a Zoom/Walk motion). See mousePressEvent() for details. Depending on your system configuration, you may have to actually click the wheel while .


Member Data Documentation

qglviewer::Camera camera
 

The camera that is used by the viewer. See the Camera() documentation for a complete description of the associated functions.


Generated on Thu Jan 16 12:53:46 2003 for libQGLViewer by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002