16 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 */ |
17 */ |
18 |
18 |
19 #pragma once |
19 #pragma once |
20 #include "glRenderer.h" |
20 #include "glRenderer.h" |
|
21 #include "editmodes/abstractEditMode.h" |
21 |
22 |
22 class Canvas : public GLRenderer |
23 class Canvas : public GLRenderer |
23 { |
24 { |
24 public: |
25 public: |
25 Canvas(LDDocument* document, QWidget* parent = nullptr); |
26 Canvas(LDDocument* document, QWidget* parent = nullptr); |
|
27 ~Canvas(); |
|
28 |
|
29 EditModeType currentEditModeType() const; |
|
30 LDDocument* document() const; |
|
31 const Vertex& position3D() const; |
|
32 void setEditMode(EditModeType type); |
|
33 |
|
34 protected: |
|
35 void dropEvent(QDropEvent* event) override; |
|
36 bool freeCameraAllowed() const override; |
|
37 void keyReleaseEvent(QKeyEvent* event) override; |
|
38 void mouseDoubleClickEvent(QMouseEvent* event) override; |
|
39 void mouseMoveEvent(QMouseEvent* event) override; |
|
40 void mousePressEvent(QMouseEvent *event) override; |
|
41 void mouseReleaseEvent(QMouseEvent* event) override; |
|
42 void overpaint(QPainter& painter) override; |
|
43 |
|
44 private: |
|
45 LDDocument& m_document; |
|
46 AbstractEditMode* m_currentEditMode = nullptr; |
|
47 Vertex m_position3D; |
26 }; |
48 }; |