Main Page | Class Hierarchy | Alphabetical List | Class List | 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 #include "qwt_global.h"
    00015
    00016 class QPoint;
    00017 class QPointArray;
    00018
    00023 class QWT_EXPORT QwtRect : public QRect
    00024 {
    00025 public:
    00026     QwtRect();
    00027     QwtRect(const QRect &r);
    00028
    00029     QRect cutTop(int h , int distTop = 0, int distBottom = 0);
    00030     QRect cutBottom(int h, int distTop = 0, int distBottom = 0);
    00031     QRect cutLeft(int w, int distLeft = 0, int distRight = 0);
    00032     QRect cutRight(int w, int distLeft = 0, int distRight = 0);
    00033     const QwtRect &cutMargin(int mLeft, int mRight, int Top, int mBottom);
    00034
    00035     QPointArray clip(const QPointArray &) const;
    00036
    00037 private:
    00038     enum Edge { Left, Top, Right, Bottom, NEdges };
    00039
    00040     void clipEdge(Edge, const QPointArray &, QPointArray &) const;
    00041     bool insideEdge(const QPoint &, Edge edge) const;
    00042     QPoint intersectEdge(const QPoint &p1,
    00043         const QPoint &p2, Edge edge) const;
    00044 };
    00045
    00046 #endif