1 | /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
|
---|
2 | * QwtPolar Widget Library
|
---|
3 | * Copyright (C) 2008 Uwe Rathmann
|
---|
4 | *
|
---|
5 | * This library is free software; you can redistribute it and/or
|
---|
6 | * modify it under the terms of the Qwt License, Version 1.0
|
---|
7 | *****************************************************************************/
|
---|
8 |
|
---|
9 | #ifndef QWT_POLAR_SPECTROGRAM_H
|
---|
10 | #define QWT_POLAR_SPECTROGRAM_H
|
---|
11 |
|
---|
12 | #include "qwt_polar_global.h"
|
---|
13 | #include "qwt_polar_item.h"
|
---|
14 | #include <qimage.h>
|
---|
15 |
|
---|
16 | class QwtRasterData;
|
---|
17 | class QwtColorMap;
|
---|
18 |
|
---|
19 | /*!
|
---|
20 | \brief An item, which displays a spectrogram
|
---|
21 |
|
---|
22 | A spectrogram displays threedimenional data, where the 3rd dimension
|
---|
23 | ( the intensity ) is displayed using colors. The colors are calculated
|
---|
24 | from the values using a color map.
|
---|
25 |
|
---|
26 | \sa QwtRasterData, QwtColorMap
|
---|
27 | */
|
---|
28 | class QWT_POLAR_EXPORT QwtPolarSpectrogram: public QwtPolarItem
|
---|
29 | {
|
---|
30 | public:
|
---|
31 | /*!
|
---|
32 | Attributes to modify the drawing algorithm.
|
---|
33 | The default setting disables ApproximatedAtan
|
---|
34 |
|
---|
35 | \sa setPaintAttribute(), testPaintAttribute()
|
---|
36 | */
|
---|
37 | enum PaintAttribute
|
---|
38 | {
|
---|
39 | /*!
|
---|
40 | Use qwtFastAtan2 instead of atan2 for translating
|
---|
41 | widget into polar coordinates.
|
---|
42 | */
|
---|
43 |
|
---|
44 | ApproximatedAtan = 0x01
|
---|
45 | };
|
---|
46 |
|
---|
47 | //! Paint attributes
|
---|
48 | typedef QFlags<PaintAttribute> PaintAttributes;
|
---|
49 |
|
---|
50 | explicit QwtPolarSpectrogram();
|
---|
51 | virtual ~QwtPolarSpectrogram();
|
---|
52 |
|
---|
53 | void setData( QwtRasterData *data );
|
---|
54 | const QwtRasterData *data() const;
|
---|
55 |
|
---|
56 | void setColorMap( QwtColorMap * );
|
---|
57 | const QwtColorMap *colorMap() const;
|
---|
58 |
|
---|
59 | void setPaintAttribute( PaintAttribute, bool on = true );
|
---|
60 | bool testPaintAttribute( PaintAttribute ) const;
|
---|
61 |
|
---|
62 | virtual int rtti() const;
|
---|
63 |
|
---|
64 | virtual void draw( QPainter *painter,
|
---|
65 | const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap,
|
---|
66 | const QPointF &pole, double radius,
|
---|
67 | const QRectF &canvasRect ) const;
|
---|
68 |
|
---|
69 | virtual QwtInterval boundingInterval( int scaleId ) const;
|
---|
70 |
|
---|
71 | protected:
|
---|
72 | virtual QImage renderImage(
|
---|
73 | const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap,
|
---|
74 | const QPointF &pole, const QRect &rect ) const;
|
---|
75 |
|
---|
76 | virtual void renderTile(
|
---|
77 | const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap,
|
---|
78 | const QPointF &pole, const QPoint &imagePos,
|
---|
79 | const QRect &tile, QImage *image ) const;
|
---|
80 |
|
---|
81 | private:
|
---|
82 | class TileInfo;
|
---|
83 | void renderTile( const QwtScaleMap &, const QwtScaleMap &,
|
---|
84 | const QPointF &pole, TileInfo * ) const;
|
---|
85 |
|
---|
86 | class PrivateData;
|
---|
87 | PrivateData *d_data;
|
---|
88 | };
|
---|
89 |
|
---|
90 | Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPolarSpectrogram::PaintAttributes )
|
---|
91 |
|
---|
92 | #endif
|
---|