]> Shamusworld >> Repos - architektonas/blob - src/painter.h
178b7dbca605ad772f7b9d9c2f2ffe792c09e2e1
[architektonas] / src / painter.h
1 #ifndef __PAINTER_H__
2 #define __PAINTER_H__
3
4 #include <QtWidgets>
5 #include "vector.h"
6
7 //#define SCREEN_ZOOM  (1.0 / 4.0)
8
9 // Forward declarations
10
11 class Painter
12 {
13         public:
14                 Painter(QPainter * p = 0);
15                 ~Painter();
16
17                 void SetRenderHint(int);
18                 void SetBrush(QBrush);
19                 void SetFont(QFont);
20                 void SetPen(QPen);
21                 void DrawAngledText(Vector, double, QString, double);
22                 void DrawArc(Vector, double, double, double);
23                 void DrawEllipse(Vector, double, double);
24                 void DrawHandle(Vector);
25                 void DrawArrowHandle(Vector, double);
26                 void DrawArrowToLineHandle(Vector, double);
27                 void DrawLine(int, int, int, int);
28                 void DrawLine(Vector, Vector);
29                 void DrawPoint(int, int);
30                 void DrawRoundedRect(QRectF, double, double);
31                 void DrawPaddedRect(QRectF);
32                 void DrawRect(QRectF);
33                 void DrawText(QRectF, int, QString);
34                 void DrawArrowhead(Vector, Vector, double);
35                 void DrawCrosshair(Vector);
36                 void DrawInformativeText(QString);
37
38         public:
39                 static Vector CartesianToQtCoords(Vector);
40                 static Vector QtToCartesianCoords(Vector);
41
42         public:
43                 // Class variables
44                 static Vector origin;           // The window origin, not location of the origin
45                 static double zoom;                     // Window zoom factor
46                 static Vector screenSize;       // Width & height of the window we're drawing on
47
48         private:
49                 QPainter * painter;
50 };
51
52 #endif  // __PAINTER_H__