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 #include "qwt_global.h"
00015 #include "qwt_polygon.h"
00016 
00021 class QWT_EXPORT QwtRect : public QRect
00022 {
00023 public:
00024     QwtRect();
00025     QwtRect(const QRect &r);
00026 
00027     QwtPolygon clip(const QwtPolygon &) const;
00028 
00029 private:
00030     enum Edge { Left, Top, Right, Bottom, NEdges };
00031 
00032     void clipEdge(Edge, const QwtPolygon &, QwtPolygon &) const;
00033     bool insideEdge(const QPoint &, Edge edge) const;
00034     QPoint intersectEdge(const QPoint &p1, 
00035         const QPoint &p2, Edge edge) const;
00036 };
00037 
00038 #endif