47 Q_DECLARE_METATYPE(ModelAction) |
47 Q_DECLARE_METATYPE(ModelAction) |
48 |
48 |
49 class EditTools final : public QObject, public RenderLayer |
49 class EditTools final : public QObject, public RenderLayer |
50 { |
50 { |
51 Q_OBJECT |
51 Q_OBJECT |
52 std::vector<glm::vec3> polygon; |
52 std::vector<glm::vec3> polygon = {{0, 0, 0}}; |
53 std::vector<glm::vec3> previewPolygon; |
|
54 glm::vec3 previewPoint; |
|
55 bool isconcave = false; |
53 bool isconcave = false; |
56 EditingMode mode = SelectMode; |
54 EditingMode mode = SelectMode; |
57 glm::mat4 mvpMatrix; |
55 glm::mat4 mvpMatrix; |
58 glm::mat4 gridMatrix{1}; |
56 glm::mat4 gridMatrix{1}; |
59 Plane gridPlane; |
57 Plane gridPlane; |
74 void mvpMatrixChanged(const glm::mat4& matrix) override; |
72 void mvpMatrixChanged(const glm::mat4& matrix) override; |
75 void mouseMoved(const QMouseEvent* event) override; |
73 void mouseMoved(const QMouseEvent* event) override; |
76 void mouseClick(const QMouseEvent* event) override; |
74 void mouseClick(const QMouseEvent* event) override; |
77 void overpaint(QPainter* painter) override; |
75 void overpaint(QPainter* painter) override; |
78 private: |
76 private: |
|
77 const std::vector<ModelAction> actions() const; |
79 void closeShape(); |
78 void closeShape(); |
80 void updatePreviewPolygon(); |
79 void updatePreviewPolygon(); |
81 void removeLastPoint(); |
80 void removeLastPoint(); |
82 }; |
81 }; |