~showard314/ubuntu/natty/qtiplot/Python2.7_fix

« back to all changes in this revision

Viewing changes to 3rdparty/qwt/src/qwt_plot_spectrogram.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2008-04-04 15:11:55 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20080404151155-rjp12ziov4tryj0o
Tags: 0.9.4-1
* New upstream release.
* Refresh patches.
* Remove 04_homepage_url patch. Merged upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
 
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
#include <qimage.h>
 
11
#include <qpen.h>
 
12
#include <qpainter.h>
 
13
#include "qwt_painter.h"
 
14
#include "qwt_double_interval.h"
 
15
#include "qwt_scale_map.h"
 
16
#include "qwt_color_map.h"
 
17
#include "qwt_plot_spectrogram.h"
 
18
 
 
19
#if QT_VERSION < 0x040000
 
20
typedef QValueVector<QRgb> QwtColorTable;
 
21
#else
 
22
typedef QVector<QRgb> QwtColorTable;
 
23
#endif
 
24
 
 
25
class QwtPlotSpectrogramImage: public QImage
 
26
{
 
27
  // This class hides some Qt3/Qt4 API differences
 
28
public:
 
29
    QwtPlotSpectrogramImage(const QSize &size, QwtColorMap::Format format):
 
30
#if QT_VERSION < 0x040000
 
31
        QImage(size, format == QwtColorMap::RGB ? 32 : 8)
 
32
#else
 
33
        QImage(size, format == QwtColorMap::RGB
 
34
            ? QImage::Format_ARGB32 : QImage::Format_Indexed8 )
 
35
#endif
 
36
    {
 
37
    }
 
38
 
 
39
    QwtPlotSpectrogramImage(const QImage &other):
 
40
        QImage(other)
 
41
    {
 
42
    }
 
43
 
 
44
    void initColorTable(const QImage& other)
 
45
    {
 
46
#if QT_VERSION < 0x040000
 
47
        const unsigned int numColors = other.numColors();
 
48
 
 
49
        setNumColors(numColors);
 
50
        for ( unsigned int i = 0; i < numColors; i++ )
 
51
            setColor(i, other.color(i));
 
52
#else
 
53
        setColorTable(other.colorTable());
 
54
#endif
 
55
    }
 
56
 
 
57
#if QT_VERSION < 0x040000
 
58
 
 
59
    void setColorTable(const QwtColorTable &colorTable)
 
60
    {
 
61
        setNumColors(colorTable.size());
 
62
        for ( unsigned int i = 0; i < colorTable.size(); i++ )
 
63
            setColor(i, colorTable[i]);
 
64
    }
 
65
 
 
66
    QwtColorTable colorTable() const
 
67
    {
 
68
        QwtColorTable table(numColors());
 
69
        for ( int i = 0; i < numColors(); i++ )
 
70
            table[i] = color(i);
 
71
 
 
72
        return table;
 
73
    }
 
74
#endif
 
75
};
 
76
 
 
77
class QwtPlotSpectrogram::PrivateData
 
78
{
 
79
public:
 
80
    class DummyData: public QwtRasterData
 
81
    {
 
82
    public:
 
83
        virtual QwtRasterData *copy() const
 
84
        {
 
85
            return new DummyData();
 
86
        }
 
87
 
 
88
        virtual double value(double, double) const
 
89
        {
 
90
            return 0.0;
 
91
        }
 
92
 
 
93
        virtual QwtDoubleInterval range() const
 
94
        {
 
95
            return QwtDoubleInterval(0.0, 1.0);
 
96
        }
 
97
    };
 
98
 
 
99
    PrivateData()
 
100
    {
 
101
        data = new DummyData();
 
102
        colorMap = new QwtLinearColorMap();
 
103
        displayMode = ImageMode;
 
104
 
 
105
        conrecAttributes = QwtRasterData::IgnoreAllVerticesOnLevel;
 
106
        conrecAttributes |= QwtRasterData::IgnoreOutOfRange;
 
107
    }
 
108
    ~PrivateData()
 
109
    {
 
110
        delete data;
 
111
        delete colorMap;
 
112
    }
 
113
 
 
114
    QwtRasterData *data;
 
115
    QwtColorMap *colorMap;
 
116
    int displayMode;
 
117
 
 
118
    QwtValueList contourLevels;
 
119
    QPen defaultContourPen;
 
120
    int conrecAttributes;
 
121
};
 
