GNU Radio 3.7.2 C++ API
plot_waterfall.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2008-2012 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  *
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef PLOT_WATERFALL_H
24 #define PLOT_WATERFALL_H
25 
26 #include <qglobal.h>
28 #include <qwt_plot_rasteritem.h>
29 
30 #if QWT_VERSION >= 0x060000
31 #include <qwt_point_3d.h> // doesn't seem necessary, but is...
32 #include <qwt_compat.h>
33 #endif
34 
35 class QwtColorMap;
36 
37 /*!
38  * \brief A plot item, which displays a waterfall spectrogram
39  * \ingroup qtgui_blk
40  *
41  * \details
42  * A waterfall displays threedimenional data, where the 3rd dimension
43  * (the intensity) is displayed using colors. The colors are calculated
44  * from the values using a color map.
45  *
46  * \sa QwtRasterData, QwtColorMap
47  */
48 class PlotWaterfall: public QwtPlotRasterItem
49 {
50 public:
52  const QString &title = QString::null);
53  virtual ~PlotWaterfall();
54 
55  const WaterfallData* data()const;
56 
57  void setColorMap(const QwtColorMap &);
58 
59  const QwtColorMap &colorMap() const;
60 
61 #if QWT_VERSION < 0x060000
62  virtual QwtDoubleRect boundingRect() const;
63  virtual QSize rasterHint(const QwtDoubleRect &) const;
64 #endif
65 
66  virtual int rtti() const;
67 
68  virtual void draw(QPainter *p,
69  const QwtScaleMap &xMap,
70  const QwtScaleMap &yMap,
71  const QRect &rect) const;
72 
73 protected:
74 #if QWT_VERSION < 0x060000
75  QImage renderImage(const QwtScaleMap &xMap,
76  const QwtScaleMap &yMap,
77  const QwtDoubleRect &rect) const;
78 #else
79  QImage renderImage(const QwtScaleMap &xMap,
80  const QwtScaleMap &yMap,
81  const QRectF &rect,
82  const QSize &size=QSize(0,0)) const;
83 #endif
84 
85 private:
86  class PrivateData;
87  PrivateData *d_data;
88 };
89 
90 #endif
QImage renderImage(const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QwtDoubleRect &rect) const
virtual ~PlotWaterfall()
Definition: waterfallGlobalData.h:34
void setColorMap(const QwtColorMap &)
virtual QwtDoubleRect boundingRect() const
virtual void draw(QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect &rect) const
const QwtColorMap & colorMap() const
virtual QSize rasterHint(const QwtDoubleRect &) const
virtual int rtti() const
A plot item, which displays a waterfall spectrogram.
Definition: plot_waterfall.h:48
PlotWaterfall(WaterfallData *data, const QString &title=QString::null)
const WaterfallData * data() const