]> Shamusworld >> Repos - architektonas/blob - src/painter.h
Preliminary support for Polylines.
[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 DrawHLine(double);
37                 void DrawVLine(double);
38                 void DrawPoint(int, int);
39                 void DrawRoundedRect(Rect, double, double);
40                 void DrawRoundedRect(QRectF, double, double);
41                 void DrawPaddedRect(Rect);
42                 void DrawRect(Rect);
43                 void DrawText(Rect, int, QString);
44                 void DrawArrowhead(Vector, Vector, double);
45                 void DrawCrosshair(Vector);
46                 void DrawInformativeText(QString);
47
48         public:
49                 static Vector CartesianToQtCoords(Vector);
50                 static Vector QtToCartesianCoords(Vector);
51
52         private:
53                 QPainter * painter;
54 };
55
56 #endif  // __PAINTER_H__