Mon, 26 Jul 2021 11:50:45 +0300
refactor
96 | 1 | #pragma once |
2 | #include "basetool.h" | |
3 | ||
4 | class DrawTool : public BaseTool | |
5 | { | |
6 | Q_OBJECT | |
7 | ||
8 | public: | |
9 | Q_INVOKABLE DrawTool(QObject* parent = nullptr); | |
10 | ||
105
6ca6e8c647d4
added preview layer code and fixed build warnings
Teemu Piippo <teemu@hecknology.net>
parents:
104
diff
changeset
|
11 | QString name() const override; |
6ca6e8c647d4
added preview layer code and fixed build warnings
Teemu Piippo <teemu@hecknology.net>
parents:
104
diff
changeset
|
12 | QString toolTip() const override; |
111
1f42c03fafca
Draw tool actually adds objects now
Teemu Piippo <teemu@hecknology.net>
parents:
109
diff
changeset
|
13 | bool mouseClick(Document* document, Canvas* canvas) override; |
1f42c03fafca
Draw tool actually adds objects now
Teemu Piippo <teemu@hecknology.net>
parents:
109
diff
changeset
|
14 | bool mouseMove(Document* document, Canvas* canvas) override; |
106 | 15 | void reset() override; |
109
40a1cf2f38f5
replaced preview layers in favor of overpainting callback
Teemu Piippo <teemu@hecknology.net>
parents:
108
diff
changeset
|
16 | void overpaint(Canvas*, QPainter*) const override; |
106 | 17 | private: |
111
1f42c03fafca
Draw tool actually adds objects now
Teemu Piippo <teemu@hecknology.net>
parents:
109
diff
changeset
|
18 | void closeShape(Document *document); |
106 | 19 | std::vector<glm::vec3> polygon; |
109
40a1cf2f38f5
replaced preview layers in favor of overpainting callback
Teemu Piippo <teemu@hecknology.net>
parents:
108
diff
changeset
|
20 | std::vector<glm::vec3> previewPolygon; |
40a1cf2f38f5
replaced preview layers in favor of overpainting callback
Teemu Piippo <teemu@hecknology.net>
parents:
108
diff
changeset
|
21 | glm::vec3 previewPoint; |
96 | 22 | }; |