122
 
 
123
/*!
 
124
   Sets the following item attributes:
 
125
   - QwtPlotItem::AutoScale: true
 
126
   - QwtPlotItem::Legend:    false
 
127
 
 
128
   The z value is initialized by 8.0.
 
129
   
 
130
   \param title Title
 
131
 
 
132
   \sa QwtPlotItem::setItemAttribute(), QwtPlotItem::setZ()
 
133
*/
 
134
QwtPlotSpectrogram::QwtPlotSpectrogram(const QString &title):
 
135
    QwtPlotRasterItem(title)
 
136
{
 
137
    d_data = new PrivateData();
 
138
 
 
139
    setItemAttribute(QwtPlotItem::AutoScale, true);
 
140
    setItemAttribute(QwtPlotItem::Legend, false);
 
141
 
 
142
    setZ(8.0);
 
143
}
 
144
 
 
145
//! Destructor
 
146
QwtPlotSpectrogram::~QwtPlotSpectrogram()
 
147
{
 
148
    delete d_data;
 
149
}
 
150
 
 
151
//! \return QwtPlotItem::Rtti_PlotSpectrogram
 
152
int QwtPlotSpectrogram::rtti() const
 
153
{
 
154
    return QwtPlotItem::Rtti_PlotSpectrogram;
 
155
}
 
156
 
 
157
/*!
 
158
   The display mode controls how the raster data will be represented.
 
159
 
 
160
   \param mode Display mode
 
161
   \param on On/Off
 
162
 
 
163
   The default setting enables ImageMode.
 
164
 
 
165
   \sa DisplayMode, displayMode()
 
166
*/
 
167
void QwtPlotSpectrogram::setDisplayMode(DisplayMode mode, bool on)
 
168
{
 
169
    if ( on != bool(mode & d_data->displayMode) )
 
170
    {
 
171
        if ( on )
 
172
            d_data->displayMode |= mode;
 
173
        else
 
174
            d_data->displayMode &= ~mode;
 
175
    }
 
176
 
 
177
    itemChanged();
 
178
}
 
179
 
 
180
/*!
 
181
   The display mode controls how the raster data will be represented.
 
182
 
 
183
   \param mode Display mode
 
184
   \return true if mode is enabled
 
185
*/
 
186
bool QwtPlotSpectrogram::testDisplayMode(DisplayMode mode) const
 
187
{
 
188
    return (d_data->displayMode & mode);
 
189
}
 
190
 
 
191
/*!
 
192
  Change the color map
 
193
 
 
194
  Often it is useful to display the mapping between intensities and
 
195
  colors as an additional plot axis, showing a color bar.
 
196
 
 
197
  \param colorMap Color Map
 
198
 
 
199
  \sa colorMap(), QwtScaleWidget::setColorBarEnabled(),
 
200
      QwtScaleWidget::setColorMap()
 
201
*/
 
202
void QwtPlotSpectrogram::setColorMap(const QwtColorMap &colorMap)
 
203
{
 
204
    delete d_data->colorMap;
 
205
    d_data->colorMap = colorMap.copy();
 
206
 
 
207
    invalidateCache();
 
208
    itemChanged();
 
209
}
 
210
 
 
211
/*!
 
212
   \return Color Map used for mapping the intensity values to colors
 
213
   \sa setColorMap()
 
214
*/
 
215
const QwtColorMap &QwtPlotSpectrogram::colorMap() const
 
216
{
 
217
    return *d_data->colorMap;
 
218
}
 
219
 
 
220
/*!
 
221
   \brief Set the default pen for the contour lines
 
222
 
 
223
   If the spectrogram has a valid default contour pen 
 
224
   a contour line is painted using the default contour pen.
 
225
   Otherwise (pen.style() == Qt::NoPen) the pen is calculated
 
226
   for each contour level using contourPen().
 
227
 
 
228
   \sa defaultContourPen, contourPen
 
229
*/
 
230
void QwtPlotSpectrogram::setDefaultContourPen(const QPen &pen)
 
