28#ifndef QWT_PLOT_CURVE_H
29#define QWT_PLOT_CURVE_H
31#include "qwt_global.h"
32#include "qwt_plot_seriesitem.h"
180 Q_DECLARE_FLAGS(CurveAttributes, CurveAttribute)
194 LegendNoAttribute = 0x00,
200 LegendShowLine = 0x01,
205 LegendShowSymbol = 0x02,
211 LegendShowBrush = 0x04
214 Q_DECLARE_FLAGS(LegendAttributes, LegendAttribute)
243 MinimizeMemory = 0x04,
281 FilterPointsAggressive = 0x10,
308 FilterPointsPixel = 0x20,
327 FilterPointsLTTB = 0x40,
346 FilterPointsMinMaxLTTB = 0x80,
378 FilterPointsAdaptive = 0x100,
381 Q_DECLARE_FLAGS(PaintAttributes, PaintAttribute)
414 SavitzkyGolaySmoothing
418 explicit QwtPlotCurve(
const QString& title = QString());
427 virtual int rtti()
const override;
433 void setPaintAttribute(PaintAttribute,
bool on =
true);
436 bool testPaintAttribute(PaintAttribute)
const;
439 void setLegendAttribute(LegendAttribute,
bool on =
true);
442 bool testLegendAttribute(LegendAttribute)
const;
445 void setLegendAttributes(LegendAttributes);
448 LegendAttributes legendAttributes()
const;
451 void setRawSamples(
const double* xData,
const double* yData,
int size);
454 void setRawSamples(
const float* xData,
const float* yData,
int size);
457 void setRawSamples(
const double* yData,
int size);
460 void setRawSamples(
const float* yData,
int size);
463 void setSamples(
const double* xData,
const double* yData,
int size);
466 void setSamples(
const float* xData,
const float* yData,
int size);
469 void setSamples(
const double* yData,
int size);
472 void setSamples(
const float* yData,
int size);
502 virtual int closestPoint(
const QPointF& pos,
double* dist =
nullptr)
const;
505 double minXValue()
const;
508 double maxXValue()
const;
511 double minYValue()
const;
514 double maxYValue()
const;
517 void setCurveAttribute(CurveAttribute,
bool on =
true);
520 bool testCurveAttribute(CurveAttribute)
const;
523 void setPen(
const QColor&, qreal width = 0.0, Qt::PenStyle = Qt::SolidLine);
526 void setPen(
const QPen&);
529 const QPen& pen()
const;
532 void setBrush(
const QBrush&);
535 const QBrush& brush()
const;
538 void setBaseline(
double);
541 double baseline()
const;
544 void setStyle(CurveStyle style);
547 CurveStyle style()
const;
562 void setSmoothAlgorithm(SmoothAlgorithm);
565 SmoothAlgorithm smoothAlgorithm()
const;
568 void setSmoothWindow(
int numPoints);
571 int smoothWindow()
const;
574 void setSmoothPolynomialOrder(
int order);
577 int smoothPolynomialOrder()
const;
580 void setSmoothPreserveThreshold(
double threshold);
583 double smoothPreserveThreshold()
const;
589 const QRectF& canvasRect,
591 int to)
const override;
604 virtual void drawCurve(QPainter*,
608 const QRectF& canvasRect,
613 virtual void drawSymbols(QPainter*,
617 const QRectF& canvasRect,
623 drawLines(QPainter*,
const QwtScaleMap& xMap,
const QwtScaleMap& yMap,
const QRectF& canvasRect,
int from,
int to)
const;
627 drawSticks(QPainter*,
const QwtScaleMap& xMap,
const QwtScaleMap& yMap,
const QRectF& canvasRect,
int from,
int to)
const;
631 drawDots(QPainter*,
const QwtScaleMap& xMap,
const QwtScaleMap& yMap,
const QRectF& canvasRect,
int from,
int to)
const;
635 drawSteps(QPainter*,
const QwtScaleMap& xMap,
const QwtScaleMap& yMap,
const QRectF& canvasRect,
int from,
int to)
const;
638 virtual void fillCurve(QPainter*,
const QwtScaleMap&,
const QwtScaleMap&,
const QRectF& canvasRect, QPolygonF&)
const;
671Q_DECLARE_OPERATORS_FOR_FLAGS(QwtPlotCurve::PaintAttributes)
672Q_DECLARE_OPERATORS_FOR_FLAGS(QwtPlotCurve::LegendAttributes)
673Q_DECLARE_OPERATORS_FOR_FLAGS(QwtPlotCurve::CurveAttributes)
Abstract base class for curve fitting algorithms
Definition qwt_curve_fitter.h:39
A paint device for scalable graphics
Definition qwt_graphic.h:85
A plot item, that represents a series of points
Definition qwt_plot_curve.h:75
CurveStyle
Curve styles
Definition qwt_plot_curve.h:82
@ Steps
Definition qwt_plot_curve.h:106
@ Sticks
Definition qwt_plot_curve.h:99
@ Lines
Definition qwt_plot_curve.h:93
@ Dots
Definition qwt_plot_curve.h:114
double minXValue() const
boundingRect().left()
Definition qwt_plot_curve.h:648
CurveAttribute
Attribute for drawing the curve
Definition qwt_plot_curve.h:129
double maxXValue() const
boundingRect().right()
Definition qwt_plot_curve.h:654
LegendAttribute
Attributes how to represent the curve on the legend
Definition qwt_plot_curve.h:189
double minYValue() const
boundingRect().top()
Definition qwt_plot_curve.h:660
PaintAttribute
Attributes to modify the drawing algorithm
Definition qwt_plot_curve.h:222
double maxYValue() const
boundingRect().bottom()
Definition qwt_plot_curve.h:666
SmoothAlgorithm
Algorithm for smoothing the rendered polyline
Definition qwt_plot_curve.h:403
@ GaussianSmoothing
Gaussian weighted moving window: strong noise suppression
Definition qwt_plot_curve.h:408
virtual QwtGraphic legendIcon(int index, const QSizeF &) const
Return a legend icon
Definition qwt_plot_item.cpp:420
virtual int rtti() const
Runtime type information
Definition qwt_plot_item.cpp:155
virtual void attach(QwtPlot *plot)
Attach the item to a plot
Definition qwt_plot_item.cpp:118
Base class for plot items representing a series of samples
Definition qwt_plot_seriesitem.h:44
virtual void dataChanged() override
dataChanged() indicates, that the series has been changed.
Definition qwt_plot_seriesitem.cpp:131
virtual QRectF boundingRect() const override
Get the bounding rectangle
Definition qwt_plot_seriesitem.cpp:114
virtual void drawSeries(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const =0
Draw a subset of the samples
A 2-D plotting widget
Definition qwt_plot.h:100
A scale map
Definition qwt_scale_map.h:44
Abstract interface for iterating over samples
Definition qwt_series_data.h:88
Class storing a QwtSeriesData object
Definition qwt_series_store.h:91
A class for drawing symbols
Definition qwt_symbol.h:51
A class representing a text
Definition qwt_text.h:70