GNU Radio 3.7.1 C++ API
|
00001 /* -*- c++ -*- */ 00002 /* 00003 * Copyright 2012,2013 Free Software Foundation, Inc. 00004 * 00005 * This file is part of GNU Radio 00006 * 00007 * GNU Radio is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 3, or (at your option) 00010 * any later version. 00011 * 00012 * GNU Radio is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with GNU Radio; see the file COPYING. If not, write to 00019 * the Free Software Foundation, Inc., 51 Franklin Street, 00020 * Boston, MA 02110-1301, USA. 00021 */ 00022 00023 #ifndef PLOT_TIMERASTER_H 00024 #define PLOT_TIMERASTER_H 00025 00026 #include <qglobal.h> 00027 #include <gnuradio/qtgui/timeRasterGlobalData.h> 00028 #include <qwt_plot_rasteritem.h> 00029 00030 #if QWT_VERSION >= 0x060000 00031 #include <qwt_point_3d.h> // doesn't seem necessary, but is... 00032 #include <qwt_compat.h> 00033 #endif 00034 00035 class QwtColorMap; 00036 00037 /*! 00038 * \brief A plot item, which displays a time raster. 00039 * \ingroup qtgui_blk 00040 * 00041 * \details 00042 * A time raster displays threedimenional data, where the 3rd dimension 00043 * (the intensity) is displayed using colors. The colors are calculated 00044 * from the values using a color map. 00045 * 00046 * \sa QwtRasterData, QwtColorMap 00047 */ 00048 class PlotTimeRaster: public QwtPlotRasterItem 00049 { 00050 public: 00051 explicit PlotTimeRaster(const QString &title = QString::null); 00052 virtual ~PlotTimeRaster(); 00053 00054 const TimeRasterData* data()const; 00055 00056 void setData(TimeRasterData *data); 00057 00058 void setColorMap(const QwtColorMap *map); 00059 00060 const QwtColorMap &colorMap() const; 00061 00062 #if QWT_VERSION < 0x060000 00063 virtual QwtDoubleRect boundingRect() const; 00064 virtual QSize rasterHint(const QwtDoubleRect &) const; 00065 virtual QwtDoubleInterval interval(Qt::Axis ax) const; 00066 #else 00067 virtual QwtInterval interval(Qt::Axis ax) const; 00068 #endif 00069 00070 virtual int rtti() const; 00071 00072 virtual void draw(QPainter *p, 00073 const QwtScaleMap &xMap, 00074 const QwtScaleMap &yMap, 00075 const QRect &rect) const; 00076 00077 protected: 00078 #if QWT_VERSION < 0x060000 00079 QImage renderImage(const QwtScaleMap &xMap, 00080 const QwtScaleMap &yMap, 00081 const QwtDoubleRect &rect) const; 00082 #else 00083 QImage renderImage(const QwtScaleMap &xMap, 00084 const QwtScaleMap &yMap, 00085 const QRectF &rect, 00086 const QSize &size=QSize(0,0)) const; 00087 #endif 00088 00089 private: 00090 class PrivateData; 00091 PrivateData *d_data; 00092 }; 00093 00094 #endif