231
{
 
232
    if ( pen != d_data->defaultContourPen )
 
233
    {
 
234
        d_data->defaultContourPen = pen;
 
235
        itemChanged();
 
236
    }
 
237
}
 
238
 
 
239
/*!
 
240
   \return Default contour pen
 
241
   \sa setDefaultContourPen
 
242
*/
 
243
QPen QwtPlotSpectrogram::defaultContourPen() const
 
244
{
 
245
    return d_data->defaultContourPen;
 
246
}
 
247
 
 
248
/*!
 
249
   \brief Calculate the pen for a contour line
 
250
 
 
251
   The color of the pen is the color for level calculated by the color map
 
252
   
 
253
   \param level Contour level
 
254
   \return Pen for the contour line
 
255
   \note contourPen is only used if defaultContourPen().style() == Qt::NoPen
 
256
 
 
257
   \sa setDefaultContourPen, setColorMap, setContourLevels
 
258
*/
 
259
QPen QwtPlotSpectrogram::contourPen(double level) const
 
260
{
 
261
    const QwtDoubleInterval intensityRange = d_data->data->range();
 
262
    const QColor c(d_data->colorMap->rgb(intensityRange, level));
 
263
 
 
264
    return QPen(c);
 
265
}
 
266
 
 
267
/*!
 
268
   Modify an attribute of the CONREC algorithm, used to calculate
 
269
   the contour lines.
 
270
 
 
271
   \param attribute CONREC attribute
 
272
   \param on On/Off
 
273
 
 
274
   \sa testConrecAttribute, renderContourLines, QwtRasterData::contourLines
 
275
*/
 
276
void QwtPlotSpectrogram::setConrecAttribute(
 
277
    QwtRasterData::ConrecAttribute attribute, bool on)
 
278
{
 
279
    if ( bool(d_data->conrecAttributes & attribute) == on )
 
280
        return;
 
281
 
 
282
    if ( on )
 
283
        d_data->conrecAttributes |= attribute;
 
284
    else
 
285
        d_data->conrecAttributes &= ~attribute;
 
286
 
 
287
    itemChanged();
 
288
}
 
289
 
 
290
/*!
 
291
   Test an attribute of the CONREC algorithm, used to calculate
 
292
   the contour lines.
 
293
 
 
294
   \param attribute CONREC attribute
 
295
   \return true, is enabled
 
296
 
 
297
   \sa setConrecAttribute, renderContourLines, QwtRasterData::contourLines
 
298
*/
 
299
bool QwtPlotSpectrogram::testConrecAttribute(
 
300
    QwtRasterData::ConrecAttribute attribute) const
 
301
{   
 
302
    return d_data->conrecAttributes & attribute;
 
303
}
 
304
 
 
305
/*!
 
306
   Set the levels of the contour lines
 
307
 
 
308
   \param levels Values of the contour levels
 
309
   \sa contourLevels, renderContourLines, QwtRasterData::contourLines
 
310
 
 
311
   \note contourLevels returns the same levels but sorted.
 
312
*/
 
313
void QwtPlotSpectrogram::setContourLevels(const QwtValueList &levels)
 
314
{
 
315
    d_data->contourLevels = levels;
 
316
#if QT_VERSION >= 0x040000
 
317
    qSort(d_data->contourLevels);
 
318
#else
 
319
    qHeapSort(d_data->contourLevels);
 
320
#endif
 
321
    itemChanged();
 
322
}
 
323
 
 
324
/*!
 
325
   \brief Return the levels of the contour lines. 
 
326
 
 
327
   The levels are sorted in increasing order.
 
328
 
 
329
   \sa contourLevels, renderContourLines, QwtRasterData::contourLines
 
330
*/
 
331
QwtValueList QwtPlotSpectrogram::contourLevels() const
 
332
{
 
333
    return d_data->contourLevels;
 
334
}
 
335
 
 
336
/*!
 
337
  Set the data to be displayed
 
338
 
 
339
  \param data Spectrogram Data
 
340
  \sa data()
 
341
*/
 
342
void QwtPlotSpectrogram::setData(const QwtRasterData &data)
 
343
{
 
344
    delete d_data->data;
 
345
    d_data->data = data.copy();
 
346
 
 
347
    invalidateCache();
 
348
    itemChanged();
 
349
}
 
