QwtPlotCurve(3) | Qwt User's Guide | QwtPlotCurve(3) |
QwtPlotCurve - A plot item, that represents a series of points.
#include <qwt_plot_curve.h>
Inherits QwtPlotSeriesItem, and QwtSeriesStore< QPointF >.
enum CurveStyle { NoCurve = -1, Lines,
Sticks, Steps, Dots, UserCurve = 100 }
enum CurveAttribute { Inverted = 0x01, Fitted = 0x02 }
enum LegendAttribute { LegendNoAttribute = 0x00,
LegendShowLine = 0x01, LegendShowSymbol = 0x02,
LegendShowBrush = 0x04 }
enum PaintAttribute { ClipPolygons = 0x01, FilterPoints =
0x02, MinimizeMemory = 0x04, ImageBuffer = 0x08 }
typedef QFlags< CurveAttribute > CurveAttributes
Curve attributes. typedef QFlags< LegendAttribute >
LegendAttributes
Legend attributes. typedef QFlags< PaintAttribute >
PaintAttributes
Paint attributes.
QwtPlotCurve (const QString &title=QString())
QwtPlotCurve (const QwtText &title)
virtual ~QwtPlotCurve ()
Destructor. virtual int rtti () const
void setPaintAttribute (PaintAttribute, bool on=true)
bool testPaintAttribute (PaintAttribute) const
void setLegendAttribute (LegendAttribute, bool on=true)
bool testLegendAttribute (LegendAttribute) const
void setRawSamples (const double *xData, const double *yData, int size)
Initialize the data by pointing to memory blocks which are not managed by
QwtPlotCurve. void setSamples (const double *xData, const
double *yData, int size)
void setSamples (const QVector< double > &xData, const
QVector< double > &yData)
Initialize data with x- and y-arrays (explicitly shared) void
setSamples (const QVector< QPointF > &)
void setSamples (QwtSeriesData< QPointF > *)
int closestPoint (const QPoint &pos, double *dist=NULL) const
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)
bool testCurveAttribute (CurveAttribute) const
void setPen (const QColor &, qreal width=0.0,
Qt::PenStyle=Qt::SolidLine)
void setPen (const QPen &)
const QPen & pen () const
void setBrush (const QBrush &)
Assign a brush. const QBrush & brush () const
void setBaseline (double)
Set the value of the baseline. double baseline () const
void setStyle (CurveStyle style)
CurveStyle style () const
void setSymbol (QwtSymbol *)
Assign a symbol. const QwtSymbol * symbol () const
void setCurveFitter (QwtCurveFitter *)
QwtCurveFitter * curveFitter () const
virtual void drawSeries (QPainter *, const QwtScaleMap
&xMap, const QwtScaleMap &yMap, const QRectF &canvasRect,
int from, int to) const
virtual QwtGraphic legendIcon (int index, const QSizeF &)
const
void init ()
Initialize internal members. 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. virtual void
drawSymbols (QPainter *, const QwtSymbol &, const
QwtScaleMap &xMap, const QwtScaleMap &yMap, const
QRectF &canvasRect, int from, int to) const
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
virtual void drawDots (QPainter *, const QwtScaleMap &xMap,
const QwtScaleMap &yMap, const QRectF &canvasRect, int from,
int to) const
virtual void drawSteps (QPainter *, const QwtScaleMap &xMap,
const QwtScaleMap &yMap, const QRectF &canvasRect, int from,
int to) const
virtual void fillCurve (QPainter *, const QwtScaleMap &,
const QwtScaleMap &, const QRectF &canvasRect, QPolygonF
&) const
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 baseline.
A plot item, that represents a series of points.
A curve is the representation of a series of points in the x-y plane. It supports different display styles, interpolation ( f.e. spline ) and symbols.
Usage
Example:
See also:
Attribute for drawing the curve
See also:
Enumerator
Note:
Curve styles.
See also:
Enumerator
Attributes how to represent the curve on the legend
See also:
Enumerator
Attributes to modify the drawing algorithm. The default setting enables ClipPolygons | FilterPoints
See also:
Enumerator
Constructor
Parameters:
Constructor
Parameters:
Returns:
See also:
Returns:
See also:
Complete a polygon to be a closed polygon including the area between the original polygon and the baseline.
Parameters:
Find the closest curve point for a specific position
Parameters:
Returns:
Note:
Get the curve fitter. If curve fitting is disabled NULL is returned.
Returns:
See also:
Draw the line part (without symbols) of a curve interval.
Parameters:
See also:
Draw dots
Parameters:
See also:
Draw lines. If the CurveAttribute Fitted is enabled a QwtCurveFitter tries to interpolate/smooth the curve, before it is painted.
Parameters:
See also:
Draw an interval of the curve
Parameters:
See also:
Implements QwtPlotSeriesItem.
Draw step function
The direction of the steps depends on Inverted attribute.
Parameters:
See also:
Draw sticks
Parameters:
See also:
Draw symbols
Parameters:
See also:
Fill the area between the curve and the baseline with the curve brush
Parameters:
See also:
Returns:
Parameters:
See also:
Reimplemented from QwtPlotItem.
Returns:
See also:
Returns:
Reimplemented from QwtPlotItem.
Set the value of the baseline. The baseline is needed for filling the curve with a brush or the Sticks drawing style.
The interpretation of the baseline depends on the orientation(). With Qt::Horizontal, the baseline is interpreted as a horizontal line at y = baseline(), with Qt::Vertical, it is interpreted as a vertical line at x = baseline().
The default value is 0.0.
Parameters:
See also:
Assign a brush. In case of brush.style() != QBrush::NoBrush and style() != QwtPlotCurve::Sticks the area between the curve and the baseline will be filled.
In case !brush.color().isValid() the area will be filled by pen.color(). The fill algorithm simply connects the first and the last curve point to the baseline. So the curve data has to be sorted (ascending or descending).
Parameters:
See also:
Specify an attribute for drawing the curve
Parameters:
/sa testCurveAttribute(), setCurveFitter()
Assign a curve fitter
The curve fitter 'smooths' the curve points, when the Fitted CurveAttribute is set. setCurveFitter(NULL) also disables curve fitting.
The curve fitter operates on the translated points ( = widget coordinates) to be functional for logarithmic scales. Obviously this is less performant for fitting algorithms, that reduce the number of points.
For situations, where curve fitting is used to improve the performance of painting huge series of points it might be better to execute the fitter on the curve points once and to cache the result in the QwtSeriesData object.
Parameters:
See also:
Specify an attribute how to draw the legend icon
Parameters:
Specify an attribute how to draw the curve
Parameters:
See also:
Build and assign a pen
In Qt5 the default pen width is 1.0 ( 0.0 in Qt4 ) what makes it non cosmetic ( see QPen::isCosmetic() ). This method has been introduced to hide this incompatibility.
Parameters:
See also:
Assign a pen
Parameters:
See also:
Initialize the data by pointing to memory blocks which are not managed by QwtPlotCurve. setRawSamples is provided for efficiency. It is important to keep the pointers during the lifetime of the underlying QwtCPointerData class.
Parameters:
See also:
Set data by copying x- and y-values from specified memory blocks. Contrary to setRawSamples(), this function makes a 'deep copy' of the data.
Parameters:
See also:
Initialize data with x- and y-arrays (explicitly shared)
Parameters:
See also:
Initialize data with an array of points.
Parameters:
Note:
QPolygonF is derived from QVector<QPointF>
Assign a series of points
setSamples() is just a wrapper for setData() without any additional value - beside that it is easier to find for the developer.
Parameters:
Warning:
Set the curve's drawing style
Parameters:
See also:
Assign a symbol. The curve will take the ownership of the symbol, hence the previously set symbol will be delete by setting a new one. If symbol is NULL no symbol will be drawn.
Parameters:
See also:
Returns:
See also:
Returns:
See also:
Returns:
See also:
Returns:
See also:
Returns:
See also:
Generated automatically by Doxygen for Qwt User's Guide from the source code.
Wed Jan 2 2019 | Version 6.1.4 |