Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

qwt_rect.h

00001 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
00002  * Qwt Widget Library
00003  * Copyright (C) 1997   Josef Wilgen
00004  * Copyright (C) 2002   Uwe Rathmann
00005  * 
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the Qwt License, Version 1.0
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 
00021 class QPoint;
00022 
00027 class QWT_EXPORT QwtRect : public QRect
00028 {
00029 public:
00030     QwtRect();
00031     QwtRect(const QRect &r);
00032 
00033     QRect cutTop(int h , int distTop = 0, int distBottom = 0);
00034     QRect cutBottom(int h, int distTop = 0, int distBottom = 0);
00035     QRect cutLeft(int w, int distLeft = 0, int distRight = 0);
00036     QRect cutRight(int w, int distLeft = 0, int distRight = 0);
00037     const QwtRect &cutMargin(int mLeft, int mRight, int Top, int mBottom);
00038 
00039 #if QT_VERSION < 0x040000
00040     QPointArray clip(const QPointArray &) const;
00041 #else
00042     QPolygon clip(const QPolygon &) const;
00043 #endif
00044 
00045 private:
00046     enum Edge { Left, Top, Right, Bottom, NEdges };
00047 
00048 #if QT_VERSION < 0x040000
00049     void clipEdge(Edge, const QPointArray &, QPointArray &) const;
00050 #else
00051     void clipEdge(Edge, const QPolygon &, QPolygon &) const;
00052 #endif
00053     bool insideEdge(const QPoint &, Edge edge) const;
00054     QPoint intersectEdge(const QPoint &p1, 
00055         const QPoint &p2, Edge edge) const;
00056 };
00057 
00058 #endif

Generated on Wed Aug 31 23:02:29 2005 for Qwt User's Guide by  doxygen 1.4.1