350
 
 
351
/*!
 
352
  \return Spectrogram data
 
353
  \sa setData()
 
354
*/
 
355
const QwtRasterData &QwtPlotSpectrogram::data() const
 
356
{
 
357
    return *d_data->data;
 
358
}
 
359
 
 
360
/*!
 
361
   \return Bounding rect of the data
 
362
   \sa QwtRasterData::boundingRect
 
363
*/
 
364
QwtDoubleRect QwtPlotSpectrogram::boundingRect() const
 
365
{
 
366
    return d_data->data->boundingRect();
 
367
}
 
368
 
 
369
/*!
 
370
   \brief Returns the recommended raster for a given rect.
 
371
 
 
372
   F.e the raster hint is used to limit the resolution of
 
373
   the image that is rendered.
 
374
 
 
375
   \param rect Rect for the raster hint
 
376
   \return data().rasterHint(rect)
 
377
*/
 
378
QSize QwtPlotSpectrogram::rasterHint(const QwtDoubleRect &rect) const
 
379
{
 
380
    return d_data->data->rasterHint(rect);
 
381
}
 
382
 
 
383
/*!
 
384
   \brief Render an image from the data and color map.
 
385
 
 
386
   The area is translated into a rect of the paint device. 
 
387
   For each pixel of this rect the intensity is mapped
 
388
   into a color.
 
389
 
 
390
  \param xMap X-Scale Map
 
391
  \param yMap Y-Scale Map
 
392
  \param area Area that should be rendered in scale coordinates.
 
393
 
 
394
   \return A QImage::Format_Indexed8 or QImage::Format_ARGB32 depending 
 
395
           on the color map.
 
396
 
 
397
   \sa QwtRasterData::intensity(), QwtColorMap::rgb(),
 
398
       QwtColorMap::colorIndex()
 
399
*/
 
400
QImage QwtPlotSpectrogram::renderImage(
 
401
    const QwtScaleMap &xMap, const QwtScaleMap &yMap, 
 
402
    const QwtDoubleRect &area) const
 
