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 = {{0, 0, 0}}; |
52 std::vector<glm::vec3> polygon = {{0, 0, 0}}; |
53 bool isconcave = false; |
53 std::size_t numpoints = 1; |
54 EditingMode mode = SelectMode; |
54 EditingMode mode = SelectMode; |
55 glm::mat4 mvpMatrix; |
55 glm::mat4 mvpMatrix; |
56 glm::mat4 gridMatrix{1}; |
56 glm::mat4 gridMatrix{1}; |
57 Plane gridPlane; |
57 Plane gridPlane; |
58 opt<glm::vec3> worldPosition; |
58 opt<glm::vec3> worldPosition; |
74 void mouseClick(const QMouseEvent* event) override; |
74 void mouseClick(const QMouseEvent* event) override; |
75 void overpaint(QPainter* painter) override; |
75 void overpaint(QPainter* painter) override; |
76 private: |
76 private: |
77 const std::vector<ModelAction> actions() const; |
77 const std::vector<ModelAction> actions() const; |
78 void closeShape(); |
78 void closeShape(); |
79 void updatePreviewPolygon(); |
|
80 void removeLastPoint(); |
79 void removeLastPoint(); |
|
80 bool isCloseToExistingPoints() const; |
81 }; |
81 }; |