Thu, 27 Feb 2020 23:07:40 +0200
update locales
47 | 1 | #pragma once |
2 | #include "gl/partrenderer.h" | |
61
4585d8d7a7ec
moved GridProgram to Canvas
Teemu Piippo <teemu@hecknology.net>
parents:
57
diff
changeset
|
3 | #include "gl/gridprogram.h" |
47 | 4 | |
5 | class Canvas : public PartRenderer | |
6 | { | |
7 | Q_OBJECT | |
8 | public: | |
9 | Canvas( | |
10 | Model* model, | |
11 | DocumentManager* documents, | |
12 | const ldraw::ColorTable& colorTable, | |
13 | QWidget* parent = nullptr); | |
51 | 14 | public slots: |
15 | void handleSelectionChange(const QSet<ldraw::Id>& selectedIds, const QSet<ldraw::Id>& deselectedIds); | |
47 | 16 | protected: |
17 | void mouseMoveEvent(QMouseEvent* event) override; | |
51 | 18 | void mousePressEvent(QMouseEvent* event) override; |
19 | void mouseReleaseEvent(QMouseEvent* event) override; | |
61
4585d8d7a7ec
moved GridProgram to Canvas
Teemu Piippo <teemu@hecknology.net>
parents:
57
diff
changeset
|
20 | void initializeGL() override; |
57
5c0005f63319
use glm::unProject to implement screenToModelCoordinates
Teemu Piippo <teemu@hecknology.net>
parents:
51
diff
changeset
|
21 | void paintGL() override; |
47 | 22 | signals: |
23 | void newStatusText(const QString& newStatusText); | |
51 | 24 | void selectionChanged(const QSet<ldraw::Id>& newSelection); |
25 | private: | |
61
4585d8d7a7ec
moved GridProgram to Canvas
Teemu Piippo <teemu@hecknology.net>
parents:
57
diff
changeset
|
26 | std::optional<GridProgram> gridProgram; |
57
5c0005f63319
use glm::unProject to implement screenToModelCoordinates
Teemu Piippo <teemu@hecknology.net>
parents:
51
diff
changeset
|
27 | std::optional<glm::vec3> worldPosition; |
51 | 28 | int totalMouseMove = 0; |
29 | QSet<ldraw::Id> selection; | |
47 | 30 | }; |