#ifndef __DRAWINGVIEW_H__
#define __DRAWINGVIEW_H__
-#include <QtGui>
+#include <QtWidgets>
#include <stdint.h>
-#include "action.h"
-#include "container.h"
+//#include "action.h"
+//#include "container.h"
+#include "structs.h"
+
+class Painter;
class DrawingView: public QWidget
{
DrawingView(QWidget * parent = NULL);
public:
- void SetRotateToolActive(bool state = true);
- void SetAddLineToolActive(bool state = true);
- void SetAddCircleToolActive(bool state = true);
- void SetAddArcToolActive(bool state = true);
- void SetAddDimensionToolActive(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);
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???
- bool rotateTool;
- double rx, ry;
bool scrollDrag;
Vector oldPoint;
- bool addLineTool;
- bool addCircleTool;
- bool addDimensionTool;
-// bool selectionInProgress;
-// QRectF selection;
public:
- Action * toolAction;
+// Action * toolAction;
+
+// public:
+// static Container document;
};
#endif // __DRAWINGVIEW_H__
+