diff -r d7a21e4a4ec3 -r 82469b40567e src/editmodes/abstracteditmode.h --- a/src/editmodes/abstracteditmode.h Fri Jul 04 23:44:44 2014 +0300 +++ b/src/editmodes/abstracteditmode.h Sat Jul 05 01:17:48 2014 +0300 @@ -1,9 +1,9 @@ #pragma once #include "../main.h" -#include "../glRenderer.h" class QPainter; class GLRenderer; +class QMouseEvent; enum class EditModeType { @@ -16,7 +16,6 @@ class AbstractEditMode { GLRenderer* _renderer; - QBrush _polybrush; public: struct MouseEventData @@ -28,16 +27,16 @@ }; AbstractEditMode (GLRenderer* renderer); + virtual ~AbstractEditMode(); virtual bool allowFreeCamera() const = 0; - virtual void render (QPainter& painter) const {}; + virtual void render (QPainter&) const {}; GLRenderer* renderer() const; virtual EditModeType type() const = 0; virtual bool mousePressed (QMouseEvent*) { return false; } virtual bool mouseReleased (MouseEventData const&) { return false; } virtual bool mouseDoubleClicked (QMouseEvent*) { return false; } virtual bool mouseMoved (QMouseEvent*) { return false; } - void finishDraw (LDObjectList& objs); static AbstractEditMode* createByType (GLRenderer* renderer, EditModeType type); }; @@ -47,10 +46,12 @@ // class AbstractDrawMode : public AbstractEditMode { + DEFINE_CLASS (AbstractDrawMode, AbstractEditMode) + +protected: QList _drawedVerts; - Vertex m_rectverts[4]; - - DEFINE_CLASS (AbstractDrawMode, AbstractEditMode) + Vertex _rectverts[4]; + QBrush _polybrush; public: AbstractDrawMode (GLRenderer* renderer); @@ -62,6 +63,7 @@ bool mouseReleased (const AbstractEditMode::MouseEventData& data) override; void addDrawnVertex (const Vertex& pos); + void finishDraw (LDObjectList& objs); virtual bool preAddVertex (Vertex const&) {