You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

renderwidget.h 927B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef RENDERWIDGET_H
  2. #define RENDERWIDGET_H
  3. #include <QGLWidget>
  4. #include <QMouseEvent>
  5. #include <QWheelEvent>
  6. #include <QKeyEvent>
  7. #include "engine/ugameengine.h"
  8. #include "openglrenderdevice.h"
  9. class RenderWidget : public QGLWidget
  10. {
  11. Q_OBJECT
  12. public:
  13. explicit RenderWidget(QWidget *parent = 0);
  14. protected:
  15. void initializeGL();
  16. void paintGL();
  17. void resizeGL(int width, int height);
  18. float normalizeAngle(float angle);
  19. void mousePressEvent(QMouseEvent* event);
  20. void mouseMoveEvent(QMouseEvent* event);
  21. void wheelEvent(QWheelEvent* event);
  22. void keyPressEvent(QKeyEvent* event);
  23. void rotate(float phi, float theta);
  24. signals:
  25. public slots:
  26. void drawAxes();
  27. private:
  28. OpenGLRenderDevice* _device;
  29. int angle;
  30. UGameEngine* _engine;
  31. QPoint _lastPoint;
  32. float _radius;
  33. float _phi;
  34. float _theta;
  35. bool _reverse;
  36. };
  37. #endif // RENDERWIDGET_H