Qwt User's Guide svn
qwt_plot_spectrogram.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_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 
00034 class QWT_EXPORT QwtPlotSpectrogram: public QwtPlotRasterItem
00035 {
00036 public:
00042     enum DisplayMode
00043     {
00045         ImageMode = 0x01,
00046 
00048         ContourMode = 0x02
00049     };
00050 
00052     typedef QFlags<DisplayMode> DisplayModes;
00053 
00054     explicit QwtPlotSpectrogram( const QString &title = QString::null );
00055     virtual ~QwtPlotSpectrogram();
00056 
00057     void setRenderThreadCount( uint numThreads );
00058     uint renderThreadCount() const;
00059 
00060     void setDisplayMode( DisplayMode, bool on = true );
00061     bool testDisplayMode( DisplayMode ) const;
00062 
00063     void setData( QwtRasterData *data );
00064     const QwtRasterData *data() const;
00065     QwtRasterData *data();
00066 
00067     void setColorMap( QwtColorMap * );
00068     const QwtColorMap *colorMap() const;
00069 
00070     virtual QwtInterval interval(Qt::Axis) const;
00071     virtual QRectF pixelHint( const QRectF & ) const;
00072 
00073     void setDefaultContourPen( const QPen & );
00074     QPen defaultContourPen() const;
00075 
00076     virtual QPen contourPen( double level ) const;
00077 
00078     void setConrecFlag( QwtRasterData::ConrecFlag, bool on );
00079     bool testConrecFlag( QwtRasterData::ConrecFlag ) const;
00080 
00081     void setContourLevels( const QList<double> & );
00082     QList<double> contourLevels() const;
00083 
00084     virtual int rtti() const;
00085 
00086     virtual void draw( QPainter *p,
00087         const QwtScaleMap &xMap, const QwtScaleMap &yMap,
00088         const QRectF &rect ) const;
00089 
00090 protected:
00091     virtual QImage renderImage(
00092         const QwtScaleMap &xMap, const QwtScaleMap &yMap,
00093         const QRectF &area, const QSize &imageSize ) const;
00094 
00095     virtual QSize contourRasterSize(
00096         const QRectF &, const QRect & ) const;
00097 
00098     virtual QwtRasterData::ContourLines renderContourLines(
00099         const QRectF &rect, const QSize &raster ) const;
00100 
00101     virtual void drawContourLines( QPainter *p,
00102         const QwtScaleMap &xMap, const QwtScaleMap &yMap,
00103         const QwtRasterData::ContourLines& lines ) const;
00104 
00105     void renderTile( const QwtScaleMap &xMap, const QwtScaleMap &yMap,
00106         const QRect &imageRect, QImage *image ) const;
00107 
00108 private:
00109     class PrivateData;
00110     PrivateData *d_data;
00111 };
00112 
00113 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotSpectrogram::DisplayModes )
00114 
00115 #endif
qmi style