source: ntrip/trunk/BNC/qwt/qwt_plot_spectrogram.h@ 11158

Last change on this file since 11158 was 11158, checked in by stuerze, 4 weeks ago

deprecated functions exchanged libs updated

File size: 3.6 KB
RevLine 
[11158]1/******************************************************************************
[4271]2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the Qwt License, Version 1.0
8 *****************************************************************************/
9
10#ifndef QWT_PLOT_SPECTROGRAM_H
11#define QWT_PLOT_SPECTROGRAM_H
12
13#include "qwt_global.h"
14#include "qwt_raster_data.h"
15#include "qwt_plot_rasteritem.h"
16
17class QwtColorMap;
[11158]18template< typename T > class QList;
[4271]19
20/*!
[11158]21 \brief A plot item, which displays a spectrogram
[4271]22
[11158]23 A spectrogram displays 3-dimensional data, where the 3rd dimension
24 ( the intensity ) is displayed using colors. The colors are calculated
25 from the values using a color map.
[4271]26
[11158]27 On multi-core systems the performance of the image composition
28 can often be improved by dividing the area into tiles - each of them
29 rendered in a different thread ( see QwtPlotItem::setRenderThreadCount() ).
[8127]30
[11158]31 In ContourMode contour lines are painted for the contour levels.
[4271]32
[11158]33 \sa QwtRasterData, QwtColorMap, QwtPlotItem::setRenderThreadCount()
34 */
[4271]35
[11158]36class QWT_EXPORT QwtPlotSpectrogram : public QwtPlotRasterItem
[4271]37{
[11158]38 public:
[4271]39 /*!
[11158]40 The display mode controls how the raster data will be represented.
41 \sa setDisplayMode(), testDisplayMode()
42 */
[4271]43
44 enum DisplayMode
45 {
46 //! The values are mapped to colors using a color map.
47 ImageMode = 0x01,
48
49 //! The data is displayed using contour lines
50 ContourMode = 0x02
51 };
52
[11158]53 Q_DECLARE_FLAGS( DisplayModes, DisplayMode )
[4271]54
[11158]55 explicit QwtPlotSpectrogram( const QString& title = QString() );
[4271]56 virtual ~QwtPlotSpectrogram();
57
58 void setDisplayMode( DisplayMode, bool on = true );
59 bool testDisplayMode( DisplayMode ) const;
60
[11158]61 void setData( QwtRasterData* data );
62 const QwtRasterData* data() const;
63 QwtRasterData* data();
[4271]64
[11158]65 void setColorMap( QwtColorMap* );
66 const QwtColorMap* colorMap() const;
[4271]67
[11158]68 void setColorTableSize( int numColors );
69 int colorTableSize() const;
[4271]70
[11158]71 virtual QwtInterval interval( Qt::Axis ) const QWT_OVERRIDE;
72 virtual QRectF pixelHint( const QRectF& ) const QWT_OVERRIDE;
73
74 void setDefaultContourPen( const QColor&,
[8127]75 qreal width = 0.0, Qt::PenStyle = Qt::SolidLine );
[11158]76 void setDefaultContourPen( const QPen& );
[4271]77 QPen defaultContourPen() const;
78
79 virtual QPen contourPen( double level ) const;
80
81 void setConrecFlag( QwtRasterData::ConrecFlag, bool on );
82 bool testConrecFlag( QwtRasterData::ConrecFlag ) const;
83
[11158]84 void setContourLevels( const QList< double >& );
85 QList< double > contourLevels() const;
[4271]86
[11158]87 virtual int rtti() const QWT_OVERRIDE;
[4271]88
[11158]89 virtual void draw( QPainter*,
90 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
91 const QRectF& canvasRect ) const QWT_OVERRIDE;
[4271]92
[11158]93 protected:
[4271]94 virtual QImage renderImage(
[11158]95 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
96 const QRectF& area, const QSize& imageSize ) const QWT_OVERRIDE;
[4271]97
98 virtual QSize contourRasterSize(
[11158]99 const QRectF&, const QRect& ) const;
[4271]100
101 virtual QwtRasterData::ContourLines renderContourLines(
[11158]102 const QRectF& rect, const QSize& raster ) const;
[4271]103
[11158]104 virtual void drawContourLines( QPainter*,
105 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
[9383]106 const QwtRasterData::ContourLines& ) const;
[4271]107
[11158]108 void renderTile( const QwtScaleMap& xMap, const QwtScaleMap& yMap,
109 const QRect& tile, QImage* ) const;
[4271]110
[11158]111 private:
[4271]112 class PrivateData;
[11158]113 PrivateData* m_data;
[4271]114};
115
116Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotSpectrogram::DisplayModes )
117
118#endif
Note: See TracBrowser for help on using the repository browser.