26 bool mouseMoved; |
25 bool mouseMoved; |
27 Qt::MouseButtons releasedButtons; |
26 Qt::MouseButtons releasedButtons; |
28 }; |
27 }; |
29 |
28 |
30 AbstractEditMode (GLRenderer* renderer); |
29 AbstractEditMode (GLRenderer* renderer); |
|
30 virtual ~AbstractEditMode(); |
31 |
31 |
32 virtual bool allowFreeCamera() const = 0; |
32 virtual bool allowFreeCamera() const = 0; |
33 virtual void render (QPainter& painter) const {}; |
33 virtual void render (QPainter&) const {}; |
34 GLRenderer* renderer() const; |
34 GLRenderer* renderer() const; |
35 virtual EditModeType type() const = 0; |
35 virtual EditModeType type() const = 0; |
36 virtual bool mousePressed (QMouseEvent*) { return false; } |
36 virtual bool mousePressed (QMouseEvent*) { return false; } |
37 virtual bool mouseReleased (MouseEventData const&) { return false; } |
37 virtual bool mouseReleased (MouseEventData const&) { return false; } |
38 virtual bool mouseDoubleClicked (QMouseEvent*) { return false; } |
38 virtual bool mouseDoubleClicked (QMouseEvent*) { return false; } |
39 virtual bool mouseMoved (QMouseEvent*) { return false; } |
39 virtual bool mouseMoved (QMouseEvent*) { return false; } |
40 void finishDraw (LDObjectList& objs); |
|
41 |
40 |
42 static AbstractEditMode* createByType (GLRenderer* renderer, EditModeType type); |
41 static AbstractEditMode* createByType (GLRenderer* renderer, EditModeType type); |
43 }; |
42 }; |
44 |
43 |
45 // |
44 // |
46 // Base class for draw-like edit modes |
45 // Base class for draw-like edit modes |
47 // |
46 // |
48 class AbstractDrawMode : public AbstractEditMode |
47 class AbstractDrawMode : public AbstractEditMode |
49 { |
48 { |
|
49 DEFINE_CLASS (AbstractDrawMode, AbstractEditMode) |
|
50 |
|
51 protected: |
50 QList<Vertex> _drawedVerts; |
52 QList<Vertex> _drawedVerts; |
51 Vertex m_rectverts[4]; |
53 Vertex _rectverts[4]; |
52 |
54 QBrush _polybrush; |
53 DEFINE_CLASS (AbstractDrawMode, AbstractEditMode) |
|
54 |
55 |
55 public: |
56 public: |
56 AbstractDrawMode (GLRenderer* renderer); |
57 AbstractDrawMode (GLRenderer* renderer); |
57 |
58 |
58 virtual bool allowFreeCamera() const override |
59 virtual bool allowFreeCamera() const override |