403
{
 
404
    if ( area.isEmpty() )
 
405
        return QImage();
 
406
 
 
407
    QRect rect = transform(xMap, yMap, area);
 
408
 
 
409
    QwtScaleMap xxMap = xMap;
 
410
    QwtScaleMap yyMap = yMap;
 
411
 
 
412
    const QSize res = d_data->data->rasterHint(area);
 
413
    if ( res.isValid() )
 
414
    {
 
415
        /*
 
416
          It is useless to render an image with a higher resolution
 
417
          than the data offers. Of course someone will have to
 
418
          scale this image later into the size of the given rect, but f.e.
 
419
          in case of postscript this will done on the printer.
 
420
         */
 
421
        rect.setSize(rect.size().boundedTo(res));
 
422
 
 
423
        int px1 = rect.x();
 
424
        int px2 = rect.x() + rect.width();
 
425
        if ( xMap.p1() > xMap.p2() )
 
426
            qSwap(px1, px2);
 
427
 
 
428
        double sx1 = area.x();
 
429
        double sx2 = area.x() + area.width();
 
430
        if ( xMap.s1() > xMap.s2() )
 
431
            qSwap(sx1, sx2);
 
432
 
 
433
        int py1 = rect.y();
 
434
        int py2 = rect.y() + rect.height();
 
435
        if ( yMap.p1() > yMap.p2() )
 
436
            qSwap(py1, py2);
 
437
 
 
438
        double sy1 = area.y();
 
439
        double sy2 = area.y() + area.height();
 
440
        if ( yMap.s1() > yMap.s2() )
 
441
            qSwap(sy1, sy2);
 
442
 
 
443
        xxMap.setPaintInterval(px1, px2);
 
444
        xxMap.setScaleInterval(sx1, sx2);
 
445
        yyMap.setPaintInterval(py1, py2);
 
446
        yyMap.setScaleInterval(sy1, sy2); 
 
447
    }
 
448
 
 
449
    QwtPlotSpectrogramImage image(rect.size(), d_data->colorMap->format());
 
450
 
 
451
    const QwtDoubleInterval intensityRange = d_data->data->range();
 
452
    if ( !intensityRange.isValid() )
 
453
        return image;
 
454
 
 
455
    d_data->data->initRaster(area, rect.size());
 
456
 
 
457
    if ( d_data->colorMap->format() == QwtColorMap::RGB )
 
458
    {
 
459
        for ( int y = rect.top(); y <= rect.bottom(); y++ )
 
460
        {
 
461
            const double ty = yyMap.invTransform(y);
 
462
 
 
463
            QRgb *line = (QRgb *)image.scanLine(y - rect.top());
 
464
            for ( int x = rect.left(); x <= rect.right(); x++ )
 
465
            {
 
466
                const double tx = xxMap.invTransform(x);
 
467
 
 
468
                *line++ = d_data->colorMap->rgb(intensityRange,
 
469
                    d_data->data->value(tx, ty));
 
470
            }
 
471
        }
 
472
    }
 
473
    else if ( d_data->colorMap->format() == QwtColorMap::Indexed )
 
474
    {
 
475
        image.setColorTable(d_data->colorMap->colorTable(intensityRange));
 
476
 
 
477
        for ( int y = rect.top(); y <= rect.bottom(); y++ )
 
478
        {
 
479
            const double ty = yyMap.invTransform(y);
 
480
 
 
481
            unsigned char *line = image.scanLine(y - rect.top());
 
482
            for ( int x = rect.left(); x <= rect.right(); x++ )
 
483
            {
 
484
                const double tx = xxMap.invTransform(x);
 
485
 
 
486
                *line++ = d_data->colorMap->colorIndex(intensityRange,
 
487
                    d_data->data->value(tx, ty));
 
488
            }
 
489
        }
 
490
    }
 
491
 
 
492
    d_data->data->discardRaster();
 
493
 
 
494
    // Mirror the image in case of inverted maps
 
495
 
 
496
    const bool hInvert = xxMap.p1() > xxMap.p2();
 
497
    const bool vInvert = yyMap.p1() < yyMap.p2();
 
498
    if ( hInvert || vInvert )
 
499
    {
 
500
#ifdef __GNUC__
 
501
#warning Better invert the for loops above
 
502
#endif
 
503
#if QT_VERSION < 0x040000
 
504
        image = image.mirror(hInvert, vInvert);
 
505
#else
 
506
        image = image.mirrored(hInvert, vInvert);
 
507
#endif
 
508
    }
 
509
 
 
510
    return image;
 
511
}
 
512
 
 
513
/*!
 
514
   \brief Return the raster to be used by the CONREC contour algorithm.
 
515
 
 
516
   A larger size will improve the precisision of the CONREC algorithm,
 
517
   but will slow down the time that is needed to calculate the lines.
 
518
 
 
519
   The default implementation returns rect.size() / 2 bounded to
 
520
   data().rasterHint().
 
521
 
 
522
   \param area Rect, where to calculate the contour lines
 
523
   \param rect Rect in pixel coordinates, where to paint the contour lines
 
524
   \return Raster to be used by the CONREC contour algorithm.
 
525
 
 
526
   \note The size will be bounded to rect.size().
 
527
   
 
528
   \sa drawContourLines, QwtRasterData::contourLines
 
529
*/
 
530
QSize QwtPlotSpectrogram::contourRasterSize(const QwtDoubleRect &area,
 
531
    const QRect &rect) const
 
532
{
 
533
    QSize raster = rect.size() / 2;
 
534
 
 
535
    const QSize rasterHint = d_data->data->rasterHint(area);
 
536
    if ( rasterHint.isValid() )
 
537
        raster = raster.boundedTo(rasterHint);
 
538
 
 
539
    return raster;
 
540
}
 
541
 
 
542
/*!
 
543
   Calculate contour lines
 
544
 
 
545
   \param rect Rectangle, where to calculate the contour lines
 
546
   \param raster Raster, used by the CONREC algorithm
 
547
 
 
548
   \sa contourLevels, setConrecAttribute, QwtRasterData::contourLines
 
549
*/
 
550
QwtRasterData::ContourLines QwtPlotSpectrogram::renderContourLines(
 
551
    const QwtDoubleRect &rect, const QSize &raster) const
 
