|
QWT API (English) 7.0.1
Qt Widget Library for Technical Applications - English API Documentation
|
A plot item, that represents a series of points. More...
#include <qwt_plot_curve.h>
Classes | |
| class | PrivateData |
Public Member Functions | |
| QwtPlotCurve (const QString &title=QString()) | |
| Constructor with QString title. | |
| QwtPlotCurve (const QwtText &title) | |
| Constructor with QwtText title. | |
| virtual | ~QwtPlotCurve () |
| Destructor . | |
| virtual int | rtti () const override |
| Get the runtime type information. | |
| void | setPaintAttribute (PaintAttribute, bool on=true) |
| Set paint attribute. | |
| bool | testPaintAttribute (PaintAttribute) const |
| Test paint attribute. | |
| void | setLegendAttribute (LegendAttribute, bool on=true) |
| Set legend attribute. | |
| bool | testLegendAttribute (LegendAttribute) const |
| Test legend attribute. | |
| void | setLegendAttributes (LegendAttributes) |
| Set legend attributes. | |
| LegendAttributes | legendAttributes () const |
| Get legend attributes. | |
| void | setRawSamples (const double *xData, const double *yData, int size) |
| Initialize data by pointing to memory blocks not managed by QwtPlotCurve (double) | |
| void | setRawSamples (const float *xData, const float *yData, int size) |
| Initialize data by pointing to memory blocks not managed by QwtPlotCurve (float) | |
| void | setRawSamples (const double *yData, int size) |
| Initialize data by pointing to a memory block not managed by QwtPlotCurve (double, y-axis only) | |
| void | setRawSamples (const float *yData, int size) |
| Initialize data by pointing to a memory block not managed by QwtPlotCurve (float, y-axis only) | |
| void | setSamples (const double *xData, const double *yData, int size) |
| Set data by copying x- and y-values from specified memory blocks (double) | |
| void | setSamples (const float *xData, const float *yData, int size) |
| Set data by copying x- and y-values from specified memory blocks (float) | |
| void | setSamples (const double *yData, int size) |
| Set data by copying y-values from a specified memory block (double) | |
| void | setSamples (const float *yData, int size) |
| Set data by copying y-values from a specified memory block (float) | |
| void | setSamples (const QVector< double > &yData) |
| Initialize data with an array of y values (explicitly shared, double) | |
| void | setSamples (const QVector< float > &yData) |
| Initialize data with an array of y values (explicitly shared, float) | |
| void | setSamples (const QVector< double > &xData, const QVector< double > &yData) |
| Initialize data with x- and y-arrays (explicitly shared, double) | |
| void | setSamples (const QVector< float > &xData, const QVector< float > &yData) |
| Initialize data with x- and y-arrays (explicitly shared, float) | |
| void | setSamples (QVector< double > &&xData, QVector< double > &&yData) |
| Initialize data with x- and y-arrays (rvalue, double) | |
| void | setSamples (QVector< float > &&xData, QVector< float > &&yData) |
| Initialize data with x- and y-arrays (rvalue, float) | |
| void | setSamples (QVector< QPointF > &&) |
| Initialize data with an array of points (rvalue) | |
| void | setSamples (const QVector< QPointF > &) |
| Initialize data with an array of points. | |
| void | setSamples (QwtSeriesData< QPointF > *) |
| Assign a series of points. | |
| virtual int | closestPoint (const QPointF &pos, double *dist=nullptr) const |
| Find the closest curve point for a specific position. | |
| double | minXValue () const |
| boundingRect().left() | |
| double | maxXValue () const |
| boundingRect().right() | |
| double | minYValue () const |
| boundingRect().top() | |
| double | maxYValue () const |
| boundingRect().bottom() | |
| void | setCurveAttribute (CurveAttribute, bool on=true) |
| Set curve attribute. | |
| bool | testCurveAttribute (CurveAttribute) const |
| Test curve attribute. | |
| void | setPen (const QColor &, qreal width=0.0, Qt::PenStyle=Qt::SolidLine) |
| Build and assign a pen. | |
| void | setPen (const QPen &) |
| Assign a pen. | |
| const QPen & | pen () const |
| Get the pen used to draw the lines. | |
| void | setBrush (const QBrush &) |
| Assign a brush. | |
| const QBrush & | brush () const |
| Get the brush used to fill the area between lines and the baseline. | |
| void | setBaseline (double) |
| Set the value of the baseline. | |
| double | baseline () const |
| Get the baseline value. | |
| void | setStyle (CurveStyle style) |
| Set the curve's drawing style. | |
| CurveStyle | style () const |
| Get the curve's drawing style. | |
| void | setSymbol (QwtSymbol *) |
| Assign a symbol. | |
| const QwtSymbol * | symbol () const |
| Get the current symbol. | |
| void | setCurveFitter (QwtCurveFitter *) |
| Assign a curve fitter. | |
| QwtCurveFitter * | curveFitter () const |
| Get the curve fitter. | |
| virtual void | drawSeries (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const override |
| Draw an interval of the curve. | |
| virtual QwtGraphic | legendIcon (int index, const QSizeF &) const override |
| Get the icon representing the curve on the legend. | |
Public Member Functions inherited from QwtPlotSeriesItem | |
| QwtPlotSeriesItem (const QString &title=QString()) | |
| Constructor. | |
| QwtPlotSeriesItem (const QwtText &title) | |
| Constructor. | |
| virtual | ~QwtPlotSeriesItem () |
| Destructor . | |
| void | setOrientation (Qt::Orientation) |
| Set the orientation of the item. | |
| Qt::Orientation | orientation () const |
| Get the orientation of the plot item. | |
| virtual void | draw (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const override |
| Draw the complete series. | |
| virtual QRectF | boundingRect () const override |
| Get the bounding rectangle. | |
| virtual void | updateScaleDiv (const QwtScaleDiv &, const QwtScaleDiv &) override |
| Update the scale divisions. | |
Public Member Functions inherited from QwtPlotItem | |
| QwtPlotItem () | |
| Default constructor. | |
| QwtPlotItem (const QString &title) | |
| Constructor with title as QString. | |
| QwtPlotItem (const QwtText &title) | |
| Constructor with title as QwtText. | |
| virtual | ~QwtPlotItem () |
| Destructor. | |
| void | attach (QwtPlot *plot) |
| Attach the item to a plot. | |
| void | detach () |
| Detach the item from the plot. | |
| QwtPlot * | plot () const |
| Get the plot the item is attached to. | |
| void | setTitle (const QString &title) |
| Set the title using a QString. | |
| void | setTitle (const QwtText &title) |
| Set the title using a QwtText. | |
| const QwtText & | title () const |
| Get the title. | |
| void | setItemAttribute (ItemAttribute, bool on=true) |
| Set an item attribute. | |
| bool | testItemAttribute (ItemAttribute) const |
| Test an item attribute. | |
| void | setItemInterest (ItemInterest, bool on=true) |
| Set an item interest. | |
| bool | testItemInterest (ItemInterest) const |
| Test an item interest. | |
| void | setRenderHint (RenderHint, bool on=true) |
| Set a render hint. | |
| bool | testRenderHint (RenderHint) const |
| Test a render hint. | |
| void | setRenderThreadCount (uint numThreads) |
| Set the number of render threads. | |
| uint | renderThreadCount () const |
| Get the number of render threads. | |
| void | setLegendIconSize (const QSize &) |
| Set the legend icon size. | |
| QSize | legendIconSize () const |
| Get the legend icon size. | |
| double | z () const |
| Get the z-value. | |
| void | setZ (double z) |
| Set the z-value. | |
| void | show () |
| Show the item. | |
| void | hide () |
| Hide the item. | |
| virtual void | setVisible (bool) |
| Set the visibility. | |
| bool | isVisible () const |
| Check if the item is visible. | |
| void | setAxes (QwtAxisId xAxis, QwtAxisId yAxis) |
| Set both axes. | |
| void | setXAxis (QwtAxisId) |
| Set the x-axis. | |
| QwtAxisId | xAxis () const |
| Get the x-axis. | |
| void | setYAxis (QwtAxisId) |
| Set the y-axis. | |
| QwtAxisId | yAxis () const |
| Get the y-axis. | |
| virtual void | itemChanged () |
| Notify the plot that the item has changed. | |
| virtual void | legendChanged () |
| Notify the item that the legend has changed. | |
| virtual void | getCanvasMarginHint (const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, double &left, double &top, double &right, double &bottom) const |
| Get margin hints for the canvas. | |
| virtual void | updateLegend (const QwtPlotItem *, const QList< QwtLegendData > &) |
| Update the item with changes of the legend. | |
| QRectF | scaleRect (const QwtScaleMap &, const QwtScaleMap &) const |
| Calculate the scale rectangle. | |
| QRectF | paintRect (const QwtScaleMap &, const QwtScaleMap &) const |
| Calculate the paint rectangle. | |
| virtual QList< QwtLegendData > | legendData () const |
| Return legend data. | |
Public Member Functions inherited from QwtSeriesStore< QPointF > | |
| void | setData (QwtSeriesData< QPointF > *series) |
| QwtSeriesData< QPointF > * | data () |
| const QwtSeriesData< QPointF > * | data () const |
| QPointF | sample (size_t index) const |
| virtual size_t | dataSize () const override |
| virtual QRectF | dataRect () const override |
| virtual void | setRectOfInterest (const QRectF &rect) override |
| Set a the "rectangle of interest" for the stored series. | |
| QwtSeriesData< QPointF > * | swapData (QwtSeriesData< QPointF > *series) |
Protected Member Functions | |
| void | init () |
| Initialize the curve . | |
| virtual void | drawCurve (QPainter *, int style, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const |
| Draw the curve . | |
| virtual void | drawSymbols (QPainter *, const QwtSymbol &, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const |
| Draw symbols . | |
| virtual void | drawLines (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const |
| Draw lines . | |
| virtual void | drawSticks (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const |
| Draw sticks . | |
| virtual void | drawDots (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const |
| Draw dots . | |
| virtual void | drawSteps (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const |
| Draw steps . | |
| virtual void | fillCurve (QPainter *, const QwtScaleMap &, const QwtScaleMap &, const QRectF &canvasRect, QPolygonF &) const |
| Fill the curve . | |
| void | closePolyline (QPainter *, const QwtScaleMap &, const QwtScaleMap &, QPolygonF &) const |
| Close the polyline . | |
Protected Member Functions inherited from QwtPlotSeriesItem | |
| virtual void | dataChanged () override |
| dataChanged() indicates, that the series has been changed. | |
Protected Member Functions inherited from QwtPlotItem | |
| QwtGraphic | defaultIcon (const QBrush &, const QSizeF &) const |
| Create a default icon. | |
A plot item, that represents a series of points.
Attribute for drawing the curve.
| Enumerator | |
|---|---|
| Inverted | For QwtPlotCurve::Steps only. Draws a step function from the right to the left. |
| Fitted | Only in combination with QwtPlotCurve::Lines A QwtCurveFitter tries to interpolate/smooth the curve, before it is painted.
|
Curve styles.
| Enumerator | |
|---|---|
| NoCurve | Don't draw a curve. Note: This doesn't affect the symbols. |
| Lines | Connect the points with straight lines. The lines might be interpolated depending on the 'Fitted' attribute. Curve fitting can be configured using setCurveFitter(). |
| Sticks | Draw vertical or horizontal sticks ( depending on the orientation() ) from a baseline which is defined by setBaseline(). |
| Steps | Connect the points with a step function. The step function is drawn from the left to the right or vice versa, depending on the QwtPlotCurve::Inverted attribute. |
| Dots | Draw dots at the locations of the data points. Note: This is different from a dotted line (see setPen()), and faster as a curve in QwtPlotCurve::NoStyle style and a symbol painting a point. |
| UserCurve | Styles >= QwtPlotCurve::UserCurve are reserved for derived classes of QwtPlotCurve that overload drawCurve() with additional application specific curve types. |
Attributes how to represent the curve on the legend.
| Enumerator | |
|---|---|
| LegendNoAttribute | QwtPlotCurve tries to find a color representing the curve and paints a rectangle with it. |
| LegendShowLine | If the style() is not QwtPlotCurve::NoCurve a line is painted with the curve pen(). |
| LegendShowSymbol | If the curve has a valid symbol it is painted. |
| LegendShowBrush | If the curve has a brush a rectangle filled with the curve brush() is painted. |
Attributes to modify the drawing algorithm.
| Enumerator | |
|---|---|
| ClipPolygons | Clip polygons before painting them. In situations, where points are far outside the visible area (f.e when zooming deep) this might be a substantial improvement for the painting performance |
| FilterPoints | Tries to reduce the data that has to be painted, by sorting out duplicates, or paintings outside the visible area. Might have a notable impact on curves with many close points. Only a couple of very basic filtering algorithms are implemented. |
| MinimizeMemory | Minimize memory usage that is temporarily needed for the translated points, before they get painted. This might slow down the performance of painting |
| ImageBuffer | Render the points to a temporary image and paint the image. This is a very special optimization for Dots style, when having a huge amount of points. With a reasonable number of points QPainter::drawPoints() will be faster. |
| FilterPointsAggressive | More aggressive point filtering trying to filter out intermediate points, accepting minor visual differences. Has only an effect, when drawing the curve to a paint device in integer coordinates ( f.e. all widgets on screen ) using the fact, that consecutive points are often mapped to the same x or y coordinate. Each chunk of samples mapped to the same coordinate can be reduced to 4 points ( first, min, max last ). In the worst case the polygon to be rendered will be 4 times the width of the plot canvas. The algorithm is very fast and effective for huge datasets, and can be used inside a replot cycle.
|
|
explicit |
Constructor with QString title.
|
virtual |
Destructor .
| double QwtPlotCurve::baseline | ( | ) | const |
Get the baseline value.
| const QBrush & QwtPlotCurve::brush | ( | ) | const |
Get the brush used to fill the area between lines and the baseline.
|
protected |
Close the polyline .
Complete a polygon to be a closed polygon including the area between the original polygon and the baseline.
|
virtual |
Find the closest curve point for a specific position.
| QwtCurveFitter * QwtPlotCurve::curveFitter | ( | ) | const |
Get the curve fitter.
|
protectedvirtual |
Draw the curve .
Draw the line part (without symbols) of a curve interval.
|
protectedvirtual |
Draw dots .
Draw dots.
|
protectedvirtual |
Draw lines .
Draw lines.
|
overridevirtual |
Draw an interval of the curve.
Implements QwtPlotSeriesItem.
|
protectedvirtual |
Draw steps .
Draw step function.
|
protectedvirtual |
Draw sticks .
Draw sticks.
|
protectedvirtual |
Draw symbols .
Draw symbols.
|
protectedvirtual |
Fill the curve .
Fill the area between the curve and the baseline with the curve brush.
|
protected |
Initialize the curve .
Initialize internal members.
| QwtPlotCurve::LegendAttributes QwtPlotCurve::legendAttributes | ( | ) | const |
Get legend attributes.
|
overridevirtual |
Get the icon representing the curve on the legend.
Reimplemented from QwtPlotItem.
| const QPen & QwtPlotCurve::pen | ( | ) | const |
Get the pen used to draw the lines.
|
overridevirtual |
Get the runtime type information.
Reimplemented from QwtPlotItem.
| void QwtPlotCurve::setBaseline | ( | double | value | ) |
Set the value of the baseline.
| void QwtPlotCurve::setBrush | ( | const QBrush & | brush | ) |
Assign a brush.
| void QwtPlotCurve::setCurveAttribute | ( | CurveAttribute | attribute, |
| bool | on = true |
||
| ) |
Set curve attribute.
| void QwtPlotCurve::setCurveFitter | ( | QwtCurveFitter * | curveFitter | ) |
Assign a curve fitter.
| void QwtPlotCurve::setLegendAttribute | ( | LegendAttribute | attribute, |
| bool | on = true |
||
| ) |
Set legend attribute.
| void QwtPlotCurve::setLegendAttributes | ( | LegendAttributes | attributes | ) |
Set legend attributes.
| void QwtPlotCurve::setPaintAttribute | ( | PaintAttribute | attribute, |
| bool | on = true |
||
| ) |
Set paint attribute.
| void QwtPlotCurve::setPen | ( | const QColor & | color, |
| qreal | width = 0.0, |
||
| Qt::PenStyle | style = Qt::SolidLine |
||
| ) |
Build and assign a pen.
| void QwtPlotCurve::setPen | ( | const QPen & | pen | ) |
Assign a pen.
| void QwtPlotCurve::setRawSamples | ( | const double * | xData, |
| const double * | yData, | ||
| int | size | ||
| ) |
Initialize data by pointing to memory blocks not managed by QwtPlotCurve (double)
| void QwtPlotCurve::setRawSamples | ( | const double * | yData, |
| int | size | ||
| ) |
Initialize data by pointing to a memory block not managed by QwtPlotCurve (double, y-axis only)
| void QwtPlotCurve::setRawSamples | ( | const float * | xData, |
| const float * | yData, | ||
| int | size | ||
| ) |
Initialize data by pointing to memory blocks not managed by QwtPlotCurve (float)
| void QwtPlotCurve::setRawSamples | ( | const float * | yData, |
| int | size | ||
| ) |
Initialize data by pointing to a memory block not managed by QwtPlotCurve (float, y-axis only)
| void QwtPlotCurve::setSamples | ( | const double * | xData, |
| const double * | yData, | ||
| int | size | ||
| ) |
Set data by copying x- and y-values from specified memory blocks (double)
| void QwtPlotCurve::setSamples | ( | const double * | yData, |
| int | size | ||
| ) |
Set data by copying y-values from a specified memory block (double)
| void QwtPlotCurve::setSamples | ( | const float * | xData, |
| const float * | yData, | ||
| int | size | ||
| ) |
Set data by copying x- and y-values from specified memory blocks (float)
| void QwtPlotCurve::setSamples | ( | const float * | yData, |
| int | size | ||
| ) |
Set data by copying y-values from a specified memory block (float)
Initialize data with x- and y-arrays (explicitly shared, double)
| void QwtPlotCurve::setSamples | ( | const QVector< double > & | yData | ) |
Initialize data with an array of y values (explicitly shared, double)
Initialize data with x- and y-arrays (explicitly shared, float)
| void QwtPlotCurve::setSamples | ( | const QVector< float > & | yData | ) |
Initialize data with an array of y values (explicitly shared, float)
| void QwtPlotCurve::setSamples | ( | const QVector< QPointF > & | samples | ) |
Initialize data with an array of points.
Initialize data with x- and y-arrays (rvalue, double)
Initialize data with x- and y-arrays (rvalue, float)
| void QwtPlotCurve::setSamples | ( | QVector< QPointF > && | samples | ) |
Initialize data with an array of points (rvalue)
| void QwtPlotCurve::setSamples | ( | QwtSeriesData< QPointF > * | data | ) |
Assign a series of points.
| void QwtPlotCurve::setStyle | ( | CurveStyle | style | ) |
Set the curve's drawing style.
| void QwtPlotCurve::setSymbol | ( | QwtSymbol * | symbol | ) |
Assign a symbol.
| QwtPlotCurve::CurveStyle QwtPlotCurve::style | ( | ) | const |
Get the curve's drawing style.
| const QwtSymbol * QwtPlotCurve::symbol | ( | ) | const |
Get the current symbol.
| bool QwtPlotCurve::testCurveAttribute | ( | CurveAttribute | attribute | ) | const |
Test curve attribute.
| bool QwtPlotCurve::testLegendAttribute | ( | LegendAttribute | attribute | ) | const |
Test legend attribute.
| bool QwtPlotCurve::testPaintAttribute | ( | PaintAttribute | attribute | ) | const |
Test paint attribute.