2014-08-19 13:49:08 +00:00
|
|
|
#ifndef OPENGLVIEW_H
|
|
|
|
#define OPENGLVIEW_H
|
|
|
|
|
2014-08-27 13:18:08 +00:00
|
|
|
#include "modeler_global.h"
|
2014-08-19 13:49:08 +00:00
|
|
|
|
|
|
|
#include <QQuickItem>
|
|
|
|
|
|
|
|
namespace paysages {
|
2014-08-27 13:18:08 +00:00
|
|
|
namespace modeler {
|
2014-08-19 13:49:08 +00:00
|
|
|
|
|
|
|
class OpenGLView : public QQuickItem
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit OpenGLView(QQuickItem *parent = 0);
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void handleWindowChanged(QQuickWindow *win);
|
|
|
|
void paint();
|
2015-08-24 17:38:59 +00:00
|
|
|
void handleResize();
|
2014-08-19 13:49:08 +00:00
|
|
|
|
2014-08-27 16:19:48 +00:00
|
|
|
protected:
|
2014-09-26 15:46:39 +00:00
|
|
|
virtual void wheelEvent(QWheelEvent *event) override;
|
|
|
|
virtual void mousePressEvent(QMouseEvent *event) override;
|
|
|
|
virtual void mouseReleaseEvent(QMouseEvent *event) override;
|
|
|
|
virtual void mouseMoveEvent(QMouseEvent *event) override;
|
2015-09-06 23:15:59 +00:00
|
|
|
virtual void hoverMoveEvent(QHoverEvent *event) override;
|
2014-08-27 16:19:48 +00:00
|
|
|
virtual void timerEvent(QTimerEvent *event) override;
|
|
|
|
|
2015-07-22 19:30:56 +00:00
|
|
|
private:
|
2015-08-18 16:22:16 +00:00
|
|
|
bool acceptInputs() const;
|
2015-07-22 19:30:56 +00:00
|
|
|
double getSpeedFactor(QInputEvent *event);
|
|
|
|
|
2014-08-19 13:49:08 +00:00
|
|
|
private:
|
2015-09-14 17:25:54 +00:00
|
|
|
int delayed;
|
2014-08-19 13:49:08 +00:00
|
|
|
bool initialized;
|
2015-08-24 17:38:59 +00:00
|
|
|
bool resized;
|
2014-08-28 08:29:12 +00:00
|
|
|
MainModelerWindow *window;
|
|
|
|
OpenGLRenderer *renderer;
|
2014-09-26 15:46:39 +00:00
|
|
|
|
|
|
|
Qt::MouseButton mouse_button;
|
|
|
|
QPointF mouse_pos;
|
2014-08-19 13:49:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // OPENGLVIEW_H
|