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