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 <qglobal.h>
00014 
00015 #include "qwt_valuelist.h" 
00016 #include "qwt_raster_data.h" 
00017 #include "qwt_plot_rasteritem.h" 
00018 
00019 class QwtColorMap;
00020 
00035 class QWT_EXPORT QwtPlotSpectrogram: public QwtPlotRasterItem
00036 {
00037 public:
00051     enum DisplayMode
00052     {
00053         ImageMode = 1,
00054         ContourMode = 2
00055     };
00056 
00057     explicit QwtPlotSpectrogram(const QString &title = QString::null);
00058     virtual ~QwtPlotSpectrogram();
00059 
00060     void setDisplayMode(DisplayMode, bool on = true);
00061     bool testDisplayMode(DisplayMode) const;
00062 
00063     void setData(const QwtRasterData &data);
00064     const QwtRasterData &data() const;
00065 
00066     void setColorMap(const QwtColorMap &);
00067     const QwtColorMap &colorMap() const;
00068 
00069     virtual QwtDoubleRect boundingRect() const;
00070     virtual QSize rasterHint(const QwtDoubleRect &) const;
00071 
00072     void setDefaultContourPen(const QPen &);
00073     QPen defaultContourPen() const;
00074 
00075     virtual QPen contourPen(double level) const;
00076 
00077     void setConrecAttribute(QwtRasterData::ConrecAttribute, bool on);
00078     bool testConrecAttribute(QwtRasterData::ConrecAttribute) const;
00079 
00080     void setContourLevels(const QwtValueList &);
00081     QwtValueList contourLevels() const;
00082 
00083     virtual int rtti() const;
00084 
00085     virtual void draw(QPainter *p,
00086         const QwtScaleMap &xMap, const QwtScaleMap &yMap,
00087         const QRect &rect) const;
00088 
00089 protected:
00090     virtual QImage renderImage(
00091         const QwtScaleMap &xMap, const QwtScaleMap &yMap, 
00092         const QwtDoubleRect &rect) const;
00093 
00094     virtual QSize contourRasterSize(
00095         const QwtDoubleRect &, const QRect &) const;
00096 
00097     virtual QwtRasterData::ContourLines renderContourLines(
00098         const QwtDoubleRect &rect, const QSize &raster) const;
00099 
00100     virtual void drawContourLines(QPainter *p,
00101         const QwtScaleMap &xMap, const QwtScaleMap &yMap,
00102         const QwtRasterData::ContourLines& lines) const;
00103 
00104 private:
00105     class PrivateData;
00106     PrivateData *d_data;
00107 };
00108 
00109 #endif

Generated on Mon Feb 26 21:22:38 2007 for Qwt User's Guide by  doxygen 1.4.6