Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef QWT_PLOT_SPECTROGRAM_H
00011 #define QWT_PLOT_SPECTROGRAM_H
00012
00013 #include "qwt_global.h"
00014 #include "qwt_raster_data.h"
00015 #include "qwt_plot_rasteritem.h"
00016 #include <qlist.h>
00017
00018 class QwtColorMap;
00019
00038 class QWT_EXPORT QwtPlotSpectrogram: public QwtPlotRasterItem
00039 {
00040 public:
00046 enum DisplayMode
00047 {
00049 ImageMode = 0x01,
00050
00052 ContourMode = 0x02
00053 };
00054
00056 typedef QFlags<DisplayMode> DisplayModes;
00057
00058 explicit QwtPlotSpectrogram( const QString &title = QString::null );
00059 virtual ~QwtPlotSpectrogram();
00060
00061 void setDisplayMode( DisplayMode, bool on = true );
00062 bool testDisplayMode( DisplayMode ) const;
00063
00064 void setData( QwtRasterData *data );
00065 const QwtRasterData *data() const;
00066 QwtRasterData *data();
00067
00068 void setColorMap( QwtColorMap * );
00069 const QwtColorMap *colorMap() const;
00070
00071 void setMaxRGBTableSize( int numColors );
00072 int maxRGBTableSize() const;
00073
00074 virtual QwtInterval interval(Qt::Axis) const;
00075 virtual QRectF pixelHint( const QRectF & ) const;
00076
00077 void setDefaultContourPen( const QColor &,
00078 qreal width = 0.0, Qt::PenStyle = Qt::SolidLine );
00079 void setDefaultContourPen( const QPen & );
00080 QPen defaultContourPen() const;
00081
00082 virtual QPen contourPen( double level ) const;
00083
00084 void setConrecFlag( QwtRasterData::ConrecFlag, bool on );
00085 bool testConrecFlag( QwtRasterData::ConrecFlag ) const;
00086
00087 void setContourLevels( const QList<double> & );
00088 QList<double> contourLevels() const;
00089
00090 virtual int rtti() const;
00091
00092 virtual void draw( QPainter *p,
00093 const QwtScaleMap &xMap, const QwtScaleMap &yMap,
00094 const QRectF &rect ) const;
00095
00096 protected:
00097 virtual QImage renderImage(
00098 const QwtScaleMap &xMap, const QwtScaleMap &yMap,
00099 const QRectF &area, const QSize &imageSize ) const;
00100
00101 virtual QSize contourRasterSize(
00102 const QRectF &, const QRect & ) const;
00103
00104 virtual QwtRasterData::ContourLines renderContourLines(
00105 const QRectF &rect, const QSize &raster ) const;
00106
00107 virtual void drawContourLines( QPainter *p,
00108 const QwtScaleMap &xMap, const QwtScaleMap &yMap,
00109 const QwtRasterData::ContourLines& lines ) const;
00110
00111 void renderTile( const QwtScaleMap &xMap, const QwtScaleMap &yMap,
00112 const QRect &imageRect, QImage *image ) const;
00113
00114 private:
00115 class PrivateData;
00116 PrivateData *d_data;
00117 };
00118
00119 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotSpectrogram::DisplayModes )
00120
00121 #endif