]> Shamusworld >> Repos - architektonas/blob - src/painter.h
5b11e25aadead93a1c418627fe3abbe50e02b332
[architektonas] / src / painter.h
1 #ifndef __PAINTER_H__
2 #define __PAINTER_H__
3
4 #include <stdint.h>
5 #include <QtWidgets>
6 #include "rect.h"
7 #include "vector.h"
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 SetPen(QPen);
19                 void SetPen(uint32_t, float size = 0, int style = 0);
20                 void SetBrush(QBrush);
21                 void SetBrush(uint32_t);
22                 void SetFont(QFont);
23                 void DrawAngledText(Vector, double, QString, double);
24                 void DrawTextObject(Vector, QString, double, double angle = 0);
25                 Rect MeasureTextObject(QString text, double size);
26                 void DrawArc(Vector, double, double, double);
27                 void DrawEllipse(Vector, double, double);
28                 void DrawHandle(Vector);
29                 void DrawCross(Vector);
30                 void DrawRectCorners(Rect);
31                 void DrawArrowHandle(Vector, double);
32                 void DrawArrowToLineHandle(Vector, double);
33                 void DrawLine(int, int, int, int);
34                 void DrawLine(Vector, Vector);
35                 void DrawPoint(int, int);
36                 void DrawRoundedRect(QRectF, double, double);
37                 void DrawPaddedRect(QRectF);
38                 void DrawRect(QRectF);
39                 void DrawText(QRectF, int, QString);
40                 void DrawArrowhead(Vector, Vector, double);
41                 void DrawCrosshair(Vector);
42                 void DrawInformativeText(QString);
43
44         public:
45                 static Vector CartesianToQtCoords(Vector);
46                 static Vector QtToCartesianCoords(Vector);
47
48         private:
49                 QPainter * painter;
50 };
51
52 #endif  // __PAINTER_H__
53