Qwt User's Guide: qwt_plot_curve.cpp Source File

Qwt User's Guide 6.3.0

Loading...
Searching...
No Matches
qwt_plot_curve.cpp
1/******************************************************************************
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 "qwt_plot_curve.h"
11#include "qwt_point_data.h"
12#include "qwt_math.h"
13#include "qwt_clipper.h"
14#include "qwt_painter.h"
15#include "qwt_scale_map.h"
16#include "qwt_plot.h"
17#include "qwt_spline_curve_fitter.h"
18#include "qwt_symbol.h"
19#include "qwt_point_mapper.h"
20#include "qwt_text.h"
21#include "qwt_graphic.h"
22
23#include <qpainter.h>
24#include <qpainterpath.h>
25#include <qnumeric.h>
26
27#include <climits>
28
29static inline QRectF qwtIntersectedClipRect( const QRectF& rect, QPainter* painter )
30{
31 QRectF clipRect = rect;
32 if ( painter->hasClipping() )
33 clipRect &= painter->clipBoundingRect();
34
35 return clipRect;
36}
37
38static void qwtUpdateLegendIconSize( QwtPlotCurve* curve )
39{
40 if ( curve->symbol() &&
41 curve->testLegendAttribute( QwtPlotCurve::LegendShowSymbol ) )
42 {
43 QSize sz = curve->symbol()->boundingRect().size();
44 sz += QSize( 2, 2 ); // margin
45
46 if ( curve->testLegendAttribute( QwtPlotCurve::LegendShowLine ) )
47 {
48 // Avoid, that the line is completely covered by the symbol
49
50 int w = qwtCeil( 1.5 * sz.width() );
51 if ( w % 2 )
52 w++;
53
54 sz.setWidth( qMax( 8, w ) );
55 }
56
57 curve->setLegendIconSize( sz );
58 }
59}
60
61static int qwtVerifyRange( int size, int& i1, int& i2 )
62{
63 if ( size < 1 )
64 return 0;
65
66 i1 = qBound( 0, i1, size - 1 );
67 i2 = qBound( 0, i2, size - 1 );
68
69 if ( i1 > i2 )
70 qSwap( i1, i2 );
71
72 return ( i2 - i1 + 1 );
73}
74
75class QwtPlotCurve::PrivateData
76{
77 public:
78 PrivateData()
79 : style( QwtPlotCurve::Lines )
80 , baseline( 0.0 )
81 , symbol( NULL )
82 , pen( Qt::black )
83 , paintAttributes( QwtPlotCurve::ClipPolygons | QwtPlotCurve::FilterPoints )
84 {
85 curveFitter = new QwtSplineCurveFitter;
86 }
87
88 ~PrivateData()
89 {
90 delete symbol;
91 delete curveFitter;
92 }
93
94 QwtPlotCurve::CurveStyle style;
95 double baseline;
96
97 const QwtSymbol* symbol;
98 QwtCurveFitter* curveFitter;
99
100 QPen pen;
101 QBrush brush;
102
103 QwtPlotCurve::CurveAttributes attributes;
104 QwtPlotCurve::PaintAttributes paintAttributes;
105
106 QwtPlotCurve::LegendAttributes legendAttributes;
107};
108
113 QwtPlotCurve::QwtPlotCurve( const QwtText& title )
114 : QwtPlotSeriesItem( title )
115{
116 init();
117}
118
123QwtPlotCurve::QwtPlotCurve( const QString& title )
124 : QwtPlotSeriesItem( QwtText( title ) )
125{
126 init();
127}
128
130QwtPlotCurve::~QwtPlotCurve()
131{
132 delete m_data;
133}
134
136 void QwtPlotCurve::init()
137{
138 setItemAttribute( QwtPlotItem::Legend );
139 setItemAttribute( QwtPlotItem::AutoScale );
140
141 m_data = new PrivateData;
142 setData( new QwtPointSeriesData() );
143
144 setZ( 20.0 );
145}
146
148 int QwtPlotCurve::rtti() const
149{
150 return QwtPlotItem::Rtti_PlotCurve;
151}
152
160 void QwtPlotCurve::setPaintAttribute( PaintAttribute attribute, bool on )
161{
162 if ( on )
163 m_data->paintAttributes |= attribute;
164 else
165 m_data->paintAttributes &= ~attribute;
166}
167
172 bool QwtPlotCurve::testPaintAttribute( PaintAttribute attribute ) const
173{
174 return ( m_data->paintAttributes & attribute );
175}
176
184 void QwtPlotCurve::setLegendAttribute( LegendAttribute attribute, bool on )
185{
186 if ( on != testLegendAttribute( attribute ) )
187 {
188 if ( on )
189 m_data->legendAttributes |= attribute;
190 else
191 m_data->legendAttributes &= ~attribute;
192
193 qwtUpdateLegendIconSize( this );
194 legendChanged();
195 }
196}
197
202 bool QwtPlotCurve::testLegendAttribute( LegendAttribute attribute ) const
203{
204 return ( m_data->legendAttributes & attribute );
205}
206
213 void QwtPlotCurve::setLegendAttributes( LegendAttributes attributes )
214{
215 if ( attributes != m_data->legendAttributes )
216 {
217 m_data->legendAttributes = attributes;
218
219 qwtUpdateLegendIconSize( this );
220 legendChanged();
221 }
222}
223
228 QwtPlotCurve::LegendAttributes QwtPlotCurve::legendAttributes() const
229{
230 return m_data->legendAttributes;
231}
232
239 void QwtPlotCurve::setStyle( CurveStyle style )
240{
241 if ( style != m_data->style )
242 {
243 m_data->style = style;
244
245 legendChanged();
246 itemChanged();
247 }
248}
249
254 QwtPlotCurve::CurveStyle QwtPlotCurve::style() const
255{
256 return m_data->style;
257}
258
269 void QwtPlotCurve::setSymbol( QwtSymbol* symbol )
270{
271 if ( symbol != m_data->symbol )
272 {
273 delete m_data->symbol;
274 m_data->symbol = symbol;
275
276 qwtUpdateLegendIconSize( this );
277
278 legendChanged();
279 itemChanged();
280 }
281}
282
287 const QwtSymbol* QwtPlotCurve::symbol() const
288{
289 return m_data->symbol;
290}
291
305 void QwtPlotCurve::setPen( const QColor& color, qreal width, Qt::PenStyle style )
306{
307 setPen( QPen( color, width, style ) );
308}
309
316 void QwtPlotCurve::setPen( const QPen& pen )
317{
318 if ( pen != m_data->pen )
319 {
320 m_data->pen = pen;
321
322 legendChanged();
323 itemChanged();
324 }
325}
326
331 const QPen& QwtPlotCurve::pen() const
332{
333 return m_data->pen;
334}
335
351 void QwtPlotCurve::setBrush( const QBrush& brush )
352{
353 if ( brush != m_data->brush )
354 {
355 m_data->brush = brush;
356
357 legendChanged();
358 itemChanged();
359 }
360}
361
366 const QBrush& QwtPlotCurve::brush() const
367{
368 return m_data->brush;
369}
370
384 void QwtPlotCurve::drawSeries( QPainter* painter,
385 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
386 const QRectF& canvasRect, int from, int to ) const
387{
388 const size_t numSamples = dataSize();
389
390 if ( !painter || numSamples <= 0 )
391 return;
392
393 if ( to < 0 )
394 to = numSamples - 1;
395
396 if ( qwtVerifyRange( numSamples, from, to ) > 0 )
397 {
398 painter->save();
399 painter->setPen( m_data->pen );
400
401 /*
402 Qt 4.0.0 is slow when drawing lines, but it's even
403 slower when the painter has a brush. So we don't
404 set the brush before we really need it.
405 */
406
407 drawCurve( painter, m_data->style, xMap, yMap, canvasRect, from, to );
408 painter->restore();
409
410 if ( m_data->symbol &&
411 ( m_data->symbol->style() != QwtSymbol::NoSymbol ) )
412 {
413 painter->save();
414 drawSymbols( painter, *m_data->symbol,
415 xMap, yMap, canvasRect, from, to );
416 painter->restore();
417 }
418 }
419}
420
432 void QwtPlotCurve::drawCurve( QPainter* painter, int style,
433 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
434 const QRectF& canvasRect, int from, int to ) const
435{
436 switch ( style )
437 {
438 case Lines:
439 if ( testCurveAttribute( Fitted ) )
440 {
441 // we always need the complete
442 // curve for fitting
443 from = 0;
444 to = dataSize() - 1;
445 }
446 drawLines( painter, xMap, yMap, canvasRect, from, to );
447 break;
448 case Sticks:
449 drawSticks( painter, xMap, yMap, canvasRect, from, to );
450 break;
451 case Steps:
452 drawSteps( painter, xMap, yMap, canvasRect, from, to );
453 break;
454 case Dots:
455 drawDots( painter, xMap, yMap, canvasRect, from, to );
456 break;
457 case NoCurve:
458 default:
459 break;
460 }
461}
462
479 void QwtPlotCurve::drawLines( QPainter* painter,
480 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
481 const QRectF& canvasRect, int from, int to ) const
482{
483 if ( from > to )
484 return;
485
486 const bool doFit = ( m_data->attributes & Fitted ) && m_data->curveFitter;
487 const bool doAlign = !doFit && QwtPainter::roundingAlignment( painter );
488 const bool doFill = ( m_data->brush.style() != Qt::NoBrush )
489 && ( m_data->brush.color().alpha() > 0 );
490
491 QRectF clipRect;
492 if ( m_data->paintAttributes & ClipPolygons )
493 {
494 clipRect = qwtIntersectedClipRect( canvasRect, painter );
495
496 const qreal pw = QwtPainter::effectivePenWidth( painter->pen() );
497 clipRect = clipRect.adjusted(-pw, -pw, pw, pw);
498 }
499
500 QwtPointMapper mapper;
501
502 if ( doAlign )
503 {
504 mapper.setFlag( QwtPointMapper::RoundPoints, true );
505 mapper.setFlag( QwtPointMapper::WeedOutIntermediatePoints,
506 testPaintAttribute( FilterPointsAggressive ) );
507 }
508
509 mapper.setFlag( QwtPointMapper::WeedOutPoints,
510 testPaintAttribute( FilterPoints ) ||
511 testPaintAttribute( FilterPointsAggressive ) );
512
513 mapper.setBoundingRect( canvasRect );
514
515 QPolygonF polyline = mapper.toPolygonF( xMap, yMap, data(), from, to );
516
517 if ( doFill )
518 {
519 if ( doFit )
520 {
521 // it might be better to extend and draw the curvePath, but for
522 // the moment we keep an implementation, where we translate the
523 // path back to a polyline.
524
525 polyline = m_data->curveFitter->fitCurve( polyline );
526 }
527
528 if ( painter->pen().style() != Qt::NoPen )
529 {
530 // here we are wasting memory for the filled copy,
531 // do polygon clipping twice etc .. TODO
532
533 QPolygonF filled = polyline;
534 fillCurve( painter, xMap, yMap, canvasRect, filled );
535 filled.clear();
536
537 if ( m_data->paintAttributes & ClipPolygons )
538 QwtClipper::clipPolygonF( clipRect, polyline, false );
539
540 QwtPainter::drawPolyline( painter, polyline );
541 }
542 else
543 {
544 fillCurve( painter, xMap, yMap, canvasRect, polyline );
545 }
546 }
547 else
548 {
549 if ( testPaintAttribute( ClipPolygons ) )
550 {
551 QwtClipper::clipPolygonF( clipRect, polyline, false );
552 }
553
554 if ( doFit )
555 {
556 if ( m_data->curveFitter->mode() == QwtCurveFitter::Path )
557 {
558 const QPainterPath curvePath =
559 m_data->curveFitter->fitCurvePath( polyline );
560
561 painter->drawPath( curvePath );
562 }
563 else
564 {
565 polyline = m_data->curveFitter->fitCurve( polyline );
566 QwtPainter::drawPolyline( painter, polyline );
567 }
568 }
569 else
570 {
571 QwtPainter::drawPolyline( painter, polyline );
572 }
573 }
574}
575
588 void QwtPlotCurve::drawSticks( QPainter* painter,
589 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
590 const QRectF& canvasRect, int from, int to ) const
591{
592 Q_UNUSED( canvasRect )
593
594 painter->save();
595 painter->setRenderHint( QPainter::Antialiasing, false );
596
597 const bool doAlign = QwtPainter::roundingAlignment( painter );
598
599 double x0 = xMap.transform( m_data->baseline );
600 double y0 = yMap.transform( m_data->baseline );
601 if ( doAlign )
602 {
603 x0 = qRound( x0 );
604 y0 = qRound( y0 );
605 }
606
607 const Qt::Orientation o = orientation();
608
609 const QwtSeriesData< QPointF >* series = data();
610
611 for ( int i = from; i <= to; i++ )
612 {
613 const QPointF sample = series->sample( i );
614 double xi = xMap.transform( sample.x() );
615 double yi = yMap.transform( sample.y() );
616 if ( doAlign )
617 {
618 xi = qRound( xi );
619 yi = qRound( yi );
620 }
621
622 if ( o == Qt::Horizontal )
623 QwtPainter::drawLine( painter, x0, yi, xi, yi );
624 else
625 QwtPainter::drawLine( painter, xi, y0, xi, yi );
626 }
627
628 painter->restore();
629}
630
643 void QwtPlotCurve::drawDots( QPainter* painter,
644 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
645 const QRectF& canvasRect, int from, int to ) const
646{
647 const QColor color = painter->pen().color();
648
649 if ( painter->pen().style() == Qt::NoPen || color.alpha() == 0 )
650 {
651 return;
652 }
653
654 const bool doFill = ( m_data->brush.style() != Qt::NoBrush )
655 && ( m_data->brush.color().alpha() > 0 );
656 const bool doAlign = QwtPainter::roundingAlignment( painter );
657
658 QwtPointMapper mapper;
659 mapper.setBoundingRect( canvasRect );
660 mapper.setFlag( QwtPointMapper::RoundPoints, doAlign );
661
662 if ( m_data->paintAttributes & FilterPoints )
663 {
664 if ( ( color.alpha() == 255 )
665 && !( painter->renderHints() & QPainter::Antialiasing ) )
666 {
667 mapper.setFlag( QwtPointMapper::WeedOutPoints, true );
668 }
669 }
670
671 if ( doFill )
672 {
673 mapper.setFlag( QwtPointMapper::WeedOutPoints, false );
674
675 QPolygonF points = mapper.toPolygonF(
676 xMap, yMap, data(), from, to );
677
678 QwtPainter::drawPoints( painter, points );
679 fillCurve( painter, xMap, yMap, canvasRect, points );
680 }
681 else if ( m_data->paintAttributes & ImageBuffer )
682 {
683 const QImage image = mapper.toImage( xMap, yMap,
684 data(), from, to, m_data->pen,
685 painter->testRenderHint( QPainter::Antialiasing ),
686 renderThreadCount() );
687
688 painter->drawImage( canvasRect.toAlignedRect(), image );
689 }
690 else if ( m_data->paintAttributes & MinimizeMemory )
691 {
692 const QwtSeriesData< QPointF >* series = data();
693
694 for ( int i = from; i <= to; i++ )
695 {
696 const QPointF sample = series->sample( i );
697
698 double xi = xMap.transform( sample.x() );
699 double yi = yMap.transform( sample.y() );
700
701 if ( doAlign )
702 {
703 xi = qRound( xi );
704 yi = qRound( yi );
705 }
706
707 QwtPainter::drawPoint( painter, QPointF( xi, yi ) );
708 }
709 }
710 else
711 {
712 if ( doAlign )
713 {
714 const QPolygon points = mapper.toPoints(
715 xMap, yMap, data(), from, to );
716
717 QwtPainter::drawPoints( painter, points );
718 }
719 else
720 {
721 const QPolygonF points = mapper.toPointsF(
722 xMap, yMap, data(), from, to );
723
724 QwtPainter::drawPoints( painter, points );
725 }
726 }
727}
728
744 void QwtPlotCurve::drawSteps( QPainter* painter,
745 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
746 const QRectF& canvasRect, int from, int to ) const
747{
748 const bool doAlign = QwtPainter::roundingAlignment( painter );
749
750 QPolygonF polygon( 2 * ( to - from ) + 1 );
751 QPointF* points = polygon.data();
752
753 bool inverted = orientation() == Qt::Vertical;
754 if ( m_data->attributes & Inverted )
755 inverted = !inverted;
756
757 const QwtSeriesData< QPointF >* series = data();
758
759 int i, ip;
760 for ( i = from, ip = 0; i <= to; i++, ip += 2 )
761 {
762 const QPointF sample = series->sample( i );
763 double xi = xMap.transform( sample.x() );
764 double yi = yMap.transform( sample.y() );
765 if ( doAlign )
766 {
767 xi = qRound( xi );
768 yi = qRound( yi );
769 }
770
771 if ( ip > 0 )
772 {
773 const QPointF& p0 = points[ip - 2];
774 QPointF& p = points[ip - 1];
775
776 if ( inverted )
777 {
778 p.rx() = p0.x();
779 p.ry() = yi;
780 }
781 else
782 {
783 p.rx() = xi;
784 p.ry() = p0.y();
785 }
786 }
787
788 points[ip].rx() = xi;
789 points[ip].ry() = yi;
790 }
791
792 if ( m_data->paintAttributes & ClipPolygons )
793 {
794 QRectF clipRect = qwtIntersectedClipRect( canvasRect, painter );
795
796 const qreal pw = QwtPainter::effectivePenWidth( painter->pen() );
797 clipRect = clipRect.adjusted(-pw, -pw, pw, pw);
798
799 const QPolygonF clipped = QwtClipper::clippedPolygonF(
800 clipRect, polygon, false );
801
802 QwtPainter::drawPolyline( painter, clipped );
803 }
804 else
805 {
806 QwtPainter::drawPolyline( painter, polygon );
807 }
808
809 if ( m_data->brush.style() != Qt::NoBrush )
810 fillCurve( painter, xMap, yMap, canvasRect, polygon );
811}
812
813
822 void QwtPlotCurve::setCurveAttribute( CurveAttribute attribute, bool on )
823{
824 if ( bool( m_data->attributes & attribute ) == on )
825 return;
826
827 if ( on )
828 m_data->attributes |= attribute;
829 else
830 m_data->attributes &= ~attribute;
831
832 itemChanged();
833}
834
839 bool QwtPlotCurve::testCurveAttribute( CurveAttribute attribute ) const
840{
841 return m_data->attributes & attribute;
842}
843
861 void QwtPlotCurve::setCurveFitter( QwtCurveFitter* curveFitter )
862{
863 delete m_data->curveFitter;
864 m_data->curveFitter = curveFitter;
865
866 itemChanged();
867}
868
875 QwtCurveFitter* QwtPlotCurve::curveFitter() const
876{
877 return m_data->curveFitter;
878}
879
892 void QwtPlotCurve::fillCurve( QPainter* painter,
893 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
894 const QRectF& canvasRect, QPolygonF& polygon ) const
895{
896 if ( m_data->brush.style() == Qt::NoBrush )
897 return;
898
899 closePolyline( painter, xMap, yMap, polygon );
900 if ( polygon.count() <= 2 ) // a line can't be filled
901 return;
902
903 QBrush brush = m_data->brush;
904 if ( !brush.color().isValid() )
905 brush.setColor( m_data->pen.color() );
906
907 if ( m_data->paintAttributes & ClipPolygons )
908 {
909 const QRectF clipRect = qwtIntersectedClipRect( canvasRect, painter );
910 QwtClipper::clipPolygonF( clipRect, polygon, true );
911 }
912
913 painter->save();
914
915 painter->setPen( Qt::NoPen );
916 painter->setBrush( brush );
917
918 QwtPainter::drawPolygon( painter, polygon );
919
920 painter->restore();
921}
922
932 void QwtPlotCurve::closePolyline( QPainter* painter,
933 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
934 QPolygonF& polygon ) const
935{
936 if ( polygon.size() < 2 )
937 return;
938
939 const bool doAlign = QwtPainter::roundingAlignment( painter );
940
941 double baseline = m_data->baseline;
942
943 if ( orientation() == Qt::Vertical )
944 {
945 if ( yMap.transformation() )
946 baseline = yMap.transformation()->bounded( baseline );
947
948 double refY = yMap.transform( baseline );
949 if ( doAlign && qAbs( refY ) < std::numeric_limits< int >::max() )
950 refY = qRound( refY );
951
952 polygon += QPointF( polygon.last().x(), refY );
953 polygon += QPointF( polygon.first().x(), refY );
954 }
955 else
956 {
957 if ( xMap.transformation() )
958 baseline = xMap.transformation()->bounded( baseline );
959
960 double refX = xMap.transform( baseline );
961 if ( doAlign && qAbs( refX ) < std::numeric_limits< int >::max() )
962 refX = qRound( refX );
963
964 polygon += QPointF( refX, polygon.last().y() );
965 polygon += QPointF( refX, polygon.first().y() );
966 }
967}
968
982 void QwtPlotCurve::drawSymbols( QPainter* painter, const QwtSymbol& symbol,
983 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
984 const QRectF& canvasRect, int from, int to ) const
985{
986 QwtPointMapper mapper;
987 mapper.setFlag( QwtPointMapper::RoundPoints,
988 QwtPainter::roundingAlignment( painter ) );
989 mapper.setFlag( QwtPointMapper::WeedOutPoints,
990 testPaintAttribute( QwtPlotCurve::FilterPoints ) );
991
992 const QRectF clipRect = qwtIntersectedClipRect( canvasRect, painter );
993 mapper.setBoundingRect( clipRect );
994
995 const int chunkSize = 500;
996
997 for ( int i = from; i <= to; i += chunkSize )
998 {
999 const int n = qMin( chunkSize, to - i + 1 );
1000
1001 const QPolygonF points = mapper.toPointsF( xMap, yMap,
1002 data(), i, i + n - 1 );
1003
1004 if ( points.size() > 0 )
1005 symbol.drawSymbols( painter, points );
1006 }
1007}
1008
1025 void QwtPlotCurve::setBaseline( double value )
1026{
1027 if ( m_data->baseline != value )
1028 {
1029 m_data->baseline = value;
1030 itemChanged();
1031 }
1032}
1033
1038 double QwtPlotCurve::baseline() const
1039{
1040 return m_data->baseline;
1041}
1042
1054 int QwtPlotCurve::closestPoint( const QPointF& pos, double* dist ) const
1055{
1056 const QwtPlot* plot = this->plot();
1057
1058 if ( ( plot == NULL ) || !plot->isAxisValid( xAxis() ) || !plot->isAxisValid( yAxis() ) )
1059 return -1;
1060
1061 const size_t numSamples = dataSize();
1062 if ( numSamples <= 0 )
1063 return -1;
1064
1065 const QwtSeriesData< QPointF >* series = data();
1066
1067 const QwtScaleMap xMap = plot->canvasMap( xAxis() );
1068 const QwtScaleMap yMap = plot->canvasMap( yAxis() );
1069
1070 int index = -1;
1071 double dmin = 1.0e10;
1072
1073 for ( uint i = 0; i < numSamples; i++ )
1074 {
1075 const QPointF sample = series->sample( i );
1076
1077 const double cx = xMap.transform( sample.x() ) - pos.x();
1078 const double cy = yMap.transform( sample.y() ) - pos.y();
1079
1080 const double f = qwtSqr( cx ) + qwtSqr( cy );
1081 if ( f < dmin )
1082 {
1083 index = i;
1084 dmin = f;
1085 }
1086 }
1087 if ( dist )
1088 *dist = std::sqrt( dmin );
1089
1090 return index;
1091}
1092
1108 int QwtPlotCurve::adjacentPoint( Qt::Orientation orientation, qreal value ) const
1109{
1110 const QwtSeriesData< QPointF >* data = this->data();
1111 if ( data == NULL )
1112 return -1;
1113
1114 if ( orientation == Qt::Horizontal )
1115 {
1116 struct compareX
1117 {
1118 inline bool operator()( const double x, const QPointF& pos ) const
1119 {
1120 return ( x < pos.x() );
1121 }
1122 };
1123
1124 return qwtUpperSampleIndex< QPointF >( *data, value, compareX() );
1125 }
1126 else
1127 {
1128 struct compareY
1129 {
1130 inline bool operator()( const double y, const QPointF& pos ) const
1131 {
1132 return ( y < pos.y() );
1133 }
1134 };
1135
1136 return qwtUpperSampleIndex< QPointF >( *data, value, compareY() );
1137 }
1138
1139 return -1;
1140}
1141
1158qreal QwtPlotCurve::interpolatedValueAt( Qt::Orientation orientation, double value ) const
1159{
1160 const QRectF br = boundingRect();
1161 if ( br.width() <= 0.0 )
1162 return qQNaN();
1163
1164 double v;
1165
1166 if ( orientation == Qt::Horizontal )
1167 {
1168 if ( value < br.left() || value > br.right() )
1169 return qQNaN();
1170
1171 const int index = adjacentPoint( orientation, value );
1172
1173 if ( index == -1 )
1174 {
1175 const QPointF last = sample( dataSize() - 1 );
1176
1177 if ( value != last.x() )
1178 return qQNaN();
1179
1180 v = last.y();
1181 }
1182 else
1183 {
1184 const QLineF line( sample( index - 1 ), sample( index ) );
1185 v = line.pointAt( ( value - line.p1().x() ) / line.dx() ).y();
1186 }
1187 }
1188 else
1189 {
1190 if ( value < br.top() || value > br.bottom() )
1191 return qQNaN();
1192
1193 const int index = adjacentPoint( orientation, value );
1194
1195 if ( index == -1 )
1196 {
1197 const QPointF last = sample( dataSize() - 1 );
1198
1199 if ( value != last.y() )
1200 return qQNaN();
1201
1202 v = last.x();
1203 }
1204 else
1205 {
1206 const QLineF line( sample( index - 1 ), sample( index ) );
1207 v = line.pointAt( ( value - line.p1().y() ) / line.dy() ).x();
1208 }
1209 }
1210
1211 return v;
1212}
1213
1223 QwtGraphic QwtPlotCurve::legendIcon( int index, const QSizeF& size ) const
1224{
1225 Q_UNUSED( index );
1226
1227 if ( size.isEmpty() )
1228 return QwtGraphic();
1229
1230 QwtGraphic graphic;
1231 graphic.setDefaultSize( size );
1232 graphic.setRenderHint( QwtGraphic::RenderPensUnscaled, true );
1233
1234 QPainter painter( &graphic );
1235 painter.setRenderHint( QPainter::Antialiasing,
1236 testRenderHint( QwtPlotItem::RenderAntialiased ) );
1237
1238 if ( m_data->legendAttributes == 0 ||
1239 m_data->legendAttributes & QwtPlotCurve::LegendShowBrush )
1240 {
1241 QBrush brush = m_data->brush;
1242
1243 if ( brush.style() == Qt::NoBrush &&
1244 m_data->legendAttributes == 0 )
1245 {
1246 if ( style() != QwtPlotCurve::NoCurve )
1247 {
1248 brush = QBrush( pen().color() );
1249 }
1250 else if ( m_data->symbol &&
1251 ( m_data->symbol->style() != QwtSymbol::NoSymbol ) )
1252 {
1253 brush = QBrush( m_data->symbol->pen().color() );
1254 }
1255 }
1256
1257 if ( brush.style() != Qt::NoBrush )
1258 {
1259 QRectF r( 0, 0, size.width(), size.height() );
1260 painter.fillRect( r, brush );
1261 }
1262 }
1263
1264 if ( m_data->legendAttributes & QwtPlotCurve::LegendShowLine )
1265 {
1266 if ( pen() != Qt::NoPen )
1267 {
1268 QPen pn = pen();
1269 pn.setCapStyle( Qt::FlatCap );
1270
1271 painter.setPen( pn );
1272
1273 const double y = 0.5 * size.height();
1274 QwtPainter::drawLine( &painter, 0.0, y, size.width(), y );
1275 }
1276 }
1277
1278 if ( m_data->legendAttributes & QwtPlotCurve::LegendShowSymbol )
1279 {
1280 if ( m_data->symbol )
1281 {
1282 QRectF r( 0, 0, size.width(), size.height() );
1283 m_data->symbol->drawSymbol( &painter, r );
1284 }
1285 }
1286
1287 return graphic;
1288}
1289
1300 void QwtPlotCurve::setSamples( QwtSeriesData< QPointF >* data )
1301{
1302 setData( data );
1303}
1304
1312 void QwtPlotCurve::setSamples( const QVector< QPointF >& samples )
1313{
1314 setData( new QwtPointSeriesData( samples ) );
1315}
1316
1331 void QwtPlotCurve::setRawSamples(
1332 const double* xData, const double* yData, int size )
1333{
1334 setData( new QwtCPointerData< double >( xData, yData, size ) );
1335}
1336
1351 void QwtPlotCurve::setRawSamples(
1352 const float* xData, const float* yData, int size )
1353{
1354 setData( new QwtCPointerData< float >( xData, yData, size ) );
1355}
1356
1373 void QwtPlotCurve::setRawSamples( const double* yData, int size )
1374{
1375 setData( new QwtCPointerValueData< double >( yData, size ) );
1376}
1377
1394 void QwtPlotCurve::setRawSamples( const float* yData, int size )
1395{
1396 setData( new QwtCPointerValueData< float >( yData, size ) );
1397}
1398
1410 void QwtPlotCurve::setSamples(
1411 const double* xData, const double* yData, int size )
1412{
1413 setData( new QwtPointArrayData< double >( xData, yData, size ) );
1414}
1415
1427 void QwtPlotCurve::setSamples(
1428 const float* xData, const float* yData, int size )
1429{
1430 setData( new QwtPointArrayData< float >( xData, yData, size ) );
1431}
1432
1441 void QwtPlotCurve::setSamples( const QVector< double >& xData,
1442 const QVector< double >& yData )
1443{
1444 setData( new QwtPointArrayData< double >( xData, yData ) );
1445}
1446
1455 void QwtPlotCurve::setSamples( const QVector< float >& xData,
1456 const QVector< float >& yData )
1457{
1458 setData( new QwtPointArrayData< float >( xData, yData ) );
1459}
1460
1472 void QwtPlotCurve::setSamples( const double* yData, int size )
1473{
1474 setData( new QwtValuePointData< double >( yData, size ) );
1475}
1476
1488 void QwtPlotCurve::setSamples( const float* yData, int size )
1489{
1490 setData( new QwtValuePointData< float >( yData, size ) );
1491}
1492
1503 void QwtPlotCurve::setSamples( const QVector< double >& yData )
1504{
1505 setData( new QwtValuePointData< double >( yData ) );
1506}
1507
1518 void QwtPlotCurve::setSamples( const QVector< float >& yData )
1519{
1520 setData( new QwtValuePointData< float >( yData ) );
1521}
QVector
Definition qwt_clipper.h:23
QwtArraySeriesData
Template class for data, that is organized as QVector.
Definition qwt_series_data.h:153
QwtCPointerData
Data class containing two pointers to memory blocks of T.
Definition qwt_point_data.h:44
QwtCPointerValueData
Data class containing a pointer to memory of y coordinates.
Definition qwt_point_data.h:90
QwtCurveFitter
Abstract base class for a curve fitter.
Definition qwt_curve_fitter.h:22
QwtCurveFitter::fitCurvePath
virtual QPainterPath fitCurvePath(const QPolygonF &polygon) const =0
QwtCurveFitter::Path
@ Path
Definition qwt_curve_fitter.h:48
QwtCurveFitter::mode
Mode mode() const
Definition qwt_curve_fitter.cpp:27
QwtCurveFitter::fitCurve
virtual QPolygonF fitCurve(const QPolygonF &polygon) const =0
QwtGraphic
A paint device for scalable graphics.
Definition qwt_graphic.h:76
QwtGraphic::RenderPensUnscaled
@ RenderPensUnscaled
Definition qwt_graphic.h:96
QwtGraphic::setRenderHint
void setRenderHint(RenderHint, bool on=true)
Definition qwt_graphic.cpp:443
QwtGraphic::setDefaultSize
void setDefaultSize(const QSizeF &)
Set a default size.
Definition qwt_graphic.cpp:553
QwtPainter::drawPoints
static void drawPoints(QPainter *, const QPolygon &)
Wrapper for QPainter::drawPoints()
Definition qwt_painter.h:142
QwtPainter::drawPolygon
static void drawPolygon(QPainter *, const QPolygonF &)
Wrapper for QPainter::drawPolygon()
Definition qwt_painter.cpp:551
QwtPainter::drawPolyline
static void drawPolyline(QPainter *, const QPolygonF &)
Wrapper for QPainter::drawPolyline()
Definition qwt_painter.cpp:568
QwtPainter::effectivePenWidth
static qreal effectivePenWidth(const QPen &)
Definition qwt_painter.h:201
QwtPainter::drawPoint
static void drawPoint(QPainter *, const QPoint &)
Wrapper for QPainter::drawPoint()
Definition qwt_painter.cpp:681
QwtPainter::roundingAlignment
static bool roundingAlignment()
Definition qwt_painter.h:183
QwtPainter::drawLine
static void drawLine(QPainter *, qreal x1, qreal y1, qreal x2, qreal y2)
Wrapper for QPainter::drawLine()
Definition qwt_painter.h:154
QwtPlotCurve
A plot item, that represents a series of points.
Definition qwt_plot_curve.h:59
QwtPlotCurve::interpolatedValueAt
qreal interpolatedValueAt(Qt::Orientation, double) const
Definition qwt_plot_curve.cpp:1158
QwtPlotCurve::setLegendAttribute
void setLegendAttribute(LegendAttribute, bool on=true)
Definition qwt_plot_curve.cpp:184
QwtPlotCurve::drawSeries
virtual void drawSeries(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const override
Definition qwt_plot_curve.cpp:384
QwtPlotCurve::setLegendAttributes
void setLegendAttributes(LegendAttributes)
Definition qwt_plot_curve.cpp:213
QwtPlotCurve::CurveStyle
CurveStyle
Definition qwt_plot_curve.h:66
QwtPlotCurve::NoCurve
@ NoCurve
Definition qwt_plot_curve.h:70
QwtPlotCurve::Steps
@ Steps
Definition qwt_plot_curve.h:90
QwtPlotCurve::Sticks
@ Sticks
Definition qwt_plot_curve.h:83
QwtPlotCurve::Lines
@ Lines
Definition qwt_plot_curve.h:77
QwtPlotCurve::Dots
@ Dots
Definition qwt_plot_curve.h:98
QwtPlotCurve::closePolyline
void closePolyline(QPainter *, const QwtScaleMap &, const QwtScaleMap &, QPolygonF &) const
Complete a polygon to be a closed polygon including the area between the original polygon and the bas...
Definition qwt_plot_curve.cpp:932
QwtPlotCurve::legendAttributes
LegendAttributes legendAttributes() const
Definition qwt_plot_curve.cpp:228
QwtPlotCurve::drawCurve
virtual void drawCurve(QPainter *, int style, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const
Draw the line part (without symbols) of a curve interval.
Definition qwt_plot_curve.cpp:432
QwtPlotCurve::LegendAttributes
QFlags< LegendAttribute > LegendAttributes
Definition qwt_plot_curve.h:168
QwtPlotCurve::fillCurve
virtual void fillCurve(QPainter *, const QwtScaleMap &, const QwtScaleMap &, const QRectF &canvasRect, QPolygonF &) const
Definition qwt_plot_curve.cpp:892
QwtPlotCurve::setStyle
void setStyle(CurveStyle style)
Definition qwt_plot_curve.cpp:239
QwtPlotCurve::CurveAttribute
CurveAttribute
Definition qwt_plot_curve.h:113
QwtPlotCurve::Fitted
@ Fitted
Definition qwt_plot_curve.h:130
QwtPlotCurve::Inverted
@ Inverted
Definition qwt_plot_curve.h:118
QwtPlotCurve::style
CurveStyle style() const
Definition qwt_plot_curve.cpp:254
QwtPlotCurve::setSymbol
void setSymbol(QwtSymbol *)
Assign a symbol.
Definition qwt_plot_curve.cpp:269
QwtPlotCurve::closestPoint
virtual int closestPoint(const QPointF &pos, double *dist=NULL) const
Definition qwt_plot_curve.cpp:1054
QwtPlotCurve::drawDots
virtual void drawDots(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const
Definition qwt_plot_curve.cpp:643
QwtPlotCurve::QwtPlotCurve
QwtPlotCurve(const QString &title=QString())
Definition qwt_plot_curve.cpp:123
QwtPlotCurve::drawSticks
virtual void drawSticks(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const
Definition qwt_plot_curve.cpp:588
QwtPlotCurve::drawSymbols
virtual void drawSymbols(QPainter *, const QwtSymbol &, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const
Definition qwt_plot_curve.cpp:982
QwtPlotCurve::adjacentPoint
virtual int adjacentPoint(Qt::Orientation orientation, qreal value) const
Definition qwt_plot_curve.cpp:1108
QwtPlotCurve::testLegendAttribute
bool testLegendAttribute(LegendAttribute) const
Definition qwt_plot_curve.cpp:202
QwtPlotCurve::testCurveAttribute
bool testCurveAttribute(CurveAttribute) const
Definition qwt_plot_curve.cpp:839
QwtPlotCurve::setCurveAttribute
void setCurveAttribute(CurveAttribute, bool on=true)
Definition qwt_plot_curve.cpp:822
QwtPlotCurve::LegendAttribute
LegendAttribute
Definition qwt_plot_curve.h:143
QwtPlotCurve::LegendShowBrush
@ LegendShowBrush
Definition qwt_plot_curve.h:165
QwtPlotCurve::LegendShowSymbol
@ LegendShowSymbol
Definition qwt_plot_curve.h:159
QwtPlotCurve::LegendShowLine
@ LegendShowLine
Definition qwt_plot_curve.h:154
QwtPlotCurve::init
void init()
Initialize internal members.
Definition qwt_plot_curve.cpp:136
QwtPlotCurve::setPaintAttribute
void setPaintAttribute(PaintAttribute, bool on=true)
Definition qwt_plot_curve.cpp:160
QwtPlotCurve::PaintAttribute
PaintAttribute
Definition qwt_plot_curve.h:177
QwtPlotCurve::MinimizeMemory
@ MinimizeMemory
Definition qwt_plot_curve.h:198
QwtPlotCurve::ClipPolygons
@ ClipPolygons
Definition qwt_plot_curve.h:183
QwtPlotCurve::FilterPointsAggressive
@ FilterPointsAggressive
Definition qwt_plot_curve.h:231
QwtPlotCurve::ImageBuffer
@ ImageBuffer
Definition qwt_plot_curve.h:207
QwtPlotCurve::FilterPoints
@ FilterPoints
Definition qwt_plot_curve.h:191
QwtPlotCurve::testPaintAttribute
bool testPaintAttribute(PaintAttribute) const
Definition qwt_plot_curve.cpp:172
QwtPlotCurve::legendIcon
virtual QwtGraphic legendIcon(int index, const QSizeF &) const override
Definition qwt_plot_curve.cpp:1223
QwtPlotCurve::drawLines
virtual void drawLines(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const
Draw lines.
Definition qwt_plot_curve.cpp:479
QwtPlotCurve::~QwtPlotCurve
virtual ~QwtPlotCurve()
Destructor.
Definition qwt_plot_curve.cpp:130
QwtPlotCurve::setSamples
void setSamples(const double *xData, const double *yData, int size)
Definition qwt_plot_curve.cpp:1410
QwtPlotCurve::pen
const QPen & pen() const
Definition qwt_plot_curve.cpp:331
QwtPlotCurve::setCurveFitter
void setCurveFitter(QwtCurveFitter *)
Definition qwt_plot_curve.cpp:861
QwtPlotCurve::brush
const QBrush & brush() const
Definition qwt_plot_curve.cpp:366
QwtPlotCurve::setBaseline
void setBaseline(double)
Set the value of the baseline.
Definition qwt_plot_curve.cpp:1025
QwtPlotCurve::setBrush
void setBrush(const QBrush &)
Assign a brush.
Definition qwt_plot_curve.cpp:351
QwtPlotCurve::symbol
const QwtSymbol * symbol() const
Definition qwt_plot_curve.cpp:287
QwtPlotCurve::PaintAttributes
QFlags< PaintAttribute > PaintAttributes
Definition qwt_plot_curve.h:234
QwtPlotCurve::setPen
void setPen(const QColor &, qreal width=0.0, Qt::PenStyle=Qt::SolidLine)
Definition qwt_plot_curve.cpp:305
QwtPlotCurve::curveFitter
QwtCurveFitter * curveFitter() const
Definition qwt_plot_curve.cpp:875
QwtPlotCurve::CurveAttributes
QFlags< CurveAttribute > CurveAttributes
Definition qwt_plot_curve.h:133
QwtPlotCurve::baseline
double baseline() const
Definition qwt_plot_curve.cpp:1038
QwtPlotCurve::drawSteps
virtual void drawSteps(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const
Definition qwt_plot_curve.cpp:744
QwtPlotCurve::rtti
virtual int rtti() const override
Definition qwt_plot_curve.cpp:148
QwtPlotCurve::setRawSamples
void setRawSamples(const double *xData, const double *yData, int size)
Initialize the data by pointing to memory blocks which are not managed by QwtPlotCurve.
Definition qwt_plot_curve.cpp:1331
QwtPlot
A 2-D plotting widget.
Definition qwt_plot.h:79
QwtPlot::isAxisValid
bool isAxisValid(QwtAxisId) const
Definition qwt_plot_axis.cpp:132
QwtPlot::canvasMap
virtual QwtScaleMap canvasMap(QwtAxisId) const
Definition qwt_plot.cpp:800
QwtPlotItem::yAxis
QwtAxisId yAxis() const
Return yAxis.
Definition qwt_plot_item.cpp:559
QwtPlotItem::setLegendIconSize
void setLegendIconSize(const QSize &)
Definition qwt_plot_item.cpp:373
QwtPlotItem::legendChanged
virtual void legendChanged()
Definition qwt_plot_item.cpp:491
QwtPlotItem::setZ
void setZ(double z)
Set the z value.
Definition qwt_plot_item.cpp:165
QwtPlotItem::setItemAttribute
void setItemAttribute(ItemAttribute, bool on=true)
Definition qwt_plot_item.cpp:228
QwtPlotItem::plot
QwtPlot * plot() const
Return attached plot.
Definition qwt_plot_item.cpp:142
QwtPlotItem::xAxis
QwtAxisId xAxis() const
Return xAxis.
Definition qwt_plot_item.cpp:553
QwtPlotItem::Rtti_PlotCurve
@ Rtti_PlotCurve
For QwtPlotCurve.
Definition qwt_plot_item.h:93
QwtPlotItem::RenderAntialiased
@ RenderAntialiased
Enable antialiasing.
Definition qwt_plot_item.h:206
QwtPlotItem::testRenderHint
bool testRenderHint(RenderHint) const
Definition qwt_plot_item.cpp:332
QwtPlotItem::itemChanged
virtual void itemChanged()
Definition qwt_plot_item.cpp:481
QwtPlotItem::Legend
@ Legend
The item is represented on the legend.
Definition qwt_plot_item.h:150
QwtPlotItem::AutoScale
@ AutoScale
Definition qwt_plot_item.h:157
QwtPlotItem::renderThreadCount
uint renderThreadCount() const
Definition qwt_plot_item.cpp:360
QwtPlotSeriesItem
Base class for plot items representing a series of samples.
Definition qwt_plot_seriesitem.h:26
QwtPlotSeriesItem::orientation
Qt::Orientation orientation() const
Definition qwt_plot_seriesitem.cpp:77
QwtPlotSeriesItem::boundingRect
virtual QRectF boundingRect() const override
Definition qwt_plot_seriesitem.cpp:97
QwtPointArrayData
Interface for iterating over two QVector<T> objects.
Definition qwt_point_data.h:23
QwtPointMapper
A helper class for translating a series of points.
Definition qwt_point_mapper.h:33
QwtPointMapper::setBoundingRect
void setBoundingRect(const QRectF &)
Definition qwt_point_mapper.cpp:612
QwtPointMapper::toPolygonF
QPolygonF toPolygonF(const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QwtSeriesData< QPointF > *series, int from, int to) const
Translate a series of points into a QPolygonF.
Definition qwt_point_mapper.cpp:647
QwtPointMapper::toImage
QImage toImage(const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QwtSeriesData< QPointF > *series, int from, int to, const QPen &, bool antialiased, uint numThreads) const
Translate a series into a QImage.
Definition qwt_point_mapper.cpp:883
QwtPointMapper::toPointsF
QPolygonF toPointsF(const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QwtSeriesData< QPointF > *series, int from, int to) const
Translate a series into a QPolygonF.
Definition qwt_point_mapper.cpp:759
QwtPointMapper::setFlag
void setFlag(TransformationFlag, bool on=true)
Definition qwt_point_mapper.cpp:586
QwtPointMapper::RoundPoints
@ RoundPoints
Round points to integer values.
Definition qwt_point_mapper.h:42
QwtPointMapper::WeedOutPoints
@ WeedOutPoints
Definition qwt_point_mapper.h:48
QwtPointMapper::WeedOutIntermediatePoints
@ WeedOutIntermediatePoints
Definition qwt_point_mapper.h:68
QwtPointMapper::toPoints
QPolygon toPoints(const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QwtSeriesData< QPointF > *series, int from, int to) const
Translate a series of points into a QPolygon.
Definition qwt_point_mapper.cpp:833
QwtScaleMap
A scale map.
Definition qwt_scale_map.h:27
QwtScaleMap::transform
double transform(double s) const
Definition qwt_scale_map.h:137
QwtScaleMap::transformation
const QwtTransform * transformation() const
Get the transformation.
Definition qwt_scale_map.cpp:88
QwtSeriesData< QPointF >
QwtSeriesData::sample
virtual T sample(size_t i) const =0
QwtSeriesStore< QPointF >::sample
QPointF sample(int index) const
Definition qwt_series_store.h:158
QwtSeriesStore< QPointF >::dataSize
virtual size_t dataSize() const override
Definition qwt_series_store.h:175
QwtSeriesStore< QPointF >::data
QwtSeriesData< QPointF > * data()
Definition qwt_series_store.h:146
QwtSeriesStore< QPointF >::setData
void setData(QwtSeriesData< QPointF > *series)
Definition qwt_series_store.h:164
QwtSplineCurveFitter
A curve fitter using a spline interpolation.
Definition qwt_spline_curve_fitter.h:26
QwtSymbol
A class for drawing symbols.
Definition qwt_symbol.h:32
QwtSymbol::style
Style style() const
Definition qwt_symbol.cpp:1795
QwtSymbol::drawSymbol
void drawSymbol(QPainter *, const QRectF &) const
Draw the symbol into a rectangle.
Definition qwt_symbol.cpp:1434
QwtSymbol::boundingRect
virtual QRect boundingRect() const
Definition qwt_symbol.cpp:1637
QwtSymbol::drawSymbols
void drawSymbols(QPainter *, const QPolygonF &) const
Draw symbols at the specified points.
Definition qwt_symbol.h:251
QwtSymbol::NoSymbol
@ NoSymbol
No Style. The symbol cannot be drawn.
Definition qwt_symbol.h:41
QwtSymbol::pen
const QPen & pen() const
Definition qwt_symbol.cpp:1171
QwtText
A class representing a text.
Definition qwt_text.h:52
QwtTransform::bounded
virtual double bounded(double value) const
Definition qwt_transform.cpp:33
QwtValuePointData
Interface for iterating over a QVector<T>.
Definition qwt_point_data.h:68
QwtClipper::clippedPolygonF
QWT_EXPORT QPolygonF clippedPolygonF(const QRectF &, const QPolygonF &, bool closePolygon=false)
Definition qwt_clipper.cpp:455
QwtClipper::clipPolygonF
QWT_EXPORT void clipPolygonF(const QRectF &, QPolygonF &, bool closePolygon=false)
Definition qwt_clipper.cpp:404