src/canvas.h

changeset 1104
edddb9b0db9e
parent 1103
ac7db4c076c3
child 1106
7541b0209057
equal deleted inserted replaced
1103:ac7db4c076c3 1104:edddb9b0db9e
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 };

mercurial