#ifndef MYGLWIDGET_HPP
#define MYGLWIDGET_HPP

#include <QGLWidget>
#include <QtOpenGL>
#include <QMetaObject>
#include "TransitionManager.hpp"

class DataSet;
class DataGroup;
class DataEntry;

/*
   Class: MyGLWidget

     Implements an OpenGL widget for Qt.

     *Inherits* from QGLWidget.
*/
class MyGLWidget: public QGLWidget {
  Q_OBJECT

  public:
    /*
       Constructor: MyGLWidget

         Initializes the object and creates the hardcoded data sets.

       Parameters:

         pParent - Pointer to the parent object. Default value is NULL.
    */
    MyGLWidget(QWidget* pParent = NULL);

    /*
       Destructor: ~MyGLWidget

         Releases all allocated resources.
    */
    ~MyGLWidget();


    /*
       Function: Initialize

         Initializes the OpenGL context.
    */
    void Initialize();

    /*
       Function: minimumSizeHint

         Unused function. *Inherited* from QWidget.

       Returns:

         Constant window size.
    */
    QSize minimumSizeHint() const;

    /*
       Function: sizeHint

         Unused function. *Inherited* from QWidget.

       Returns:

         Constant window size.
    */
    QSize sizeHint() const;

  protected:
    /*
       Function: resizeGL

         Unused function. *Inherited* from QGLWidget.

       Parameters:

         iWidth - Unused parameter.
         iHeight - Unused parameter.
    */
    void resizeGL(int iWidth, int iHeight);

    /*
       Function: paintEvent

         Paints the widget. *Inherited* from QWidget.

       Parameters:

         pEvent - Unused parameter.
    */
    void paintEvent(QPaintEvent* pEvent);

    /*
       Function: mousePressEvent

         Unused function. *Inherited* from QWidget.

       Parameters:

         pEvent - Unused parameter.
    */
    void mousePressEvent(QMouseEvent* pEvent);

    /*
       Function: mouseMoveEvent

         Unused function. *Inherited* from QWidget.

       Parameters:

         pEvent - Unused parameter.
    */
    void mouseMoveEvent(QMouseEvent* pEvent);

    /*
       Function: mouseReleaseEvent

         Unused function. *Inherited* from QWidget.

       Parameters:

         pEvent - Unused parameter.
    */
    void mouseReleaseEvent(QMouseEvent* pEvent);

    /*
       Function: wheelEvent

         Unused function. *Inherited* from QWidget.

       Parameters:

         pEvent - Unused parameter.
    */
    void wheelEvent(QWheelEvent* pEvent);

  private:
    TransitionManager* pTransitionManager;
    QTimer oTimer;
};

#endif