12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #ifndef RENDERWIDGET_H
- #define RENDERWIDGET_H
-
- #include <QGLWidget>
- #include <QMouseEvent>
- #include <QWheelEvent>
- #include <QKeyEvent>
- #include "engine/ugameengine.h"
- #include "openglrenderdevice.h"
-
- class RenderWidget : public QGLWidget
- {
- Q_OBJECT
- public:
- explicit RenderWidget(QWidget *parent = 0);
-
- protected:
- void initializeGL();
- void paintGL();
- void resizeGL(int width, int height);
-
- float normalizeAngle(float angle);
-
- void mousePressEvent(QMouseEvent* event);
- void mouseMoveEvent(QMouseEvent* event);
- void wheelEvent(QWheelEvent* event);
- void keyPressEvent(QKeyEvent* event);
-
- void rotate(float phi, float theta);
-
- signals:
-
- public slots:
- void drawAxes();
-
- private:
- OpenGLRenderDevice* _device;
-
- int angle;
-
- UGameEngine* _engine;
-
- QPoint _lastPoint;
-
- float _radius;
-
- float _phi;
-
- float _theta;
-
- bool _reverse;
-
- };
-
- #endif // RENDERWIDGET_H
|