src/tools/drawtool.h

Mon, 26 Jul 2021 11:50:45 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Mon, 26 Jul 2021 11:50:45 +0300
changeset 113
c0d064521ee0
parent 111
1f42c03fafca
child 121
000781318c36
permissions
-rw-r--r--

refactor

96
165777a20dc7 added tool base code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
1 #pragma once
165777a20dc7 added tool base code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
2 #include "basetool.h"
165777a20dc7 added tool base code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
3
165777a20dc7 added tool base code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
4 class DrawTool : public BaseTool
165777a20dc7 added tool base code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
5 {
165777a20dc7 added tool base code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
6 Q_OBJECT
165777a20dc7 added tool base code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
7
165777a20dc7 added tool base code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
8 public:
165777a20dc7 added tool base code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
9 Q_INVOKABLE DrawTool(QObject* parent = nullptr);
165777a20dc7 added tool base code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
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
128efb9d148b work on draw preview
Teemu Piippo <teemu@hecknology.net>
parents: 105
diff changeset
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
128efb9d148b work on draw preview
Teemu Piippo <teemu@hecknology.net>
parents: 105
diff changeset
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
128efb9d148b work on draw preview
Teemu Piippo <teemu@hecknology.net>
parents: 105
diff changeset
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
165777a20dc7 added tool base code
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
22 };

mercurial