GCE::GOpenGLFrame Class Reference

A frame that can draw GOpenGLForm objects. More...

#include <GOpenGLFrame.h>

Inheritance diagram for GCE::GOpenGLFrame:

Inheritance graph
[legend]
Collaboration diagram for GCE::GOpenGLFrame:

Collaboration graph
[legend]
List of all members.

Public Slots

virtual void startRendering (int sleep_ms_between_updates_min=20)
virtual void setTimeBetweenRendering (int milliseconds)
virtual void stopRendering ()
virtual void initializeGL ()
 Initialize some OpenGL things, this only needs to be called once.
virtual void resizeGL (int w, int h)
 Set the screen size.
virtual void paintGL ()
 Do the actual rendering.

Signals

void beforeRendering ()
void afterRendering ()

Public Member Functions

 GOpenGLFrame (const GWE::GInformationInterface *WorldData, GScene *scene, QWidget *parent=0)
 Constructor.
 ~GOpenGLFrame ()
 Destructor.
GScenegetScene ()

Public Attributes

GViewProperties ViewProperties

Protected Attributes

QTimer RedrawTimer
bool StopRendering
int RedrawSleepTime_ms

Private Attributes

const GWE::GInformationInterfaceWorldData
GSceneScene
GCS::GElementID CameraParent
QList< double > RenderingPeriods
double FramesPerSecond
double TimeSinceFpsUpdate
QTime FpsTimer

Detailed Description

A frame that can draw GOpenGLForm objects.

Author:
Raphael Langerhorst
This class represents the 3D interface. It allows for hierarchical rendering of elements, using GScene.
See also:
GScene


Member Function Documentation

void GCE::GOpenGLFrame::afterRendering (  )  [signal]

Emitted after rendering, all content is rendered.

void GCE::GOpenGLFrame::beforeRendering (  )  [signal]

Emitted just before starting the rendering cycle, no transformation,... done before emitting this signal.

GScene * GCE::GOpenGLFrame::getScene (  ) 

See also:
Scene
Returns:
Scene rendered by this frame.

void GCE::GOpenGLFrame::paintGL (  )  [virtual, slot]

Do the actual rendering.

Todo:
reintegrate the rotation concept (camera)

void GCE::GOpenGLFrame::setTimeBetweenRendering ( int  milliseconds  )  [virtual, slot]

This allows to change the desired FPS after rendering has already been enabled.

void GCE::GOpenGLFrame::startRendering ( int  sleep_ms_between_updates_min = 20  )  [virtual, slot]

starts a thread that constantly sends paint events to this OpenGL frame to ensure repainting; a value of 20 means a framerate of 50 fps under optimum conditions;

void GCE::GOpenGLFrame::stopRendering (  )  [virtual, slot]

Stops rendering. Sets StopRendering to true.

See also:
startRendering()


Member Data Documentation

GCS::GElementID GCE::GOpenGLFrame::CameraParent [private]

Used to know for which elements the respective server name should be shown. It's determined at the beginning of each render cycle and stored here.

QTime GCE::GOpenGLFrame::FpsTimer [private]

Used to measure rendering periods.

double GCE::GOpenGLFrame::FramesPerSecond [private]

The calculated fps value.

int GCE::GOpenGLFrame::RedrawSleepTime_ms [protected]

How many milliseconds to wait after finishing drawing before redrawing.

QTimer GCE::GOpenGLFrame::RedrawTimer [protected]

Started as singleshot timer after each redraw, connected to update()

QList<double> GCE::GOpenGLFrame::RenderingPeriods [private]

Stores the time for the last rendering periods. This is used for frames per second calculations. On each FPS update the list is cleared.

GScene* GCE::GOpenGLFrame::Scene [private]

The actual scene that is rendered.

bool GCE::GOpenGLFrame::StopRendering [protected]

When this is set to true, rendering is halted. After that you have to call startRendering() to restart rendering.

See also:
stopRendering()

double GCE::GOpenGLFrame::TimeSinceFpsUpdate [private]

Time since last fps update. This is summed up in each rendering cycle, if it reaches 1 second, the FPS value is updated. The unit is milliseconds.

GViewProperties GCE::GOpenGLFrame::ViewProperties

The view properties. Basically these are the camera settings.

const GWE::GInformationInterface* GCE::GOpenGLFrame::WorldData [private]

Used for getting information about elements.


The documentation for this class was generated from the following files:
Generated on Thu Nov 16 07:49:31 2006 for G System by  doxygen 1.4.7