1
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
3
* Copyright (C) 1997 Josef Wilgen
4
* Copyright (C) 2002 Uwe Rathmann
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
*****************************************************************************/
10
#include "qwt_plot_curve.h"
12
#include "qwt_clipper.h"
13
#include "qwt_painter.h"
14
#include "qwt_legend.h"
15
#include "qwt_legend_item.h"
16
#include "qwt_scale_map.h"
18
#include "qwt_plot_canvas.h"
19
#include "qwt_curve_fitter.h"
20
#include "qwt_symbol.h"
23
#include <qalgorithms.h>
26
static int verifyRange( int size, int &i1, int &i2 )
31
i1 = qBound( 0, i1, size - 1 );
32
i2 = qBound( 0, i2, size - 1 );
37
return ( i2 - i1 + 1 );
40
class QwtPlotCurve::PrivateData
44
style( QwtPlotCurve::Lines ),
48
paintAttributes( QwtPlotCurve::ClipPolygons ),
51
pen = QPen( Qt::black );
52
curveFitter = new QwtSplineCurveFitter;
61
QwtPlotCurve::CurveStyle style;
64
const QwtSymbol *symbol;
65
QwtCurveFitter *curveFitter;
70
QwtPlotCurve::CurveAttributes attributes;
71
QwtPlotCurve::PaintAttributes paintAttributes;
73
QwtPlotCurve::LegendAttributes legendAttributes;
78
\param title Title of the curve
80
QwtPlotCurve::QwtPlotCurve( const QwtText &title ):
81
QwtPlotSeriesItem<QPointF>( title )
88
\param title Title of the curve
90
QwtPlotCurve::QwtPlotCurve( const QString &title ):
91
QwtPlotSeriesItem<QPointF>( QwtText( title ) )
97
QwtPlotCurve::~QwtPlotCurve()
102
//! Initialize internal members
103
void QwtPlotCurve::init()
105
setItemAttribute( QwtPlotItem::Legend );
106
setItemAttribute( QwtPlotItem::AutoScale );
108
d_data = new PrivateData;
109
d_series = new QwtPointSeriesData();
114
//! \return QwtPlotItem::Rtti_PlotCurve
115
int QwtPlotCurve::rtti() const
117
return QwtPlotItem::Rtti_PlotCurve;
121
Specify an attribute how to draw the curve
123
\param attribute Paint attribute
125
\sa testPaintAttribute()
127
void QwtPlotCurve::setPaintAttribute( PaintAttribute attribute, bool on )
130
d_data->paintAttributes |= attribute;
132
d_data->paintAttributes &= ~attribute;
136
\brief Return the current paint attributes
137
\sa setPaintAttribute()
139
bool QwtPlotCurve::testPaintAttribute( PaintAttribute attribute ) const
141
return ( d_data->paintAttributes & attribute );
145
Specify an attribute how to draw the legend identifier
147
\param attribute Attribute
149
/sa testLegendAttribute()
151
void QwtPlotCurve::setLegendAttribute( LegendAttribute attribute, bool on )
154
d_data->legendAttributes |= attribute;
156
d_data->legendAttributes &= ~attribute;
160
\brief Return the current paint attributes
161
\sa setLegendAttribute()
163
bool QwtPlotCurve::testLegendAttribute( LegendAttribute attribute ) const
165
return ( d_data->legendAttributes & attribute );
169
Set the curve's drawing style
171
\param style Curve style
174
void QwtPlotCurve::setStyle( CurveStyle style )
176
if ( style != d_data->style )
178
d_data->style = style;
184
Return the current style
187
QwtPlotCurve::CurveStyle QwtPlotCurve::style() const
189
return d_data->style;
198
void QwtPlotCurve::setSymbol( const QwtSymbol *symbol )
200
if ( symbol != d_data->symbol )
202
delete d_data->symbol;
203
d_data->symbol = symbol;
209
\return Current symbol or NULL, when no symbol has been assigned
212
const QwtSymbol *QwtPlotCurve::symbol() const
214
return d_data->symbol;
223
void QwtPlotCurve::setPen( const QPen &pen )
225
if ( pen != d_data->pen )
233
\return Pen used to draw the lines
234
\sa setPen(), brush()
236
const QPen& QwtPlotCurve::pen() const
242
\brief Assign a brush.
244
In case of brush.style() != QBrush::NoBrush
245
and style() != QwtPlotCurve::Sticks
246
the area between the curve and the baseline will be filled.
248
In case !brush.color().isValid() the area will be filled by
249
pen.color(). The fill algorithm simply connects the first and the
250
last curve point to the baseline. So the curve data has to be sorted
251
(ascending or descending).
253
\param brush New brush
254
\sa brush(), setBaseline(), baseline()
256
void QwtPlotCurve::setBrush( const QBrush &brush )
258
if ( brush != d_data->brush )
260
d_data->brush = brush;
266
\return Brush used to fill the area between lines and the baseline
267
\sa setBrush(), setBaseline(), baseline()
269
const QBrush& QwtPlotCurve::brush() const
271
return d_data->brush;
275
Draw an interval of the curve
277
\param painter Painter
278
\param xMap Maps x-values into pixel coordinates.
279
\param yMap Maps y-values into pixel coordinates.
280
\param canvasRect Contents rect of the canvas
281
\param from Index of the first point to be painted
282
\param to Index of the last point to be painted. If to < 0 the
283
curve will be painted to its last point.
285
\sa drawCurve(), drawSymbols(),
287
void QwtPlotCurve::drawSeries( QPainter *painter,
288
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
289
const QRectF &canvasRect, int from, int to ) const
291
if ( !painter || dataSize() <= 0 )
297
if ( verifyRange( dataSize(), from, to ) > 0 )
300
painter->setPen( d_data->pen );
303
Qt 4.0.0 is slow when drawing lines, but it's even
304
slower when the painter has a brush. So we don't
305
set the brush before we really need it.
308
drawCurve( painter, d_data->style, xMap, yMap, canvasRect, from, to );
311
if ( d_data->symbol &&
312
( d_data->symbol->style() != QwtSymbol::NoSymbol ) )
315
drawSymbols( painter, *d_data->symbol,
316
xMap, yMap, canvasRect, from, to );
323
\brief Draw the line part (without symbols) of a curve interval.
324
\param painter Painter
325
\param style curve style, see QwtPlotCurve::CurveStyle
328
\param canvasRect Contents rect of the canvas
329
\param from index of the first point to be painted
330
\param to index of the last point to be painted
331
\sa draw(), drawDots(), drawLines(), drawSteps(), drawSticks()
333
void QwtPlotCurve::drawCurve( QPainter *painter, int style,
334
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
335
const QRectF &canvasRect, int from, int to ) const
340
if ( testCurveAttribute( Fitted ) )
342
// we always need the complete
347
drawLines( painter, xMap, yMap, canvasRect, from, to );
350
drawSticks( painter, xMap, yMap, canvasRect, from, to );
353
drawSteps( painter, xMap, yMap, canvasRect, from, to );
356
drawDots( painter, xMap, yMap, canvasRect, from, to );
367
If the CurveAttribute Fitted is enabled a QwtCurveFitter tries
368
to interpolate/smooth the curve, before it is painted.
370
\param painter Painter
373
\param canvasRect Contents rect of the canvas
374
\param from index of the first point to be painted
375
\param to index of the last point to be painted
377
\sa setCurveAttribute(), setCurveFitter(), draw(),
378
drawLines(), drawDots(), drawSteps(), drawSticks()
380
void QwtPlotCurve::drawLines( QPainter *painter,
381
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
382
const QRectF &canvasRect, int from, int to ) const
384
int size = to - from + 1;
388
const bool doAlign = QwtPainter::roundingAlignment( painter );
390
QPolygonF polyline( size );
392
QPointF *points = polyline.data();
393
for ( int i = from; i <= to; i++ )
395
const QPointF sample = d_series->sample( i );
397
double x = xMap.transform( sample.x() );
398
double y = yMap.transform( sample.y() );
405
points[i - from].rx() = x;
406
points[i - from].ry() = y;
409
if ( ( d_data->attributes & Fitted ) && d_data->curveFitter )
410
polyline = d_data->curveFitter->fitCurve( polyline );
412
if ( d_data->paintAttributes & ClipPolygons )
414
qreal pw = qMax( qreal( 1.0 ), painter->pen().widthF());
415
const QPolygonF clipped = QwtClipper::clipPolygonF(
416
canvasRect.adjusted(-pw, -pw, pw, pw), polyline, false );
418
QwtPainter::drawPolyline( painter, clipped );
422
QwtPainter::drawPolyline( painter, polyline );
425
if ( d_data->brush.style() != Qt::NoBrush )
426
fillCurve( painter, xMap, yMap, canvasRect, polyline );
432
\param painter Painter
435
\param canvasRect Contents rect of the canvas
436
\param from index of the first point to be painted
437
\param to index of the last point to be painted
439
\sa draw(), drawCurve(), drawDots(), drawLines(), drawSteps()
441
void QwtPlotCurve::drawSticks( QPainter *painter,
442
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
443
const QRectF &, int from, int to ) const
446
painter->setRenderHint( QPainter::Antialiasing, false );
448
const bool doAlign = QwtPainter::roundingAlignment( painter );
450
double x0 = xMap.transform( d_data->baseline );
451
double y0 = yMap.transform( d_data->baseline );
458
const Qt::Orientation o = orientation();
460
for ( int i = from; i <= to; i++ )
462
const QPointF sample = d_series->sample( i );
463
double xi = xMap.transform( sample.x() );
464
double yi = yMap.transform( sample.y() );
471
if ( o == Qt::Horizontal )
472
QwtPainter::drawLine( painter, x0, yi, xi, yi );
474
QwtPainter::drawLine( painter, xi, y0, xi, yi );
483
\param painter Painter
486
\param canvasRect Contents rect of the canvas
487
\param from index of the first point to be painted
488
\param to index of the last point to be painted
490
\sa draw(), drawCurve(), drawSticks(), drawLines(), drawSteps()
492
void QwtPlotCurve::drawDots( QPainter *painter,
493
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
494
const QRectF &canvasRect, int from, int to ) const
496
const bool doFill = d_data->brush.style() != Qt::NoBrush;
497
const bool doAlign = QwtPainter::roundingAlignment( painter );
501
polyline.resize( to - from + 1 );
503
QPointF *points = polyline.data();
505
for ( int i = from; i <= to; i++ )
507
const QPointF sample = d_series->sample( i );
508
double xi = xMap.transform( sample.x() );
509
double yi = yMap.transform( sample.y() );
516
QwtPainter::drawPoint( painter, QPointF( xi, yi ) );
520
points[i - from].rx() = xi;
521
points[i - from].ry() = yi;
526
fillCurve( painter, xMap, yMap, canvasRect, polyline );
532
The direction of the steps depends on Inverted attribute.
534
\param painter Painter
537
\param canvasRect Contents rect of the canvas
538
\param from index of the first point to be painted
539
\param to index of the last point to be painted
541
\sa CurveAttribute, setCurveAttribute(),
542
draw(), drawCurve(), drawDots(), drawLines(), drawSticks()
544
void QwtPlotCurve::drawSteps( QPainter *painter,
545
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
546
const QRectF &canvasRect, int from, int to ) const
548
const bool doAlign = QwtPainter::roundingAlignment( painter );
550
QPolygonF polygon( 2 * ( to - from ) + 1 );
551
QPointF *points = polygon.data();
553
bool inverted = orientation() == Qt::Vertical;
554
if ( d_data->attributes & Inverted )
555
inverted = !inverted;
558
for ( i = from, ip = 0; i <= to; i++, ip += 2 )
560
const QPointF sample = d_series->sample( i );
561
double xi = xMap.transform( sample.x() );
562
double yi = yMap.transform( sample.y() );
571
const QPointF &p0 = points[ip - 2];
572
QPointF &p = points[ip - 1];
586
points[ip].rx() = xi;
587
points[ip].ry() = yi;
590
if ( d_data->paintAttributes & ClipPolygons )
592
const QPolygonF clipped = QwtClipper::clipPolygonF(
593
canvasRect, polygon, false );
595
QwtPainter::drawPolyline( painter, clipped );
599
QwtPainter::drawPolyline( painter, polygon );
602
if ( d_data->brush.style() != Qt::NoBrush )
603
fillCurve( painter, xMap, yMap, canvasRect, polygon );
608
Specify an attribute for drawing the curve
610
\param attribute Curve attribute
613
/sa testCurveAttribute(), setCurveFitter()
615
void QwtPlotCurve::setCurveAttribute( CurveAttribute attribute, bool on )
617
if ( bool( d_data->attributes & attribute ) == on )
621
d_data->attributes |= attribute;
623
d_data->attributes &= ~attribute;
629
\return true, if attribute is enabled
630
\sa setCurveAttribute()
632
bool QwtPlotCurve::testCurveAttribute( CurveAttribute attribute ) const
634
return d_data->attributes & attribute;
638
Assign a curve fitter
640
The curve fitter "smooths" the curve points, when the Fitted
641
CurveAttribute is set. setCurveFitter(NULL) also disables curve fitting.
643
The curve fitter operates on the translated points ( = widget coordinates)
644
to be functional for logarithmic scales. Obviously this is less performant
645
for fitting algorithms, that reduce the number of points.
647
For situations, where curve fitting is used to improve the performance
648
of painting huge series of points it might be better to execute the fitter
649
on the curve points once and to cache the result in the QwtSeriesData object.
651
\param curveFitter() Curve fitter
654
void QwtPlotCurve::setCurveFitter( QwtCurveFitter *curveFitter )
656
delete d_data->curveFitter;
657
d_data->curveFitter = curveFitter;
663
Get the curve fitter. If curve fitting is disabled NULL is returned.
666
\sa setCurveFitter(), Fitted
668
QwtCurveFitter *QwtPlotCurve::curveFitter() const
670
return d_data->curveFitter;
674
Fill the area between the curve and the baseline with
677
\param painter Painter
680
\param canvasRect Contents rect of the canvas
681
\param polygon Polygon - will be modified !
683
\sa setBrush(), setBaseline(), setStyle()
685
void QwtPlotCurve::fillCurve( QPainter *painter,
686
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
687
const QRectF &canvasRect, QPolygonF &polygon ) const
689
if ( d_data->brush.style() == Qt::NoBrush )
692
closePolyline( painter, xMap, yMap, polygon );
693
if ( polygon.count() <= 2 ) // a line can't be filled
696
QBrush brush = d_data->brush;
697
if ( !brush.color().isValid() )
698
brush.setColor( d_data->pen.color() );
700
if ( d_data->paintAttributes & ClipPolygons )
701
polygon = QwtClipper::clipPolygonF( canvasRect, polygon, true );
705
painter->setPen( Qt::NoPen );
706
painter->setBrush( brush );
708
QwtPainter::drawPolygon( painter, polygon );
714
\brief Complete a polygon to be a closed polygon including the
715
area between the original polygon and the baseline.
717
\param painter Painter
720
\param polygon Polygon to be completed
722
void QwtPlotCurve::closePolyline( QPainter *painter,
723
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
724
QPolygonF &polygon ) const
726
if ( polygon.size() < 2 )
729
const bool doAlign = QwtPainter::roundingAlignment( painter );
731
double baseline = d_data->baseline;
733
if ( orientation() == Qt::Vertical )
735
if ( yMap.transformation()->type() == QwtScaleTransformation::Log10 )
737
if ( baseline < QwtScaleMap::LogMin )
738
baseline = QwtScaleMap::LogMin;
741
double refY = yMap.transform( baseline );
743
refY = qRound( refY );
745
polygon += QPointF( polygon.last().x(), refY );
746
polygon += QPointF( polygon.first().x(), refY );
750
if ( xMap.transformation()->type() == QwtScaleTransformation::Log10 )
752
if ( baseline < QwtScaleMap::LogMin )
753
baseline = QwtScaleMap::LogMin;
756
double refX = xMap.transform( baseline );
758
refX = qRound( refX );
760
polygon += QPointF( refX, polygon.last().y() );
761
polygon += QPointF( refX, polygon.first().y() );
768
\param painter Painter
769
\param symbol Curve symbol
772
\param canvasRect Contents rect of the canvas
773
\param from Index of the first point to be painted
774
\param to Index of the last point to be painted
776
\sa setSymbol(), drawSeries(), drawCurve()
778
void QwtPlotCurve::drawSymbols( QPainter *painter, const QwtSymbol &symbol,
779
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
780
const QRectF &canvasRect, int from, int to ) const
782
const bool doAlign = QwtPainter::roundingAlignment( painter );
784
bool usePixmap = testPaintAttribute( CacheSymbols );
785
if ( usePixmap && !doAlign )
787
// Don't use the pixmap, when the paint device
788
// could generate scalable vectors
795
QPixmap pm( symbol.boundingSize() );
796
pm.fill( Qt::transparent );
798
const double pw2 = 0.5 * pm.width();
799
const double ph2 = 0.5 * pm.height();
802
p.setRenderHints( painter->renderHints() );
803
symbol.drawSymbol( &p, QPointF( pw2, ph2 ) );
806
for ( int i = from; i <= to; i++ )
808
const QPointF sample = d_series->sample( i );
810
double xi = xMap.transform( sample.x() );
811
double yi = yMap.transform( sample.y() );
818
if ( canvasRect.contains( xi, yi ) )
820
const int left = qCeil( xi ) - pw2;
821
const int top = qCeil( yi ) - ph2;
823
painter->drawPixmap( left, top, pm );
829
const int chunkSize = 500;
831
for ( int i = from; i <= to; i += chunkSize )
833
const int n = qMin( chunkSize, to - i + 1 );
836
for ( int j = 0; j < n; j++ )
838
const QPointF sample = d_series->sample( i + j );
840
const double xi = xMap.transform( sample.x() );
841
const double yi = yMap.transform( sample.y() );
843
if ( canvasRect.contains( xi, yi ) )
844
points += QPointF( xi, yi );
847
if ( points.size() > 0 )
848
symbol.drawSymbols( painter, points );
854
\brief Set the value of the baseline
856
The baseline is needed for filling the curve with a brush or
857
the Sticks drawing style.
858
The interpretation of the baseline depends on the CurveType.
859
With QwtPlotCurve::Yfx, the baseline is interpreted as a horizontal line
860
at y = baseline(), with QwtPlotCurve::Yfy, it is interpreted as a vertical
861
line at x = baseline().
863
The default value is 0.0.
865
\param value Value of the baseline
866
\sa baseline(), setBrush(), setStyle(), setStyle()
868
void QwtPlotCurve::setBaseline( double value )
870
if ( d_data->baseline != value )
872
d_data->baseline = value;
878
\return Value of the baseline
881
double QwtPlotCurve::baseline() const
883
return d_data->baseline;
887
Find the closest curve point for a specific position
889
\param pos Position, where to look for the closest curve point
890
\param dist If dist != NULL, closestPoint() returns the distance between
891
the position and the clostest curve point
892
\return Index of the closest curve point, or -1 if none can be found
893
( f.e when the curve has no points )
894
\note closestPoint() implements a dumb algorithm, that iterates
897
int QwtPlotCurve::closestPoint( const QPoint &pos, double *dist ) const
899
if ( plot() == NULL || dataSize() <= 0 )
902
const QwtScaleMap xMap = plot()->canvasMap( xAxis() );
903
const QwtScaleMap yMap = plot()->canvasMap( yAxis() );
906
double dmin = 1.0e10;
908
for ( uint i = 0; i < dataSize(); i++ )
910
const QPointF sample = d_series->sample( i );
912
const double cx = xMap.transform( sample.x() ) - pos.x();
913
const double cy = yMap.transform( sample.y() ) - pos.y();
915
const double f = qwtSqr( cx ) + qwtSqr( cy );
923
*dist = qSqrt( dmin );
929
\brief Update the widget that represents the item on the legend
932
\sa drawLegendIdentifier(), legendItem(), QwtPlotItem::Legend
934
void QwtPlotCurve::updateLegend( QwtLegend *legend ) const
936
if ( legend && testItemAttribute( QwtPlotItem::Legend )
937
&& ( d_data->legendAttributes & QwtPlotCurve::LegendShowSymbol )
939
&& d_data->symbol->style() != QwtSymbol::NoSymbol )
941
QWidget *lgdItem = legend->find( this );
942
if ( lgdItem == NULL )
944
lgdItem = legendItem();
946
legend->insert( this, lgdItem );
948
if ( lgdItem && lgdItem->inherits( "QwtLegendItem" ) )
950
QwtLegendItem *l = ( QwtLegendItem * )lgdItem;
951
l->setIdentifierSize( d_data->symbol->boundingSize() );
955
QwtPlotItem::updateLegend( legend );
959
\brief Draw the identifier representing the curve on the legend
961
\param painter Painter
962
\param rect Bounding rectangle for the identifier
964
\sa setLegendAttribute(), QwtPlotItem::Legend
966
void QwtPlotCurve::drawLegendIdentifier(
967
QPainter *painter, const QRectF &rect ) const
969
if ( rect.isEmpty() )
972
const int dim = qMin( rect.width(), rect.height() );
974
QSize size( dim, dim );
976
QRectF r( 0, 0, size.width(), size.height() );
977
r.moveCenter( rect.center() );
979
if ( d_data->legendAttributes == 0 )
981
QBrush brush = d_data->brush;
982
if ( brush.style() == Qt::NoBrush )
984
if ( style() != QwtPlotCurve::NoCurve )
985
brush = QBrush( pen().color() );
986
else if ( d_data->symbol &&
987
( d_data->symbol->style() != QwtSymbol::NoSymbol ) )
989
brush = QBrush( d_data->symbol->pen().color() );
992
if ( brush.style() != Qt::NoBrush )
993
painter->fillRect( r, brush );
995
if ( d_data->legendAttributes & QwtPlotCurve::LegendShowBrush )
997
if ( d_data->brush.style() != Qt::NoBrush )
998
painter->fillRect( r, d_data->brush );
1000
if ( d_data->legendAttributes & QwtPlotCurve::LegendShowLine )
1002
if ( pen() != Qt::NoPen )
1004
painter->setPen( pen() );
1005
QwtPainter::drawLine( painter, rect.left(), rect.center().y(),
1006
rect.right() - 1.0, rect.center().y() );
1009
if ( d_data->legendAttributes & QwtPlotCurve::LegendShowSymbol )
1011
if ( d_data->symbol &&
1012
( d_data->symbol->style() != QwtSymbol::NoSymbol ) )
1014
QSize symbolSize = d_data->symbol->boundingSize();
1015
symbolSize -= QSize( 2, 2 );
1017
// scale the symbol size down if it doesn't fit into rect.
1019
double xRatio = 1.0;
1020
if ( rect.width() < symbolSize.width() )
1021
xRatio = rect.width() / symbolSize.width();
1022
double yRatio = 1.0;
1023
if ( rect.height() < symbolSize.height() )
1024
yRatio = rect.height() / symbolSize.height();
1026
const double ratio = qMin( xRatio, yRatio );
1029
painter->scale( ratio, ratio );
1031
d_data->symbol->drawSymbol( painter, rect.center() / ratio );
1039
Initialize data with an array of points (explicitly shared).
1041
\param samples Vector of points
1043
void QwtPlotCurve::setSamples( const QVector<QPointF> &samples )
1046
d_series = new QwtPointSeriesData( samples );
1050
#ifndef QWT_NO_COMPAT
1053
\brief Initialize the data by pointing to memory blocks which
1054
are not managed by QwtPlotCurve.
1056
setRawSamples is provided for efficiency.
1057
It is important to keep the pointers
1058
during the lifetime of the underlying QwtCPointerData class.
1060
\param xData pointer to x data
1061
\param yData pointer to y data
1062
\param size size of x and y
1066
void QwtPlotCurve::setRawSamples(
1067
const double *xData, const double *yData, int size )
1070
d_series = new QwtCPointerData( xData, yData, size );
1075
Set data by copying x- and y-values from specified memory blocks.
1076
Contrary to setRawSamples(), this function makes a 'deep copy' of
1079
\param xData pointer to x values
1080
\param yData pointer to y values
1081
\param size size of xData and yData
1083
\sa QwtPointArrayData
1085
void QwtPlotCurve::setSamples(
1086
const double *xData, const double *yData, int size )
1089
d_series = new QwtPointArrayData( xData, yData, size );
1094
\brief Initialize data with x- and y-arrays (explicitly shared)
1099
\sa QwtPointArrayData
1101
void QwtPlotCurve::setSamples( const QVector<double> &xData,
1102
const QVector<double> &yData )
1105
d_series = new QwtPointArrayData( xData, yData );
1108
#endif // !QWT_NO_COMPAT