qwt_clipper.h 1.04 KB
Newer Older
pixhawk's avatar
pixhawk committed
1 2 3 4
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
 * Qwt Widget Library
 * Copyright (C) 1997   Josef Wilgen
 * Copyright (C) 2002   Uwe Rathmann
5
 *
pixhawk's avatar
pixhawk committed
6 7 8 9 10 11 12 13
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the Qwt License, Version 1.0
 *****************************************************************************/

#ifndef QWT_CLIPPER_H
#define QWT_CLIPPER_H

#include "qwt_global.h"
Bryant's avatar
Bryant committed
14 15 16
#include "qwt_interval.h"
#include <qpolygon.h>
#include <qvector.h>
pixhawk's avatar
pixhawk committed
17 18

class QRect;
Bryant's avatar
Bryant committed
19
class QRectF;
pixhawk's avatar
pixhawk committed
20 21

/*!
Bryant's avatar
Bryant committed
22
  \brief Some clipping algorithms
pixhawk's avatar
pixhawk committed
23 24 25 26 27
*/

class QWT_EXPORT QwtClipper
{
public:
Bryant's avatar
Bryant committed
28 29 30 31
    static QPolygon clipPolygon( const QRect &, 
        const QPolygon &, bool closePolygon = false );
    static QPolygon clipPolygon( const QRectF &, 
        const QPolygon &, bool closePolygon = false );
pixhawk's avatar
pixhawk committed
32

Bryant's avatar
Bryant committed
33 34 35 36 37
    static QPolygonF clipPolygonF( const QRectF &, 
        const QPolygonF &, bool closePolygon = false );

    static QVector<QwtInterval> clipCircle(
        const QRectF &, const QPointF &, double radius );
pixhawk's avatar
pixhawk committed
38 39 40
};

#endif