-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathQuickRectangle.h
More file actions
38 lines (30 loc) · 831 Bytes
/
QuickRectangle.h
File metadata and controls
38 lines (30 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef RECTANGLE_H
#define RECTANGLE_H
#include <QQuickFramebufferObject>
#include <QMatrix4x4>
#include <Eigen/Geometry>
class QuickRectangle : public QQuickFramebufferObject
{
Q_OBJECT
public:
QuickRectangle();
QMatrix4x4 transform() const;
public Q_SLOTS:
void reset();
void zoom(double value);
void rotate(double value);
private:
Renderer* createRenderer() const override;
void mousePressEvent(QMouseEvent* e) override;
void mouseReleaseEvent(QMouseEvent* e) override;
void mouseMoveEvent(QMouseEvent* e) override;
void wheelEvent(QWheelEvent* e) override;
private:
const bool orth;
QMatrix4x4 projection;
Eigen::Affine3f modelview;
QPointF pos;
double zoomValue;
double rotationValue;
};
#endif // RECTANGLE_H