00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef QWT_RECT_H
00011 #define QWT_RECT_H
00012
00013 #include <qrect.h>
00014 #if QT_VERSION < 0x040000
00015 #include <qpointarray.h>
00016 #else
00017 #include <qpolygon.h>
00018 #endif
00019 #include "qwt_global.h"
00020
00025 class QWT_EXPORT QwtRect : public QRect
00026 {
00027 public:
00028 QwtRect();
00029 QwtRect(const QRect &r);
00030
00031 #if QT_VERSION < 0x040000
00032 QPointArray clip(const QPointArray &) const;
00033 #else
00034 QPolygon clip(const QPolygon &) const;
00035 #endif
00036
00037 private:
00038 enum Edge { Left, Top, Right, Bottom, NEdges };
00039
00040 #if QT_VERSION < 0x040000
00041 void clipEdge(Edge, const QPointArray &, QPointArray &) const;
00042 #else
00043 void clipEdge(Edge, const QPolygon &, QPolygon &) const;
00044 #endif
00045 bool insideEdge(const QPoint &, Edge edge) const;
00046 QPoint intersectEdge(const QPoint &p1,
00047 const QPoint &p2, Edge edge) const;
00048 };
00049
00050 #endif