Qwt Polar User's Guide  1.0.1
Public Types | Public Member Functions | Protected Member Functions
QwtPolarSpectrogram Class Reference

#include <qwt_polar_spectrogram.h>

Inheritance diagram for QwtPolarSpectrogram:
Inheritance graph
[legend]

List of all members.

Public Types

enum  PaintAttribute { ApproximatedAtan = 0x01 }
typedef QFlags< PaintAttributePaintAttributes

Public Member Functions

 QwtPolarSpectrogram ()
virtual ~QwtPolarSpectrogram ()
void setData (QwtRasterData *data)
const QwtRasterData * data () const
void setColorMap (QwtColorMap *)
const QwtColorMap * colorMap () const
void setPaintAttribute (PaintAttribute, bool on=true)
bool testPaintAttribute (PaintAttribute) const
void setRenderThreadCount (uint numThreads)
uint renderThreadCount () const
virtual int rtti () const
virtual void draw (QPainter *painter, const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, const QPointF &pole, double radius, const QRectF &canvasRect) const
virtual QwtInterval boundingInterval (int scaleId) const

Protected Member Functions

virtual QImage renderImage (const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, const QPointF &pole, const QRect &rect) const
virtual void renderTile (const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, const QPointF &pole, const QPoint &imagePos, const QRect &tile, QImage *image) const

Detailed Description

An item, which displays a spectrogram.

A spectrogram displays threedimenional data, where the 3rd dimension ( the intensity ) is displayed using colors. The colors are calculated from the values using a color map.

See also:
QwtRasterData, QwtColorMap

Member Typedef Documentation

Paint attributes.


Member Enumeration Documentation

Attributes to modify the drawing algorithm. The default setting disables ApproximatedAtan

See also:
setPaintAttribute(), testPaintAttribute()
Enumerator:
ApproximatedAtan 

Use qwtFastAtan2 instead of atan2 for translating widget into polar coordinates.


Constructor & Destructor Documentation

QwtPolarSpectrogram::QwtPolarSpectrogram ( ) [explicit]

Constructor.

QwtPolarSpectrogram::~QwtPolarSpectrogram ( ) [virtual]

Destructor.


Member Function Documentation

QwtInterval QwtPolarSpectrogram::boundingInterval ( int  scaleId) const [virtual]

Interval, that is necessary to display the item This interval can be useful for operations like clipping or autoscaling

Parameters:
scaleIdScale index
Returns:
bounding interval ( == position )
See also:
position()

Reimplemented from QwtPolarItem.

const QwtColorMap * QwtPolarSpectrogram::colorMap ( ) const
Returns:
Color Map used for mapping the intensity values to colors
See also:
setColorMap()
const QwtRasterData * QwtPolarSpectrogram::data ( ) const
Returns:
Spectrogram data
See also:
setData()
void QwtPolarSpectrogram::draw ( QPainter *  painter,
const QwtScaleMap &  azimuthMap,
const QwtScaleMap &  radialMap,
const QPointF &  pole,
double  radius,
const QRectF &  canvasRect 
) const [virtual]

Draw the spectrogram

Parameters:
painterPainter
azimuthMapMaps azimuth values to values related to 0.0, M_2PI
radialMapMaps radius values into painter coordinates.
polePosition of the pole in painter coordinates
radiusRadius of the complete plot area in painter coordinates
canvasRectContents rect of the canvas in painter coordinates

Implements QwtPolarItem.

QImage QwtPolarSpectrogram::renderImage ( const QwtScaleMap &  azimuthMap,
const QwtScaleMap &  radialMap,
const QPointF &  pole,
const QRect &  rect 
) const [protected, virtual]

Render an image from the data and color map.

The area is translated into a rect of the paint device. For each pixel of this rect the intensity is mapped into a color.

Parameters:
azimuthMapMaps azimuth values to values related to 0.0, M_2PI
radialMapMaps radius values into painter coordinates.
polePosition of the pole in painter coordinates
rectTarget rectangle of the image in painter coordinates
Returns:
A QImage::Format_Indexed8 or QImage::Format_ARGB32 depending on the color map.
See also:
QwtRasterData::intensity(), QwtColorMap::rgb(), QwtColorMap::colorIndex()
uint QwtPolarSpectrogram::renderThreadCount ( ) const
Returns:
Number of threads to be used for rendering. If numThreads is set to 0, the system specific ideal thread count is used.
Warning:
Rendering in multiple threads is only supported for Qt >= 4.4
See also:
setRenderThreadCount(), renderImage(), renderTile()
void QwtPolarSpectrogram::renderTile ( const QwtScaleMap &  azimuthMap,
const QwtScaleMap &  radialMap,
const QPointF &  pole,
const QPoint &  imagePos,
const QRect &  tile,
QImage *  image 
) const [protected, virtual]

Render a sub-rectangle of an image.

renderTile() is called by renderImage() to render different parts of the image by concurrent threads.

Parameters:
azimuthMapMaps azimuth values to values related to 0.0, M_2PI
radialMapMaps radius values into painter coordinates.
polePosition of the pole in painter coordinates
imagePosTop/left position of the image in painter coordinates
tileSub-rectangle of the tile in painter coordinates
imageImage to be rendered
See also:
setRenderThreadCount()
Note:
renderTile needs to be reentrant
int QwtPolarSpectrogram::rtti ( ) const [virtual]
void QwtPolarSpectrogram::setColorMap ( QwtColorMap *  colorMap)

Change the color map

Often it is useful to display the mapping between intensities and colors as an additional plot axis, showing a color bar.

Parameters:
colorMapColor Map
See also:
colorMap(), QwtScaleWidget::setColorBarEnabled(), QwtScaleWidget::setColorMap()
void QwtPolarSpectrogram::setData ( QwtRasterData *  data)

Set the data to be displayed

Parameters:
dataSpectrogram Data
See also:
data()
Warning:
QwtRasterData::initRaster() is called each time before the image is rendered, but without any useful parameters. Also QwtRasterData::rasterHint() is not used.
void QwtPolarSpectrogram::setPaintAttribute ( PaintAttribute  attribute,
bool  on = true 
)

Specify an attribute how to draw the curve

Parameters:
attributePaint attribute
onOn/Off
See also:
testPaintAttribute()
void QwtPolarSpectrogram::setRenderThreadCount ( uint  numThreads)

Rendering an image from the raster data can often be done parallel on a multicore system.

Parameters:
numThreadsNumber of threads to be used for rendering. If numThreads is set to 0, the system specific ideal thread count is used.

The default thread count is 1 ( = no additional threads )

Warning:
Rendering in multiple threads is only supported for Qt >= 4.4
See also:
renderThreadCount(), renderImage(), renderTile()
bool QwtPolarSpectrogram::testPaintAttribute ( PaintAttribute  attribute) const
Parameters:
attributePaint attribute
Returns:
True, when attribute has been set
See also:
setPaintAttribute()