]> Shamusworld >> Repos - architektonas/blob - src/painter.h
98c81f3a7e6297955d73f6438044cd1d757ddd01
[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 DrawSmallHandle(Vector);
30                 void DrawCross(Vector);
31                 void DrawRectCorners(Rect);
32                 void DrawArrowHandle(Vector, double);
33                 void DrawArrowToLineHandle(Vector, double);
34                 void DrawLine(int, int, int, int);
35                 void DrawLine(Vector, Vector);
36                 void DrawPoint(int, int);
37                 void DrawRoundedRect(QRectF, double, double);
38                 void DrawPaddedRect(QRectF);
39                 void DrawRect(QRectF);
40                 void DrawText(QRectF, int, QString);
41                 void DrawArrowhead(Vector, Vector, double);
42                 void DrawCrosshair(Vector);
43                 void DrawInformativeText(QString);
44
45         public:
46                 static Vector CartesianToQtCoords(Vector);
47                 static Vector QtToCartesianCoords(Vector);
48
49         private:
50                 QPainter * painter;
51 };
52
53 #endif  // __PAINTER_H__
54