GLWindow Class Reference

our main glwindow widget for NGL applications all drawing elements are put in this file More...

#include <GLWindow.h>

Collaboration diagram for GLWindow:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 GLWindow (QWidget *_parent)
 Constructor for GLWindow.
 ~GLWindow ()
 dtor
void addParticles ()
 a method to add more particles to the system
void clearParticles ()
 a method to clear more particles to the system
void toggleAnimation ()
 a method to toggle animation
void resetObject ()
 a method to reset objects
void drawBox ()
 a method drawbox
void startPong ()
 a method to start pong
void processKeyDown (QKeyEvent *_event)
void processKeyUp (QKeyEvent *_event)
 processKeyUp passed from the main window class

Protected Member Functions

void initializeGL ()
 The following methods must be implimented in the sub class this is called when the window is created.
void resizeGL (const int _w, const int _h)
 this is called whenever the window is re-sized
void paintGL ()
 this is the main gl drawing routine which is called whenever the window needs to

Private Member Functions

void mouseMoveEvent (QMouseEvent *_event)
 this method is called every time a mouse is moved
void mousePressEvent (QMouseEvent *_event)
 this method is called everytime the mouse button is pressed inherited from QObject and overridden here.
void mouseReleaseEvent (QMouseEvent *_event)
 this method is called everytime the mouse button is released inherited from QObject and overridden here.
void timerEvent (QTimerEvent *_event)
 timer event trigered by startTimer
void wheelEvent (QWheelEvent *_event)
 this method is called everytime the mouse wheel is moved inherited from QObject and overridden here.
void updateLight ()

Private Attributes

int m_spinXFace
 used to store the x rotation mouse value
int m_spinYFace
 used to store the y rotation mouse value
bool m_rotate
 flag to indicate if the mouse button is pressed when dragging
int m_origX
 the previous x mouse value
int m_origY
 the previous y mouse value
int m_origXPos
 the previous x mouse value for Position changes
int m_origYPos
 the previous y mouse value for Position changes
ngl::Camera * m_cam
 Our Camera.
ngl::TransformStack m_transformStack
 transformation stack for the gl transformations etc
Environmentm_environment
 a container for our particles
ngl::Text * m_text
 our font
QTime currentTime
 calculate framerate
int m_updateTimer
bool m_animate
bool m_translate
ngl::Vec3 m_modelPos
ngl::Light m_light
ngl::Real m_lightAngle
int m_agentTimer

Detailed Description

our main glwindow widget for NGL applications all drawing elements are put in this file

Definition at line 24 of file GLWindow.h.


Constructor & Destructor Documentation

GLWindow::GLWindow ( QWidget *  _parent  ) 

Constructor for GLWindow.

Parameters:
[in] _parent the parent window to create the GL context in
GLWindow::~GLWindow (  ) 

dtor


Member Function Documentation

void GLWindow::addParticles (  ) 

a method to add more particles to the system

void GLWindow::clearParticles (  ) 

a method to clear more particles to the system

void GLWindow::drawBox (  )  [inline]

a method drawbox

Definition at line 43 of file GLWindow.h.

References Environment::drawBox(), and m_environment.

00043 { m_environment->drawBox();}

Here is the call graph for this function:

void GLWindow::initializeGL (  )  [protected]

The following methods must be implimented in the sub class this is called when the window is created.

void GLWindow::mouseMoveEvent ( QMouseEvent *  _event  )  [private]

this method is called every time a mouse is moved

Parameters:
_event the Qt Event structure
void GLWindow::mousePressEvent ( QMouseEvent *  _event  )  [private]

this method is called everytime the mouse button is pressed inherited from QObject and overridden here.

Parameters:
_event the Qt Event structure
void GLWindow::mouseReleaseEvent ( QMouseEvent *  _event  )  [private]

this method is called everytime the mouse button is released inherited from QObject and overridden here.

Parameters:
_event the Qt Event structure
void GLWindow::paintGL (  )  [protected]

this is the main gl drawing routine which is called whenever the window needs to

void GLWindow::processKeyDown ( QKeyEvent *  _event  ) 
void GLWindow::processKeyUp ( QKeyEvent *  _event  ) 

processKeyUp passed from the main window class

Parameters:
*_event a pointer to the QKeyEvent passed from main window class
void GLWindow::resetObject (  )  [inline]

a method to reset objects

Definition at line 41 of file GLWindow.h.

References m_environment, and Environment::resetObject().

Here is the call graph for this function:

void GLWindow::resizeGL ( const int  _w,
const int  _h 
) [protected]

this is called whenever the window is re-sized

Parameters:
[in] _w the width of the resized window
[in] _h the height of the resized window
void GLWindow::startPong (  )  [inline]

a method to start pong

Definition at line 45 of file GLWindow.h.

References m_environment, and Environment::startPong().

Here is the call graph for this function:

void GLWindow::timerEvent ( QTimerEvent *  _event  )  [private]

timer event trigered by startTimer

void GLWindow::toggleAnimation (  )  [inline]

a method to toggle animation

Definition at line 39 of file GLWindow.h.

References m_animate.

00039 { m_animate ^=true;}

void GLWindow::updateLight (  )  [private]
void GLWindow::wheelEvent ( QWheelEvent *  _event  )  [private]

this method is called everytime the mouse wheel is moved inherited from QObject and overridden here.

Parameters:
_event the Qt Event structure

Member Data Documentation

QTime GLWindow::currentTime [private]

calculate framerate

Definition at line 89 of file GLWindow.h.

int GLWindow::m_agentTimer [private]

Definition at line 96 of file GLWindow.h.

bool GLWindow::m_animate [private]

Definition at line 91 of file GLWindow.h.

ngl::Camera* GLWindow::m_cam [private]

Our Camera.

Definition at line 81 of file GLWindow.h.

a container for our particles

Definition at line 85 of file GLWindow.h.

ngl::Light GLWindow::m_light [private]

Definition at line 94 of file GLWindow.h.

ngl::Real GLWindow::m_lightAngle [private]

Definition at line 95 of file GLWindow.h.

ngl::Vec3 GLWindow::m_modelPos [private]

Definition at line 93 of file GLWindow.h.

int GLWindow::m_origX [private]

the previous x mouse value

Definition at line 69 of file GLWindow.h.

int GLWindow::m_origXPos [private]

the previous x mouse value for Position changes

Definition at line 74 of file GLWindow.h.

int GLWindow::m_origY [private]

the previous y mouse value

Definition at line 71 of file GLWindow.h.

int GLWindow::m_origYPos [private]

the previous y mouse value for Position changes

Definition at line 78 of file GLWindow.h.

bool GLWindow::m_rotate [private]

flag to indicate if the mouse button is pressed when dragging

Definition at line 67 of file GLWindow.h.

int GLWindow::m_spinXFace [private]

used to store the x rotation mouse value

Definition at line 63 of file GLWindow.h.

int GLWindow::m_spinYFace [private]

used to store the y rotation mouse value

Definition at line 65 of file GLWindow.h.

ngl::Text* GLWindow::m_text [private]

our font

Definition at line 87 of file GLWindow.h.

ngl::TransformStack GLWindow::m_transformStack [private]

transformation stack for the gl transformations etc

Definition at line 83 of file GLWindow.h.

bool GLWindow::m_translate [private]

Definition at line 92 of file GLWindow.h.

int GLWindow::m_updateTimer [private]

Definition at line 90 of file GLWindow.h.


The documentation for this class was generated from the following file:

Generated on 16 Aug 2013 for Multi-AgentSystem by  doxygen 1.6.1