
These are simple examples illustrating how to use the viewer 
and how to extend it. Generally, you should not be bothered
with thinking about how to navigate through any 3D scene but
focus on your render routines. Therefore, one can instantiate
a viewer and simply "connect" its events (signals) with the
render routines of your renderer (slots). Signals and slots 
are a mechanism of Qt which we sued to build the GUI around
this viewer.

For viewing, the viewer emits three types of signals:

  1. sigInitGL
  2. sigResizeGL
  3. sigRedrawGL

and all of them can (2) or must (1,3) be connected with your
renderer. Otherwise nothing will happen since your renderer
is not connected. sigInitGL is emitted right when the OpenGL
window is initialized. ResizeGL is emitted whenever the size
of the window changes, and sigRedrawGL is emitted whenver the
viewing changes or other events make a redraw necessary.

Many applications are not satisfied with viewing only but
require selection functionality. Therefore, the viewer has
one mode for viewing and one for selecting. In selection mode
it emits different signals and in case your renderer is able
to handle selection, these signals should be connected as
well. Remember, the viewer only has few knowledge about the
scene (bounding box) but the renderer is the one that knows
what is in the scene. Hence, the renderer needs to find out
which objects are selected. The signals for selection are:

  1. sigSelected
  2. sigRenderModeChanged
  3. sigReleased
  4. sigMoved

The example in Simple illustrates how to use the
selection mechnism and how to possibly translate objects
that have been selected. Just play around with it and you 
will see. If you are happy with viewing only, then don't bother.

Finally, instead of instantiating a QGLExaminerViewer in this
example, we derived a QSimpleViewer from QGLExaminerViewer. QSimpleViewer
overloads the member method keyPressEvent and uses it to emit
the signal sigMyKey which can now be caught by the renderer by
connecting this signals with a catchKey method on the renderer
side. You probably get the concept of signals and slots pretty
quickly. Currently, the example only performs a "cout" of the
key's ascii code but one could use it to trigger certain mode
changes you need in your renderer or to toggle other things.
In case you need a more sophisticated GUI then build your own
Qt application that instantiates/uses the QGLViewer as one of
many components.

