X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fbase%2Fpaintinterface.h;fp=src%2Fbase%2Fpaintinterface.h;h=0000000000000000000000000000000000000000;hb=9f6ad3fe0b9cb30115a5d38e8af3aebed0d70c08;hp=94701cf4fb21cdfd562223350d9fd7c4a2bd74f0;hpb=43c13b052d069ba435277d93867380d00c04931f;p=architektonas diff --git a/src/base/paintinterface.h b/src/base/paintinterface.h deleted file mode 100644 index 94701cf..0000000 --- a/src/base/paintinterface.h +++ /dev/null @@ -1,79 +0,0 @@ -#ifndef ____PAINTINTERFACE_H____ -#define ____PAINTINTERFACE_H____ - -#include -#include "enums.h" -#include "vector.h" -#include "color.h" -#include "pen.h" - -// This is an interface class to the rest of the RS_* functions that are supposed -// to be toolkit independent, but, because the author of QCad had no idea how to -// do that cleanly, we have the present clusterfuck of disaster and failure that -// is RS_Painter & friends. This class proposes to fix that. -// -// The QPainter passed in is only used, never created. Once this class finishes, -// it does *nothing* to the QPainter passed in. But this class *MUST^ pass a valid -// one in, or else nothing happens. -class PaintInterface -{ - public: - PaintInterface(QPainter * p); - - void setDrawingMode(RS2::DrawingMode m); - RS2::DrawingMode getDrawingMode(); - void drawGridPoint(const Vector & p); - void drawPoint(const Vector & p); - void drawLine(const Vector & p1, const Vector & p2); - void drawRect(const Vector & p1, const Vector & p2); - void drawArc(const Vector & cp, double radius, double a1, double a2, - const Vector & p1, const Vector & p2, bool reversed); - void drawArc(const Vector & cp, double radius, - double a1, double a2, bool reversed); - void drawArcMac(const Vector & cp, double radius, double a1, double a2, bool reversed); - void createArc(QPolygon & pa, const Vector & cp, double radius, - double a1, double a2, bool reversed); - void drawCircle(const Vector & cp, double radius); - void drawEllipse(const Vector & cp, double radius1, double radius2, - double angle, double angle1, double angle2, bool reversed); - void drawImg(QImage & img, const Vector & pos, - double angle, const Vector & factor, int sx, int sy, int sw, int sh); - void fillRect(int x1, int y1, int w, int h, const Color & col); - void fillTriangle(const Vector & p1, const Vector & p2, const Vector & p3); - void drawHandle(const Vector & p, const Color & c, int size = -1); - void setPreviewPen(); - Pen getPen(); - void setPen(const Pen & pen); - void setPen(const Color & color); - void setPen(int r, int g, int b); - void disablePen(); - void setBrush(const Color & color); - void disableBrush(); - void drawPolygon(const QPolygon & p); - void erase(); - int getWidth(); - int getHeight(); - void setXORMode(); - void setNormalMode(); - void setPreviewMode(); - bool isPreviewMode(); - void setOffset(const Vector & o); - void setClipRect(int x, int y, int w, int h); - void resetClipping(); - int toScreenX(double x); - int toScreenY(double y); - - private: - QPainter * painter; - /** - * Current drawing mode. - */ - RS2::DrawingMode drawingMode; - /** - * A fixed offset added to all entities drawn (useful for previews). - */ - Vector offset; - Pen lpen; -}; - -#endif // __PAINTINTERFACE_H____