36 |
36 |
37 using ModelAction = std::variant<AppendToModel, DeleteFromModel>; |
37 using ModelAction = std::variant<AppendToModel, DeleteFromModel>; |
38 |
38 |
39 Q_DECLARE_METATYPE(ModelAction) |
39 Q_DECLARE_METATYPE(ModelAction) |
40 |
40 |
41 class EditorTabWidget : public QWidget |
41 class EditTools : public QObject |
42 { |
42 { |
43 Q_OBJECT |
43 Q_OBJECT |
44 public: |
44 public: |
45 explicit EditorTabWidget( |
45 explicit EditTools( |
46 Model* model, |
46 Model* model, |
47 DocumentManager* documents, |
|
48 const ColorTable& colorTable, |
47 const ColorTable& colorTable, |
49 QWidget *parent = nullptr); |
48 QObject *parent = nullptr); |
50 ~EditorTabWidget() override; |
49 ~EditTools() override; |
51 void applyToVertices(VertexMap::ApplyFunction fn) const; |
50 void applyToVertices(VertexMap::ApplyFunction fn) const; |
52 const QSet<ModelId> selectedObjects() const; |
51 const QSet<ModelId> selectedObjects() const; |
53 const ColorTable& colorTable; |
52 const ColorTable& colorTable; |
54 Canvas* const canvas; |
|
55 Model* const model; |
53 Model* const model; |
56 EditingMode currentEditingMode() const; |
54 EditingMode currentEditingMode() const; |
57 Q_SLOT void setEditMode(EditingMode mode); |
55 Q_SLOT void setEditMode(EditingMode mode); |
58 Q_SLOT void canvasMouseClick(QMouseEvent* event); |
56 Q_SLOT void canvasMouseClick(QMouseEvent* event); |
59 Q_SLOT void canvasMouseMove(QMouseEvent* event); |
57 Q_SLOT void canvasMouseMove(QMouseEvent* event); |
60 Q_SIGNALS: |
58 Q_SIGNALS: |
61 void newStatusText(const QString& newStatusText); |
59 void newStatusText(const QString& newStatusText); |
62 void splitterChanged(); |
60 void splitterChanged(); |
63 void modelAction(const ModelAction& action); |
61 void modelAction(const ModelAction& action); |
|
62 void drawStateChanged(const DrawState& drawState); |
64 private: |
63 private: |
65 void closeShape(); |
64 void closeShape(); |
66 DrawState drawState; |
65 DrawState drawState; |
67 VertexMap vertexMap; |
66 VertexMap vertexMap; |
68 }; |
67 }; |