552
{
 
553
    return d_data->data->contourLines(rect, raster,
 
554
        d_data->contourLevels, d_data->conrecAttributes );
 
555
}
 
556
 
 
557
/*!
 
558
   Paint the contour lines
 
559
 
 
560
   \param painter Painter
 
561
   \param xMap Maps x-values into pixel coordinates.
 
562
   \param yMap Maps y-values into pixel coordinates.
 
563
   \param contourLines Contour lines
 
564
 
 
565
   \sa renderContourLines, defaultContourPen, contourPen
 
566
*/
 
567
void QwtPlotSpectrogram::drawContourLines(QPainter *painter,
 
568
        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
 
569
        const QwtRasterData::ContourLines &contourLines) const
 
570
{
 
571
    const QwtDoubleInterval intensityRange = d_data->data->range();
 
572
 
 
573
    const int numLevels = (int)d_data->contourLevels.size();
 
574
    for (int l = 0; l < numLevels; l++)
 
575
    {
 
576
        const double level = d_data->contourLevels[l];
 
577
 
 
578
        QPen pen = defaultContourPen();
 
579
        if ( pen.style() == Qt::NoPen )
 
580
            pen = contourPen(level);
 
581
 
 
582
        if ( pen.style() == Qt::NoPen )
 
583
            continue;
 
584
 
 
585
        painter->setPen(pen);
 
586
 
 
587
#if QT_VERSION >= 0x040000
 
588
        const QPolygonF &lines = contourLines[level];
 
589
#else
 
590
        const QwtArray<QwtDoublePoint> &lines = contourLines[level];
 
591
#endif
 
592
        for ( int i = 0; i < (int)lines.size(); i += 2 )
 
593
        {
 
594
            const QPoint p1( xMap.transform(lines[i].x()),
 
595
                yMap.transform(lines[i].y()) );
 
596
            const QPoint p2( xMap.transform(lines[i+1].x()),
 
597
                yMap.transform(lines[i+1].y()) );
 
598
 
 
599
            QwtPainter::drawLine(painter, p1, p2);
 
600
        }
 
601
    }
 
602
}
 
603
 
 
604
/*!
 
605
  \brief Draw the spectrogram
 
606
 
 
607
  \param painter Painter
 
608
  \param xMap Maps x-values into pixel coordinates.
 
609
  \param yMap Maps y-values into pixel coordinates.
 
610
  \param canvasRect Contents rect of the canvas in painter coordinates 
 
611
 
 
612
  \sa setDisplayMode, renderImage, 
 
613
      QwtPlotRasterItem::draw, drawContourLines
 
614
*/
 
615
 
 
616
void QwtPlotSpectrogram::draw(QPainter *painter,
 
617
    const QwtScaleMap &xMap, const QwtScaleMap &yMap,
 
618
    const QRect &canvasRect) const
 
619
{
 
620
    if ( d_data->displayMode & ImageMode )
 
621
        QwtPlotRasterItem::draw(painter, xMap, yMap, canvasRect);
 
622
 
 
623
    if ( d_data->displayMode & ContourMode )
 
624
    {
 
625
        // Add some pixels at the borders, so that 
 
626
        const int margin = 2;
 
627
        QRect rasterRect(canvasRect.x() - margin, canvasRect.y() - margin,
 
628
            canvasRect.width() + 2 * margin, canvasRect.height() + 2 * margin);
 
629
 
 
630
        QwtDoubleRect area = invTransform(xMap, yMap, rasterRect);
 
631
 
 
632
        const QwtDoubleRect br = boundingRect();
 
633
        if ( br.isValid() && br.contains(area) )
 
634
        {
 
635
            area &= br;
 
636
            rasterRect = transform(xMap, yMap, area);
 
637
        }
 
638
 
 
639
        QSize raster = contourRasterSize(area, rasterRect);
 
640
        raster = raster.boundedTo(rasterRect.size());
 
641
        if ( raster.isValid() )
 
642
        {
 
643
            const QwtRasterData::ContourLines lines =
 
644
                renderContourLines(area, raster);
 
645
 
 
646
            drawContourLines(painter, xMap, yMap, lines);
 
647
        }
 
648
    }
 
649
}
 
650