]> Shamusworld >> Repos - architektonas/blob - src/base/rs_painterqt.h.old
Initial import
[architektonas] / src / base / rs_painterqt.h.old
1 /****************************************************************************
2 ** $Id: rs_painterqt.h 2244 2005-03-14 23:00:19Z andrew $
3 **
4 ** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
5 **
6 ** This file is part of the qcadlib Library project.
7 **
8 ** This file may be distributed and/or modified under the terms of the
9 ** GNU General Public License version 2 as published by the Free Software
10 ** Foundation and appearing in the file LICENSE.GPL included in the
11 ** packaging of this file.
12 **
13 ** Licensees holding valid qcadlib Professional Edition licenses may use
14 ** this file in accordance with the qcadlib Commercial License
15 ** Agreement provided with the Software.
16 **
17 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
18 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19 **
20 ** See http://www.ribbonsoft.com for further details.
21 **
22 ** Contact info@ribbonsoft.com if any conditions of this licensing are
23 ** not clear to you.
24 **
25 **********************************************************************/
26
27 #ifndef RS_PAINTERQT_H
28 #define RS_PAINTERQT_H
29
30 #include <QtCore>
31
32 #include "rs_color.h"
33 #include "rs_graphicview.h"
34 #include "rs_painter.h"
35
36 /**
37  * The Qt implementation of a painter. It can draw objects such as
38  * lines or arcs in a widget. All coordinates are screen coordinates
39  * and have nothing to do with the graphic view.
40  */
41 class RS_PainterQt: public QPainter, public RS_Painter
42 {
43         public:
44         //WAS:    RS_PainterQt(const QPaintDevice* pd);
45                 RS_PainterQt(QPaintDevice * pd);
46                 virtual ~RS_PainterQt();
47
48 //              virtual void moveTo(int x, int y);
49 //              virtual void lineTo(int x, int y);
50                 virtual void drawGridPoint(const Vector & p);
51                 virtual void drawPoint(const Vector & p);
52                 virtual void drawLine(const Vector & p1, const Vector & p2);
53                 //virtual void drawRect(const Vector& p1, const Vector& p2);
54                 virtual void drawArc(const Vector & cp, double radius,
55                         double a1, double a2, const Vector & p1, const Vector & p2, bool reversed);
56
57                 virtual void drawArc(const Vector & cp, double radius,
58                         double a1, double a2, bool reversed);
59                 virtual void drawArcMac(const Vector & cp, double radius,
60                         double a1, double a2, bool reversed);
61                 virtual void drawCircle(const Vector &, double radius);
62                 virtual void drawEllipse(const Vector & cp, double radius1, double radius2,
63                         double angle, double a1, double a2, bool reversed);
64                 virtual void drawImg(QImage & img, const Vector & pos,
65                         double angle, const Vector & factor, int sx, int sy, int sw, int sh);
66 //              virtual void drawTextH(int x1, int y1, int x2, int y2, const QString & text);
67 //              virtual void drawTextV(int x1, int y1, int x2, int y2, const QString & text);
68
69                 virtual void fillRect(int x1, int y1, int w, int h, const RS_Color& col);
70
71                 virtual void fillTriangle(const Vector & p1, const Vector & p2, const Vector & p3);
72
73                 virtual void drawPolygon(const Q3PointArray & a);
74                 virtual void erase();
75                 virtual int getWidth();
76                 virtual int getHeight();
77
78                 //virtual void setBackgroundPen();
79                 //virtual void setDefaultPen();
80                 virtual void setPreviewPen();
81                 virtual RS_Pen getPen();
82                 virtual void setPen(const RS_Pen & pen);
83                 virtual void setPen(const RS_Color & color);
84                 virtual void setPen(int r, int g, int b);
85                 virtual void disablePen();
86                 //virtual void setColor(const QColor& color);
87                 virtual void setBrush(const RS_Color & color);
88
89                 virtual void setXORMode();
90                 virtual void setNormalMode();
91
92                 virtual void setClipRect(int x, int y, int w, int h);
93                 virtual void resetClipping();
94
95         protected:
96                 RS_Pen lpen;
97
98 //      private:
99 //              int cursorX, cursorY;
100 };
101
102 #endif  // RS_PAINTERQT_H