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