X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdrawingview.h;h=3531291ac5bb4b1f51d84b65068032ebd6394171;hb=84afe881653a02a16b19d4da37435b8701b1a826;hp=da1912f39312fbcc20fc6e0d60ed96553f071a5c;hpb=64482766268cddae393da1277987de31e69ffdd9;p=architektonas diff --git a/src/drawingview.h b/src/drawingview.h index da1912f..3531291 100644 --- a/src/drawingview.h +++ b/src/drawingview.h @@ -1,10 +1,13 @@ #ifndef __DRAWINGVIEW_H__ #define __DRAWINGVIEW_H__ -#include +#include #include -#include "action.h" -#include "container.h" +//#include "action.h" +//#include "container.h" +#include "structs.h" + +class Painter; class DrawingView: public QWidget { @@ -14,20 +17,16 @@ class DrawingView: public QWidget DrawingView(QWidget * parent = NULL); public: - void SetRotateToolActive(bool state = true); -#if 0 - void SetAddLineToolActive(bool state = true); - void SetAddCircleToolActive(bool state = true); - void SetAddArcToolActive(bool state = true); - void SetAddDimensionToolActive(bool state = true); -#endif -// void SetToolActive(Action * action, bool state = true); - void SetToolActive(Action * action);//, bool state = true); +// void SetToolActive(Action * action); void SetGridSize(uint32_t); void UpdateGridBackground(void); + Point SnapPointToGrid(Point); + void RenderObjects(Painter *, Container *); public slots: void AddNewObjectToDocument(Object *); + void HandleActionUpdate(void); + void SetCurrentLayer(int); protected: void paintEvent(QPaintEvent * event); @@ -35,41 +34,35 @@ 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); private: QPoint GetAdjustedMousePosition(QMouseEvent * event); QPoint GetAdjustedClientPosition(int x, int y); -// Vector SnapPointToGrid(Vector); public: bool useAntialiasing; private: -// QBrush * backgroundBrush; QPixmap gridBackground; double scale; // Window scaling factor int32_t offsetX, offsetY; // Window offsets public: Container document; -// double gridSpacing; // Grid spacing in base units uint32_t gridPixels; // Grid size in pixels -// double gridBaseUnits; // Grid size in base units 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; +// Action * toolAction; + +// public: +// static Container document; }; #endif // __DRAWINGVIEW_H__ +