diff options
author | ZipCPU <dgisselq@ieee.org> | 2018-06-06 07:55:18 -0400 |
---|---|---|
committer | ZipCPU <dgisselq@ieee.org> | 2018-06-06 07:55:18 -0400 |
commit | d0ee08aeb12a8fb7237b31083666d9b165f13f69 (patch) | |
tree | e09d84b0389462f2c1959ce59438d88a7b5f9ed2 /gui/fpgaviewwidget.h | |
parent | 2e6d0b752ab2d269f822bfd3ea029b100ecf4233 (diff) | |
parent | d3f19cc27ea4634a64821688e9adec6046f4d7de (diff) | |
download | nextpnr-d0ee08aeb12a8fb7237b31083666d9b165f13f69.tar.gz nextpnr-d0ee08aeb12a8fb7237b31083666d9b165f13f69.tar.bz2 nextpnr-d0ee08aeb12a8fb7237b31083666d9b165f13f69.zip |
Merge branch 'master' into gqtech
Diffstat (limited to 'gui/fpgaviewwidget.h')
-rw-r--r-- | gui/fpgaviewwidget.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/gui/fpgaviewwidget.h b/gui/fpgaviewwidget.h new file mode 100644 index 00000000..c222e405 --- /dev/null +++ b/gui/fpgaviewwidget.h @@ -0,0 +1,43 @@ +#ifndef MAPGLWIDGET_H +#define MAPGLWIDGET_H + +#include <QOpenGLWidget> +#include <QOpenGLFunctions> +#include <QPainter> + +class FPGAViewWidget : public QOpenGLWidget, protected QOpenGLFunctions +{ + Q_OBJECT + +public: + FPGAViewWidget(QWidget *parent = 0); + ~FPGAViewWidget(); + + QSize minimumSizeHint() const override; + QSize sizeHint() const override; + + void setXTranslation(float t_x); + void setYTranslation(float t_y); + void setZoom(float t_z); + + void xRotationChanged(int angle); + void yRotationChanged(int angle); + void zRotationChanged(int angle); + +protected: + void initializeGL() Q_DECL_OVERRIDE; + void paintGL() Q_DECL_OVERRIDE; + void resizeGL(int width, int height) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE; + +private: + int m_windowWidth; + int m_windowHeight; + float m_xMove; + float m_yMove; + float m_zDistance; + QPoint m_lastPos; +}; +#endif |