X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdrawingview.h;h=1e050e8f1d72917c14f487d8e306dffc0d5d7fbc;hb=deb5512a6b35e73dc2c19ac4d2800cff87dd2e71;hp=bd3e07e43307fe4d1256fa4898d70a683a243390;hpb=921bf050ffe5fc81a9ab377e634180e659ee5d5d;p=architektonas diff --git a/src/drawingview.h b/src/drawingview.h index bd3e07e..1e050e8 100644 --- a/src/drawingview.h +++ b/src/drawingview.h @@ -1,10 +1,11 @@ #ifndef __DRAWINGVIEW_H__ #define __DRAWINGVIEW_H__ -#include +#include #include -#include "action.h" -#include "container.h" +#include "structs.h" + +class Painter; class DrawingView: public QWidget { @@ -14,13 +15,26 @@ class DrawingView: public QWidget DrawingView(QWidget * parent = NULL); public: -// void SetRotateToolActive(bool state = true); - void SetToolActive(Action * action); void SetGridSize(uint32_t); void UpdateGridBackground(void); + Point SnapPointToGrid(Point); + void RenderObjects(Painter *, std::vector &); + void DeleteSelectedItems(void); + void ClearSelection(void); + void AddHoveredToSelection(void); + void GetSelection(std::vector &); + void GetHovered(std::vector &); + void ToolMouse(int, Point); + void ToolDraw(Painter *); + void LineHandler(int, Point); + void RotateHandler(int, Point); + void CheckObjectBounds(void); + bool HitTestObjects(Point); + void HandleObjectMovement(Point); public slots: void AddNewObjectToDocument(Object *); + void HandleActionUpdate(void); void SetCurrentLayer(int); protected: @@ -29,6 +43,7 @@ class DrawingView: public QWidget void mousePressEvent(QMouseEvent * event); void mouseMoveEvent(QMouseEvent * event); void mouseReleaseEvent(QMouseEvent * event); + void wheelEvent(QWheelEvent * event); void keyPressEvent(QKeyEvent * event); void keyReleaseEvent(QKeyEvent * event); @@ -38,6 +53,11 @@ class DrawingView: public QWidget public: bool useAntialiasing; + uint32_t numSelected; + uint32_t numHovered; + bool shiftDown; + bool ctrlDown; + bool overrideColor; private: QPixmap gridBackground; @@ -48,18 +68,18 @@ class DrawingView: public QWidget uint32_t gridPixels; // Grid size in pixels private: bool collided; -//Should this go into Object's class variables??? -//maybe, maybe not... :-P -// bool rotateTool; -// double rx, ry; bool scrollDrag; Vector oldPoint; -// bool addLineTool; -// bool addCircleTool; -// bool addDimensionTool; public: - Action * toolAction; + std::vector select; + std::vector hover; + std::vector toolObjects; + Point toolPoint[32]; + +// public: +// static Container document; }; #endif // __DRAWINGVIEW_H__ +