#include <render_window.h>
Public Member Functions | |
| RenderWindow (GameConfiguration gameConfig, QWidget *parent=0, const char *name=0) | |
| Default constructor. | |
| ~RenderWindow () | |
| Destructor. | |
| void | keyPressEvent (QKeyEvent *e) |
| Qt key press function. | |
| void | mouseMoveEvent (QMouseEvent *e) |
| Qt mouse move function. | |
| void | mousePressEvent (QMouseEvent *e) |
| Qt mouse press function. | |
| void | focusInEvent (QFocusEvent *e) |
| Qt in focus function. | |
| void | focusOutEvent (QFocusEvent *e) |
| Qt out focus function. | |
Static Public Member Functions | |
| static void | successGameEndCallback () |
| Function that should be called on successfull game end. | |
| static void | failedGameEndCallback () |
| Function that should be called on failed game end. | |
| static void | sceneSensorCallback (void *userdata, SoSensor *sensor) |
| Function which is called by sensor from Open Inventor. | |
| static void | mouseEventCallback (void *userdata, SoEventCallback *node) |
| Function which is called by mouse motion. | |
| static void | mouseButtonEventCallback (void *userdata, SoEventCallback *node) |
| Function which is called by mouse click. | |
Private Attributes | |
| SoSeparator * | _sceneRoot |
| The root of the generated scene. | |
| SoOneShotSensor * | _sceneSensor |
| Scene sensor aka scene alarm. Calls sceneSensorCallback. | |
| SoQtRenderArea * | _renderArea |
| Qt render area. | |
Static Private Attributes | |
| static MainWindow * | mainWindow |
| Widget parent (it has to be a MainWindow instance). | |
| static SoEventCallback * | eventCallback |
| Call back functions (mouse move, mouse click, keyboard click). | |
| static bool | stopped |
| True if game is stopped. | |
| static Camera * | camera |
| Camera. | |
| static Scene * | scene |
| Scene. | |
| static SbTime | lastTime |
| The last time, when sceneSensorCallback was triggered. | |
| static short | oldx |
| Old x coordinate. | |
| static short | oldy |
| Old y coordinate. | |
| static bool | failedGameEnd |
| If true, user failed the game. | |
| static bool | successGameEnd |
| If true, user won the game. | |
| static bool | haveFocus |
| Do we have focus? | |
This class acts like connection layer between Qt application and scene, which is created in Open Inventor.
| GUI::RenderWindow::RenderWindow | ( | GameConfiguration | gameConfig, | |
| QWidget * | parent = 0, |
|||
| const char * | name = 0 | |||
| ) |
Default constructor.
| [in] | gameConfig | Game configuration values. |
| [in] | parent | QWidget parent. |
| [in] | name | QWidget name. |
| GUI::RenderWindow::~RenderWindow | ( | ) |
Destructor.
| static void GUI::RenderWindow::successGameEndCallback | ( | ) | [static] |
Function that should be called on successfull game end.
| static void GUI::RenderWindow::failedGameEndCallback | ( | ) | [static] |
Function that should be called on failed game end.
| static void GUI::RenderWindow::sceneSensorCallback | ( | void * | userdata, | |
| SoSensor * | sensor | |||
| ) | [static] |
Function which is called by sensor from Open Inventor.
| [in] | userdata | Not used. |
| [in] | sensor | Sensor pointer. Used to schedule itself. |
| static void GUI::RenderWindow::mouseEventCallback | ( | void * | userdata, | |
| SoEventCallback * | node | |||
| ) | [static] |
Function which is called by mouse motion.
| [in] | userdata | Not used. |
| [in] | node | Event node pointer. Used to determine mouse position. |
| static void GUI::RenderWindow::mouseButtonEventCallback | ( | void * | userdata, | |
| SoEventCallback * | node | |||
| ) | [static] |
Function which is called by mouse click.
| [in] | userdata | Not used. |
| [in] | node | Event node pointer. Used to determine mouse click. |
| void GUI::RenderWindow::keyPressEvent | ( | QKeyEvent * | e | ) |
Qt key press function.
| [in] | e | Event. |
| void GUI::RenderWindow::mouseMoveEvent | ( | QMouseEvent * | e | ) |
Qt mouse move function.
| [in] | e | Event. |
| void GUI::RenderWindow::mousePressEvent | ( | QMouseEvent * | e | ) |
Qt mouse press function.
| [in] | e | Event. |
| void GUI::RenderWindow::focusInEvent | ( | QFocusEvent * | e | ) |
Qt in focus function.
| [in] | e | Event. |
| void GUI::RenderWindow::focusOutEvent | ( | QFocusEvent * | e | ) |
Qt out focus function.
| [in] | e | Event. |
SoSeparator* GUI::RenderWindow::_sceneRoot [private] |
The root of the generated scene.
SoOneShotSensor* GUI::RenderWindow::_sceneSensor [private] |
Scene sensor aka scene alarm. Calls sceneSensorCallback.
SoQtRenderArea* GUI::RenderWindow::_renderArea [private] |
Qt render area.
MainWindow* GUI::RenderWindow::mainWindow [static, private] |
Widget parent (it has to be a MainWindow instance).
SoEventCallback* GUI::RenderWindow::eventCallback [static, private] |
Call back functions (mouse move, mouse click, keyboard click).
bool GUI::RenderWindow::stopped [static, private] |
True if game is stopped.
Camera* GUI::RenderWindow::camera [static, private] |
Scene* GUI::RenderWindow::scene [static, private] |
SbTime GUI::RenderWindow::lastTime [static, private] |
The last time, when sceneSensorCallback was triggered.
short GUI::RenderWindow::oldx [static, private] |
Old x coordinate.
short GUI::RenderWindow::oldy [static, private] |
Old y coordinate.
bool GUI::RenderWindow::failedGameEnd [static, private] |
If true, user failed the game.
bool GUI::RenderWindow::successGameEnd [static, private] |
If true, user won the game.
bool GUI::RenderWindow::haveFocus [static, private] |
Do we have focus?
1.5.6