Qwt User's Guide: qwt_plot_intervalcurve.cpp Source File

Qwt User's Guide 6.3.0

Loading...
Searching...
No Matches
qwt_plot_intervalcurve.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_intervalcurve.h"
11#include "qwt_interval_symbol.h"
12#include "qwt_scale_map.h"
13#include "qwt_clipper.h"
14#include "qwt_painter.h"
15#include "qwt_graphic.h"
16#include "qwt_text.h"
17
18#include <qpainter.h>
19#include <qmath.h>
20#include <cstring>
21
22static inline bool qwtIsHSampleInside( const QwtIntervalSample& sample,
23 double xMin, double xMax, double yMin, double yMax )
24{
25 const double y = sample.value;
26 const double x1 = sample.interval.minValue();
27 const double x2 = sample.interval.maxValue();
28
29 const bool isOffScreen = ( y < yMin ) || ( y > yMax )
30 || ( x1 < xMin && x2 < xMin ) || ( x1 > xMax && x2 > xMax );
31
32 return !isOffScreen;
33}
34
35static inline bool qwtIsVSampleInside( const QwtIntervalSample& sample,
36 double xMin, double xMax, double yMin, double yMax )
37{
38 const double x = sample.value;
39 const double y1 = sample.interval.minValue();
40 const double y2 = sample.interval.maxValue();
41
42 const bool isOffScreen = ( x < xMin ) || ( x > xMax )
43 || ( y1 < yMin && y2 < yMin ) || ( y1 > yMax && y2 > yMax );
44
45 return !isOffScreen;
46}
47
48static inline int qwtInterpolated( int from, int to, double ratio )
49{
50 return qRound( from + ratio * ( to - from ) );
51}
52
53static int qwtStartIndex( int from, double min, double max,
54 const QwtSeriesData< QwtIntervalSample >* samples )
55{
56 /*
57 As we know, that the value coordinates are montonically
58 increasing/decreasing we can find the first sample before
59 entering the interval using a binary search algo.
60 */
61
62 struct lessThan
63 {
64 inline bool operator()( const double value,
65 const QwtIntervalSample& sample ) const
66 {
67 return value < sample.value;
68 }
69 };
70
71 struct greaterThan
72 {
73 inline bool operator()( const double value,
74 const QwtIntervalSample& sample ) const
75 {
76 return value > sample.value;
77 }
78 };
79
80 int idx;
81
82 if ( samples->firstSample().value < samples->lastSample().value )
83 {
84 idx = qwtUpperSampleIndex< QwtIntervalSample >(
85 *samples, min, lessThan() );
86 }
87 else
88 {
89 idx = qwtUpperSampleIndex< QwtIntervalSample >(
90 *samples, max, greaterThan() );
91 }
92
93 if ( idx >= 0 )
94 {
95 idx = qMax( from, idx );
96 if ( idx > 0 )
97 {
98 // we need to fill the area before the first sample
99 idx--;
100 }
101 }
102
103 return idx;
104}
105
106namespace
107{
108 class LinesRenderer
109 {
110 public:
111 LinesRenderer( Qt::Orientation,
112 const QwtScaleMap&, const QwtScaleMap&, const QRectF& );
113
114 void addSamples( const QwtSeriesData< QwtIntervalSample >*, int from, int to );
115
116 QVector< QLine > fillLines;
117 QVector< QLine > borderLines;
118
119 private:
120 bool addSample( const QwtIntervalSample& );
121 void flush();
122
123 bool append( int value, int min, int max );
124
125 void addFillLineAt( int value, int min, int max );
126 void addFillLines( int value, int min, int max );
127
128 void addBorderLineAt( int value, int min, int max );
129 void addBorderLine( int, int, int, int );
130
131 const bool m_vertical;
132
133 const QwtScaleMap& m_valueMap;
134 const QwtScaleMap& m_intervalMap;
135
136 const bool m_inverting;
137 bool m_pending;
138
139 // all ints are in paint device coordinates
140
141 int m_intvMin, m_intvMax; // interval boundaries of the canvas
142 int m_valueMin, m_valueMax; // value boundaries of the canvas
143
144 int m_value; // value of the last sample being processed
145
146 struct
147 {
148 inline void reset( int value )
149 {
150 min = max = last = value;
151 }
152
153 inline void extend( int value )
154 {
155 if ( value < min )
156 min = value;
157 else if ( value > max )
158 max = value;
159
160 last = value;
161 }
162
163 int min, max, last;
164
165 } m_lower, m_upper;
166 };
167
168 LinesRenderer::LinesRenderer( Qt::Orientation orientation,
169 const QwtScaleMap& xMap, const QwtScaleMap& yMap, const QRectF& rect )
170 : m_vertical( orientation == Qt::Vertical )
171 , m_valueMap( m_vertical ? xMap : yMap )
172 , m_intervalMap( m_vertical ? yMap : xMap )
173 , m_inverting( m_intervalMap.isInverting() )
174 , m_pending( false )
175 , m_value( 0 )
176 {
177 QRectF r = rect;
178 if ( !m_vertical )
179 r.setSize( QSizeF( r.height(), r.width() ) );
180
181 m_intvMin = qFloor( r.top() );
182 m_intvMax = qCeil( r.bottom() );
183
184 m_valueMin = qFloor( r.left() );
185 m_valueMax = qCeil( r.right() );
186
187 const int steps = m_valueMax - m_valueMin + 1;
188
189 // one line for each pixel
190 fillLines.reserve( steps );
191
192 /*
193 for both border lines:
194 one line ( min/max ) of the samples lying on the same pixel
195 one line connecting the pixels
196 */
197 borderLines.reserve( 4 * steps );
198 }
199
200 void LinesRenderer::addSamples(
201 const QwtSeriesData< QwtIntervalSample >* samples, int from, int to )
202 {
203 const double v1 = m_valueMap.invTransform( m_valueMin );
204 const double v2 = m_valueMap.invTransform( m_valueMax );
205
206 from = qwtStartIndex( from, qMin( v1, v2 ), qMax( v1, v2 ), samples );
207
208 if ( from >= 0 )
209 {
210 for ( int i = from; i <= to; i++ )
211 {
212 if ( addSample( samples->sample( i ) ) )
213 break;
214 }
215 }
216
217 flush();
218 }
219
220 inline bool LinesRenderer::addSample( const QwtIntervalSample& sample )
221 {
222 const double value = qRound( m_valueMap.transform( sample.value ) );
223
224 const int min = qRound( m_intervalMap.transform( sample.interval.minValue() ) );
225 const int max = qRound( m_intervalMap.transform( sample.interval.maxValue() ) );
226
227 return m_inverting ? append( value, max, min ) : append( value, max, min );
228 }
229
230 inline bool LinesRenderer::append(
231 const int value, const int lower, const int upper )
232 {
233 if ( !m_pending )
234 {
235 m_value = value;
236 m_lower.reset( lower );
237 m_upper.reset( upper );
238
239 m_pending = true;
240
241 return false;
242 }
243
244 if ( value != m_value )
245 {
246 addFillLines( value, lower, upper );
247 addBorderLineAt( m_value, m_lower.min, m_lower.max );
248 addBorderLineAt( m_value, m_upper.min, m_upper.max );
249
250 addBorderLine( m_value, m_lower.last, value, lower );
251 addBorderLine( m_value, m_upper.last, value, upper );
252
253 if ( ( value > m_value ) ? ( value > m_valueMax ) : ( value < m_valueMin ) )
254 {
255 m_pending = false;
256 return true;
257 }
258
259 m_value = value;
260
261 m_lower.reset( lower );
262 m_upper.reset( upper );
263 }
264 else
265 {
266 m_lower.extend( lower );
267 m_upper.extend( upper );
268 }
269
270 return false;
271 }
272
273 inline void LinesRenderer::flush()
274 {
275 if ( m_pending )
276 {
277 addFillLineAt( m_value, m_lower.min, m_upper.max );
278 addBorderLineAt( m_value, m_lower.min, m_lower.max );
279 addBorderLineAt( m_value, m_upper.min, m_upper.max );
280 }
281 }
282
283 inline void LinesRenderer::addFillLines(
284 const int value, const int lower, const int upper )
285 {
286 addFillLineAt( m_value, m_lower.min, m_upper.max );
287
288 const double delta = value - m_value;
289
290 if ( value > m_value )
291 {
292 for ( int v = m_value + 1; v < value; v++ )
293 {
294 const double ratio = ( v - m_value ) / delta;
295
296 addFillLineAt( v,
297 qwtInterpolated( m_lower.last, lower, ratio ),
298 qwtInterpolated( m_upper.last, upper, ratio ) );
299 }
300 }
301 else
302 {
303 for ( int v = m_value - 1; v > value; v-- )
304 {
305 const double ratio = ( v - m_value ) / delta;
306
307 addFillLineAt( v,
308 qwtInterpolated( m_lower.last, lower, ratio ),
309 qwtInterpolated( m_upper.last, upper, ratio ) );
310 }
311 }
312 }
313
314 inline void LinesRenderer::addFillLineAt( int value, int min, int max )
315 {
316 if ( ( min != max ) && ( max > m_intvMin ) && ( min < m_intvMax ) )
317 {
318 min = qMax( min, m_intvMin );
319 max = qMin( max, m_intvMax );
320
321 if( m_vertical )
322 fillLines += QLine( value, min, value, max );
323 else
324 fillLines += QLine( min, value, max, value );
325 }
326 }
327
328 inline void LinesRenderer::addBorderLineAt( int value, int min, int max )
329 {
330 if ( min != max )
331 addBorderLine( value, min, value, max );
332 }
333
334 inline void LinesRenderer::addBorderLine( int x1, int y1, int x2, int y2 )
335 {
336 if( m_vertical )
337 borderLines += QLine( x1, y1, x2, y2 );
338 else
339 borderLines += QLine( y1, x1, y2, x2 );
340 }
341}
342
343static void qwtDrawTubeLines(
344 const QwtPlotIntervalCurve* curve, QPainter* painter,
345 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
346 const QRectF& canvasRect, int from, int to)
347{
348 LinesRenderer renderer( curve->orientation(), xMap, yMap, canvasRect );
349 renderer.addSamples( curve->data(), from, to );
350
351 if ( curve->brush().style() != Qt::NoBrush )
352 {
353 painter->save();
354
355 painter->setPen( curve->brush().color() );
356 painter->setRenderHint( QPainter::Antialiasing, false );
357 painter->drawLines( renderer.fillLines );
358
359 painter->restore();
360 }
361
362 if ( curve->pen().style() != Qt::NoPen )
363 {
364 painter->save();
365
366 painter->setPen( curve->pen() );
367 painter->drawLines( renderer.borderLines );
368
369 painter->restore();
370 }
371}
372
373static void qwtDrawTube(
374 const QwtPlotIntervalCurve* curve, QPainter* painter,
375 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
376 const QRectF& canvasRect, int from, int to )
377{
378 const bool doAlign = QwtPainter::roundingAlignment( painter );
379
380 painter->save();
381
382 const size_t size = to - from + 1;
383 QPolygonF polygon( 2 * size );
384 QPointF* points = polygon.data();
385
386 for ( uint i = 0; i < size; i++ )
387 {
388 QPointF& minValue = points[i];
389 QPointF& maxValue = points[2 * size - 1 - i];
390
391 const QwtIntervalSample intervalSample = curve->sample( from + i );
392 if ( curve->orientation() == Qt::Vertical )
393 {
394 double x = xMap.transform( intervalSample.value );
395 double y1 = yMap.transform( intervalSample.interval.minValue() );
396 double y2 = yMap.transform( intervalSample.interval.maxValue() );
397
398 if ( doAlign )
399 {
400 x = qRound( x );
401 y1 = qRound( y1 );
402 y2 = qRound( y2 );
403 }
404
405 minValue.rx() = x;
406 minValue.ry() = y1;
407 maxValue.rx() = x;
408 maxValue.ry() = y2;
409 }
410 else
411 {
412 double y = yMap.transform( intervalSample.value );
413 double x1 = xMap.transform( intervalSample.interval.minValue() );
414 double x2 = xMap.transform( intervalSample.interval.maxValue() );
415
416 if ( doAlign )
417 {
418 y = qRound( y );
419 x1 = qRound( x1 );
420 x2 = qRound( x2 );
421 }
422
423 minValue.rx() = x1;
424 minValue.ry() = y;
425 maxValue.rx() = x2;
426 maxValue.ry() = y;
427 }
428 }
429
430 const bool doClip = curve->testPaintAttribute( QwtPlotIntervalCurve::ClipPolygons );
431
432 if ( curve->brush().style() != Qt::NoBrush )
433 {
434 painter->setPen( QPen( Qt::NoPen ) );
435 painter->setBrush( curve->brush() );
436
437 if ( doClip )
438 {
439 const qreal m = 1.0;
440 const QPolygonF p = QwtClipper::clippedPolygonF(
441 canvasRect.adjusted( -m, -m, m, m ), polygon, true );
442
443 QwtPainter::drawPolygon( painter, p );
444 }
445 else
446 {
447 QwtPainter::drawPolygon( painter, polygon );
448 }
449 }
450
451 if ( curve->pen().style() != Qt::NoPen )
452 {
453 painter->setPen( curve->pen() );
454 painter->setBrush( Qt::NoBrush );
455
456 if ( doClip )
457 {
458 qreal pw = QwtPainter::effectivePenWidth( painter->pen() );
459 const QRectF clipRect = canvasRect.adjusted( -pw, -pw, pw, pw );
460
461 QPolygonF p( size );
462
463 std::memcpy( p.data(), points, size * sizeof( QPointF ) );
464 QwtPainter::drawPolyline( painter,
465 QwtClipper::clippedPolygonF( clipRect, p ) );
466
467 std::memcpy( p.data(), points + size, size * sizeof( QPointF ) );
468 QwtPainter::drawPolyline( painter,
469 QwtClipper::clippedPolygonF( clipRect, p ) );
470 }
471 else
472 {
473 QwtPainter::drawPolyline( painter, points, size );
474 QwtPainter::drawPolyline( painter, points + size, size );
475 }
476 }
477
478 painter->restore();
479}
480
481class QwtPlotIntervalCurve::PrivateData
482{
483 public:
484 PrivateData():
485 style( QwtPlotIntervalCurve::Tube ),
486 symbol( NULL ),
487 pen( Qt::black ),
488 brush( Qt::white )
489 {
490 paintAttributes = QwtPlotIntervalCurve::ClipPolygons;
491 paintAttributes |= QwtPlotIntervalCurve::ClipSymbol;
492
493 pen.setCapStyle( Qt::FlatCap );
494 }
495
496 ~PrivateData()
497 {
498 delete symbol;
499 }
500
501 QwtPlotIntervalCurve::CurveStyle style;
502 const QwtIntervalSymbol* symbol;
503
504 QPen pen;
505 QBrush brush;
506
507 QwtPlotIntervalCurve::PaintAttributes paintAttributes;
508};
509
514 QwtPlotIntervalCurve::QwtPlotIntervalCurve( const QwtText& title )
515 : QwtPlotSeriesItem( title )
516{
517 init();
518}
519
524QwtPlotIntervalCurve::QwtPlotIntervalCurve( const QString& title )
525 : QwtPlotSeriesItem( QwtText( title ) )
526{
527 init();
528}
529
531QwtPlotIntervalCurve::~QwtPlotIntervalCurve()
532{
533 delete m_data;
534}
535
537 void QwtPlotIntervalCurve::init()
538{
539 setItemAttribute( QwtPlotItem::Legend, true );
540 setItemAttribute( QwtPlotItem::AutoScale, true );
541
542 m_data = new PrivateData;
543 setData( new QwtIntervalSeriesData() );
544
545 setZ( 19.0 );
546}
547
549 int QwtPlotIntervalCurve::rtti() const
550{
551 return QwtPlotIntervalCurve::Rtti_PlotIntervalCurve;
552}
553
561 void QwtPlotIntervalCurve::setPaintAttribute(
562 PaintAttribute attribute, bool on )
563{
564 if ( on )
565 m_data->paintAttributes |= attribute;
566 else
567 m_data->paintAttributes &= ~attribute;
568}
569
574 bool QwtPlotIntervalCurve::testPaintAttribute(
575 PaintAttribute attribute ) const
576{
577 return ( m_data->paintAttributes & attribute );
578}
579
584 void QwtPlotIntervalCurve::setSamples(
585 const QVector< QwtIntervalSample >& samples )
586{
587 setData( new QwtIntervalSeriesData( samples ) );
588}
589
600 void QwtPlotIntervalCurve::setSamples(
601 QwtSeriesData< QwtIntervalSample >* data )
602{
603 setData( data );
604}
605
612 void QwtPlotIntervalCurve::setStyle( CurveStyle style )
613{
614 if ( style != m_data->style )
615 {
616 m_data->style = style;
617
618 legendChanged();
619 itemChanged();
620 }
621}
622
627 QwtPlotIntervalCurve::CurveStyle QwtPlotIntervalCurve::style() const
628{
629 return m_data->style;
630}
631
638 void QwtPlotIntervalCurve::setSymbol( const QwtIntervalSymbol* symbol )
639{
640 if ( symbol != m_data->symbol )
641 {
642 delete m_data->symbol;
643 m_data->symbol = symbol;
644
645 legendChanged();
646 itemChanged();
647 }
648}
649
654 const QwtIntervalSymbol* QwtPlotIntervalCurve::symbol() const
655{
656 return m_data->symbol;
657}
658
672 void QwtPlotIntervalCurve::setPen( const QColor& color, qreal width, Qt::PenStyle style )
673{
674 setPen( QPen( color, width, style ) );
675}
676
682 void QwtPlotIntervalCurve::setPen( const QPen& pen )
683{
684 if ( pen != m_data->pen )
685 {
686 m_data->pen = pen;
687
688 legendChanged();
689 itemChanged();
690 }
691}
692
697 const QPen& QwtPlotIntervalCurve::pen() const
698{
699 return m_data->pen;
700}
701
710 void QwtPlotIntervalCurve::setBrush( const QBrush& brush )
711{
712 if ( brush != m_data->brush )
713 {
714 m_data->brush = brush;
715
716 legendChanged();
717 itemChanged();
718 }
719}
720
725 const QBrush& QwtPlotIntervalCurve::brush() const
726{
727 return m_data->brush;
728}
729
734QRectF QwtPlotIntervalCurve::boundingRect() const
735{
736 QRectF rect = QwtPlotSeriesItem::boundingRect();
737 if ( orientation() == Qt::Vertical )
738 rect.setRect( rect.y(), rect.x(), rect.height(), rect.width() );
739
740 return rect;
741}
742
756 void QwtPlotIntervalCurve::drawSeries( QPainter* painter,
757 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
758 const QRectF& canvasRect, int from, int to ) const
759{
760 if ( to < 0 )
761 to = dataSize() - 1;
762
763 if ( from < 0 )
764 from = 0;
765
766 if ( from > to )
767 return;
768
769 if ( m_data->style == Tube )
770 drawTube( painter, xMap, yMap, canvasRect, from, to );
771
772 if ( m_data->symbol &&
773 ( m_data->symbol->style() != QwtIntervalSymbol::NoSymbol ) )
774 {
775 drawSymbols( painter, *m_data->symbol,
776 xMap, yMap, canvasRect, from, to );
777 }
778}
779
797 void QwtPlotIntervalCurve::drawTube(
798 QPainter* painter, const QwtScaleMap& xMap,
799 const QwtScaleMap& yMap, const QRectF& canvasRect, int from, int to) const
800{
801 if ( ( m_data->pen.style() == Qt::NoPen ) &&
802 ( m_data->brush.style() == Qt::NoBrush ) )
803 {
804 return;
805 }
806
807 const bool useLines = testPaintAttribute( TubeAsLines )
808 && QwtPainter::roundingAlignment( painter );
809
810 if ( useLines )
811 qwtDrawTubeLines( this, painter, xMap, yMap, canvasRect, from, to );
812 else
813 qwtDrawTube( this, painter, xMap, yMap, canvasRect, from, to );
814}
815
829 void QwtPlotIntervalCurve::drawSymbols(
830 QPainter* painter, const QwtIntervalSymbol& symbol,
831 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
832 const QRectF& canvasRect, int from, int to ) const
833{
834 painter->save();
835
836 QPen pen = symbol.pen();
837 pen.setCapStyle( Qt::FlatCap );
838
839 painter->setPen( pen );
840 painter->setBrush( symbol.brush() );
841
842 const QRectF tr = QwtScaleMap::invTransform( xMap, yMap, canvasRect );
843
844 const double xMin = tr.left();
845 const double xMax = tr.right();
846 const double yMin = tr.top();
847 const double yMax = tr.bottom();
848
849 const bool doClip = m_data->paintAttributes & ClipSymbol;
850
851 for ( int i = from; i <= to; i++ )
852 {
853 const QwtIntervalSample s = sample( i );
854
855 if ( orientation() == Qt::Vertical )
856 {
857 if ( !doClip || qwtIsVSampleInside( s, xMin, xMax, yMin, yMax ) )
858 {
859 const double x = xMap.transform( s.value );
860 const double y1 = yMap.transform( s.interval.minValue() );
861 const double y2 = yMap.transform( s.interval.maxValue() );
862
863 symbol.draw( painter, orientation(),
864 QPointF( x, y1 ), QPointF( x, y2 ) );
865 }
866 }
867 else
868 {
869 if ( !doClip || qwtIsHSampleInside( s, xMin, xMax, yMin, yMax ) )
870 {
871 const double y = yMap.transform( s.value );
872 const double x1 = xMap.transform( s.interval.minValue() );
873 const double x2 = xMap.transform( s.interval.maxValue() );
874
875 symbol.draw( painter, orientation(),
876 QPointF( x1, y ), QPointF( x2, y ) );
877 }
878 }
879 }
880
881 painter->restore();
882}
883
896 QwtGraphic QwtPlotIntervalCurve::legendIcon(
897 int index, const QSizeF& size ) const
898{
899 Q_UNUSED( index );
900
901 if ( size.isEmpty() )
902 return QwtGraphic();
903
904 QwtGraphic icon;
905 icon.setDefaultSize( size );
906 icon.setRenderHint( QwtGraphic::RenderPensUnscaled, true );
907
908 QPainter painter( &icon );
909 painter.setRenderHint( QPainter::Antialiasing,
910 testRenderHint( QwtPlotItem::RenderAntialiased ) );
911
912 if ( m_data->style == Tube )
913 {
914 QRectF r( 0, 0, size.width(), size.height() );
915 painter.fillRect( r, m_data->brush );
916 }
917
918 if ( m_data->symbol &&
919 ( m_data->symbol->style() != QwtIntervalSymbol::NoSymbol ) )
920 {
921 QPen pen = m_data->symbol->pen();
922 pen.setWidthF( pen.widthF() );
923 pen.setCapStyle( Qt::FlatCap );
924
925 painter.setPen( pen );
926 painter.setBrush( m_data->symbol->brush() );
927
928 if ( orientation() == Qt::Vertical )
929 {
930 const double x = 0.5 * size.width();
931
932 m_data->symbol->draw( &painter, orientation(),
933 QPointF( x, 0 ), QPointF( x, size.height() - 1.0 ) );
934 }
935 else
936 {
937 const double y = 0.5 * size.height();
938
939 m_data->symbol->draw( &painter, orientation(),
940 QPointF( 0.0, y ), QPointF( size.width() - 1.0, y ) );
941 }
942 }
943
944 return icon;
945}
QVector
Definition qwt_clipper.h:23
QwtArraySeriesData
Template class for data, that is organized as QVector.
Definition qwt_series_data.h:153
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
QwtInterval::minValue
double minValue() const
Definition qwt_interval.h:192
QwtInterval::maxValue
double maxValue() const
Definition qwt_interval.h:198
QwtIntervalSample
A sample of the types (x1-x2, y) or (x, y1-y2)
Definition qwt_samples.h:21
QwtIntervalSample::interval
QwtInterval interval
Interval.
Definition qwt_samples.h:34
QwtIntervalSample::value
double value
Value.
Definition qwt_samples.h:31
QwtIntervalSymbol
A drawing primitive for displaying an interval like an error bar.
Definition qwt_interval_symbol.h:28
QwtIntervalSymbol::draw
virtual void draw(QPainter *, Qt::Orientation, const QPointF &from, const QPointF &to) const
Definition qwt_interval_symbol.cpp:200
QwtIntervalSymbol::pen
const QPen & pen() const
Definition qwt_interval_symbol.cpp:185
QwtIntervalSymbol::NoSymbol
@ NoSymbol
No Style. The symbol cannot be drawn.
Definition qwt_interval_symbol.h:34
QwtIntervalSymbol::style
Style style() const
Definition qwt_interval_symbol.cpp:103
QwtIntervalSymbol::brush
const QBrush & brush() const
Definition qwt_interval_symbol.cpp:146
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::roundingAlignment
static bool roundingAlignment()
Definition qwt_painter.h:183
QwtPlotIntervalCurve
QwtPlotIntervalCurve represents a series of samples, where each value is associated with an interval ...
Definition qwt_plot_intervalcurve.h:30
QwtPlotIntervalCurve::rtti
virtual int rtti() const override
Definition qwt_plot_intervalcurve.cpp:549
QwtPlotIntervalCurve::~QwtPlotIntervalCurve
virtual ~QwtPlotIntervalCurve()
Destructor.
Definition qwt_plot_intervalcurve.cpp:531
QwtPlotIntervalCurve::PaintAttributes
QFlags< PaintAttribute > PaintAttributes
Definition qwt_plot_intervalcurve.h:98
QwtPlotIntervalCurve::setBrush
void setBrush(const QBrush &)
Definition qwt_plot_intervalcurve.cpp:710
QwtPlotIntervalCurve::QwtPlotIntervalCurve
QwtPlotIntervalCurve(const QString &title=QString())
Definition qwt_plot_intervalcurve.cpp:524
QwtPlotIntervalCurve::PaintAttribute
PaintAttribute
Definition qwt_plot_intervalcurve.h:65
QwtPlotIntervalCurve::ClipSymbol
@ ClipSymbol
Check if a symbol is on the plot canvas before painting it.
Definition qwt_plot_intervalcurve.h:74
QwtPlotIntervalCurve::ClipPolygons
@ ClipPolygons
Definition qwt_plot_intervalcurve.h:71
QwtPlotIntervalCurve::TubeAsLines
@ TubeAsLines
Definition qwt_plot_intervalcurve.h:95
QwtPlotIntervalCurve::setPen
void setPen(const QColor &, qreal width=0.0, Qt::PenStyle=Qt::SolidLine)
Definition qwt_plot_intervalcurve.cpp:672
QwtPlotIntervalCurve::legendIcon
virtual QwtGraphic legendIcon(int index, const QSizeF &) const override
Definition qwt_plot_intervalcurve.cpp:896
QwtPlotIntervalCurve::boundingRect
virtual QRectF boundingRect() const override
Definition qwt_plot_intervalcurve.cpp:734
QwtPlotIntervalCurve::setSymbol
void setSymbol(const QwtIntervalSymbol *)
Definition qwt_plot_intervalcurve.cpp:638
QwtPlotIntervalCurve::style
CurveStyle style() const
Definition qwt_plot_intervalcurve.cpp:627
QwtPlotIntervalCurve::setStyle
void setStyle(CurveStyle style)
Definition qwt_plot_intervalcurve.cpp:612
QwtPlotIntervalCurve::init
void init()
Initialize internal members.
Definition qwt_plot_intervalcurve.cpp:537
QwtPlotIntervalCurve::brush
const QBrush & brush() const
Definition qwt_plot_intervalcurve.cpp:725
QwtPlotIntervalCurve::drawSymbols
virtual void drawSymbols(QPainter *, const QwtIntervalSymbol &, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const
Definition qwt_plot_intervalcurve.cpp:829
QwtPlotIntervalCurve::CurveStyle
CurveStyle
Curve styles. The default setting is QwtPlotIntervalCurve::Tube.
Definition qwt_plot_intervalcurve.h:39
QwtPlotIntervalCurve::Tube
@ Tube
Definition qwt_plot_intervalcurve.h:50
QwtPlotIntervalCurve::symbol
const QwtIntervalSymbol * symbol() const
Definition qwt_plot_intervalcurve.cpp:654
QwtPlotIntervalCurve::pen
const QPen & pen() const
Definition qwt_plot_intervalcurve.cpp:697
QwtPlotIntervalCurve::setPaintAttribute
void setPaintAttribute(PaintAttribute, bool on=true)
Definition qwt_plot_intervalcurve.cpp:561
QwtPlotIntervalCurve::setSamples
void setSamples(const QVector< QwtIntervalSample > &)
Definition qwt_plot_intervalcurve.cpp:584
QwtPlotIntervalCurve::drawTube
virtual void drawTube(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const
Definition qwt_plot_intervalcurve.cpp:797
QwtPlotIntervalCurve::drawSeries
virtual void drawSeries(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const override
Definition qwt_plot_intervalcurve.cpp:756
QwtPlotIntervalCurve::testPaintAttribute
bool testPaintAttribute(PaintAttribute) const
Definition qwt_plot_intervalcurve.cpp:574
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::Rtti_PlotIntervalCurve
@ Rtti_PlotIntervalCurve
For QwtPlotIntervalCurve.
Definition qwt_plot_item.h:99
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
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
QwtScaleMap
A scale map.
Definition qwt_scale_map.h:27
QwtScaleMap::transform
double transform(double s) const
Definition qwt_scale_map.h:137
QwtScaleMap::invTransform
double invTransform(double p) const
Definition qwt_scale_map.h:154
QwtSeriesData< QwtIntervalSample >
QwtSeriesData::lastSample
T lastSample() const
Definition qwt_series_data.h:86
QwtSeriesData::sample
virtual T sample(size_t i) const =0
QwtSeriesData::firstSample
T firstSample() const
Definition qwt_series_data.h:80
QwtSeriesStore::sample
T sample(int index) const
Definition qwt_series_store.h:158
QwtSeriesStore< QwtIntervalSample >::dataSize
virtual size_t dataSize() const override
Definition qwt_series_store.h:175
QwtSeriesStore::data
QwtSeriesData< T > * data()
Definition qwt_series_store.h:146
QwtSeriesStore< QwtIntervalSample >::setData
void setData(QwtSeriesData< QwtIntervalSample > *series)
Definition qwt_series_store.h:164
QwtText
A class representing a text.
Definition qwt_text.h:52
QwtClipper::clippedPolygonF
QWT_EXPORT QPolygonF clippedPolygonF(const QRectF &, const QPolygonF &, bool closePolygon=false)
Definition qwt_clipper.cpp:455