-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathview.h
58 lines (44 loc) · 1.35 KB
/
view.h
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef VIEW_H
#define VIEW_H
#include <QOpenGLWidget>
#include "myutils.hpp"
#include "d_format.hpp"
struct ViewData;
class View : public QOpenGLWidget
{
Q_OBJECT
private:
ViewData *viewData;
QString status;
friend struct ViewData;
public:
View(QWidget *parent);
virtual ~View();
void initializeGL() override;
void resizeGL(int w, int h) override;
void paintGL() override;
protected:
virtual void wheelEvent(QWheelEvent *event) override;
virtual void mouseMoveEvent(QMouseEvent *event) override;
virtual void mousePressEvent(QMouseEvent *event) override;
virtual void keyPressEvent(QKeyEvent *event) override;
virtual void keyReleaseEvent(QKeyEvent *event) override;
private:
void updateZoom();
void onKeyEvent(bool press, QKeyEvent *event);
void updateStatusString(const QString &str);
signals:
void statusChanged(QString status);
void keyEvent(const Obj &obj);
public slots:
void changeFrame(std::shared_ptr<Frame> renderFrame, int totalCount);
void fieldSizeChange(int w, int h, int cellSize);
void field3d(const P &minP, const P &maxP, double hMin, double hMax, double cellSize);
void addStaticObject(const SObj &sobj);
void settingsChanged();
private:
std::shared_ptr<Frame> renderFrame;
int w = 1000, h = 1000;
int cellSize = 0;
};
#endif // VIEW_H