Qwt Polar User's Guide  1.0.1
qwt_polar_canvas.h
00001 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
00002  * QwtPolar Widget Library
00003  * Copyright (C) 2008   Uwe Rathmann
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the Qwt License, Version 1.0
00007  *****************************************************************************/
00008 
00009 #ifndef QWT_POLAR_CANVAS_H
00010 #define QWT_POLAR_CANVAS_H 1
00011 
00012 #include "qwt_polar_global.h"
00013 #include <qwt_point_polar.h>
00014 #include <qframe.h>
00015 
00016 class QPainter;
00017 class QwtPolarPlot;
00018 
00027 class QWT_POLAR_EXPORT QwtPolarCanvas: public QFrame
00028 {
00029     Q_OBJECT
00030 
00031 public:
00040     enum PaintAttribute
00041     {
00047         BackingStore = 0x01
00048     };
00049 
00051     typedef QFlags<PaintAttribute> PaintAttributes;
00052 
00053     explicit QwtPolarCanvas( QwtPolarPlot * );
00054     virtual ~QwtPolarCanvas();
00055 
00056     QwtPolarPlot *plot();
00057     const QwtPolarPlot *plot() const;
00058 
00059     void setPaintAttribute( PaintAttribute, bool on = true );
00060     bool testPaintAttribute( PaintAttribute ) const;
00061 
00062     const QPixmap *backingStore() const;
00063     void invalidateBackingStore();
00064 
00065     QwtPointPolar invTransform( const QPoint & ) const;
00066     QPoint transform( const QwtPointPolar & ) const;
00067 
00068 protected:
00069     virtual void paintEvent( QPaintEvent * );
00070     virtual void resizeEvent( QResizeEvent * );
00071 
00072 private:
00073     class PrivateData;
00074     PrivateData *d_data;
00075 };
00076 
00077 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPolarCanvas::PaintAttributes )
00078 
00079 #endif