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