GNU Radio Manual and C++ API Reference  3.8.4.0
The Free & Open Software Radio Ecosystem
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 
27 #include <qglobal.h>
28 #include <qwt_plot_rasteritem.h>
29 
30 #if QWT_VERSION >= 0x060200
31 #include "qwt_interval.h"
32 #include <qsize.h>
33 
34 typedef QwtInterval QwtDoubleInterval;
35 #elif QWT_VERSION >= 0x060000
36 #include <qwt_compat.h>
37 #include <qwt_point_3d.h> // doesn't seem necessary, but is...
38 #endif
39 
40 class QwtColorMap;
41 
42 /*!
43  * \brief A plot item, which displays a waterfall spectrogram
44  * \ingroup qtgui_blk
45  *
46  * \details
47  * A waterfall displays three-dimensional data, where the 3rd dimension
48  * (the intensity) is displayed using colors. The colors are calculated
49  * from the values using a color map.
50  *
51  * \sa QwtRasterData, QwtColorMap
52  */
53 class PlotWaterfall : public QwtPlotRasterItem
54 {
55 public:
56  explicit PlotWaterfall(WaterfallData* data, const QString& title = QString::null);
57  virtual ~PlotWaterfall();
58 
59  const WaterfallData* data() const;
60 
61  void setColorMap(const QwtColorMap&);
62 
63  const QwtColorMap& colorMap() const;
64 
65 #if QWT_VERSION < 0x060000
66  virtual QwtDoubleRect boundingRect() const;
67  virtual QSize rasterHint(const QwtDoubleRect&) const;
68 #endif
69 
70  virtual int rtti() const;
71 
72 protected:
73 #if QWT_VERSION < 0x060000
74  QImage renderImage(const QwtScaleMap& xMap,
75  const QwtScaleMap& yMap,
76  const QwtDoubleRect& rect) const;
77 #else
78  QImage renderImage(const QwtScaleMap& xMap,
79  const QwtScaleMap& yMap,
80  const QRectF& rect,
81  const QSize& size = QSize(0, 0)) const;
82 #endif
83 
84 private:
85  class PrivateData;
86  PrivateData* d_data;
87 };
88 
89 #endif
QImage renderImage(const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QwtDoubleRect &rect) const
const WaterfallData * data() const
virtual ~PlotWaterfall()
Definition: waterfallGlobalData.h:38
virtual int rtti() const
void setColorMap(const QwtColorMap &)
virtual QSize rasterHint(const QwtDoubleRect &) const
const QwtColorMap & colorMap() const
A plot item, which displays a waterfall spectrogram.
Definition: plot_waterfall.h:53
PlotWaterfall(WaterfallData *data, const QString &title=QString::null)
virtual QwtDoubleRect boundingRect() const