#include <qwt_curve.h>
Inheritance diagram for QwtCurve:

Public Types | |
| enum | CurveStyle { NoCurve, Lines, Sticks, Steps, Dots, Spline, UserCurve = 100 } |
| enum | CurveOption { Auto = 0, Yfx = 1, Xfy = 2, Parametric = 4, Periodic = 8, Inverted = 16 } |
Public Member Functions | |
| QwtCurve (const QString &title=QString::null) | |
| QwtCurve (const QwtCurve &c) | |
| virtual | ~QwtCurve () |
| const QwtCurve & | operator= (const QwtCurve &c) |
| void | setRawData (const double *x, const double *y, int size) |
| void | setData (const double *x, const double *y, int size) |
| int | dataSize () const |
| double | x (int i) const |
| double | y (int i) const |
| virtual double | minXValue () const |
| virtual double | maxXValue () const |
| virtual double | minYValue () const |
| virtual double | maxYValue () const |
| void | setOptions (int t) |
| int | options () const |
| void | setTitle (const QString &title) |
| const QString & | title () const |
| void | setPen (const QPen &) |
| const QPen & | pen () const |
| void | setBrush (const QBrush &) |
| const QBrush & | brush () const |
| void | setBaseline (double ref) |
| double | baseline () const |
| void | setStyle (int style, int options=0) |
| int | style () const |
| void | setSymbol (const QwtSymbol &s) |
| const QwtSymbol & | symbol () const |
| void | setSplineSize (int s) |
| int | splineSize () const |
| virtual void | draw (QPainter *p, const QwtDiMap &xMap, const QwtDiMap &yMap, int from=0, int to=-1) |
Protected Member Functions | |
| void | init (const QString &title) |
| void | copy (const QwtCurve &c) |
| virtual void | drawCurve (QPainter *p, int style, const QwtDiMap &xMap, const QwtDiMap &yMap, int from, int to) |
| virtual void | drawSymbols (QPainter *p, QwtSymbol &, const QwtDiMap &xMap, const QwtDiMap &yMap, int from, int to) |
| void | drawLines (QPainter *p, const QwtDiMap &xMap, const QwtDiMap &yMap, int from, int to) |
| void | drawSticks (QPainter *p, const QwtDiMap &xMap, const QwtDiMap &yMap, int from, int to) |
| void | drawDots (QPainter *p, const QwtDiMap &xMap, const QwtDiMap &yMap, int from, int to) |
| void | drawSteps (QPainter *p, const QwtDiMap &xMap, const QwtDiMap &yMap, int from, int to) |
| void | drawSpline (QPainter *p, const QwtDiMap &xMap, const QwtDiMap &yMap) |
| void | closePolyline (const QwtDiMap &, const QwtDiMap &, QPointArray &) const |
| virtual void | curveChanged () |
| int | verifyRange (int &i1, int &i2) |
| virtual void | updateRangeCache () |
Protected Attributes | |
| bool | d_raw |
| QwtArray< double > | d_x |
| QwtArray< double > | d_y |
| QwtSpline | d_spx |
| QwtSpline | d_spy |
Private Attributes | |
| int | d_style |
| double | d_ref |
| QwtSymbol | d_sym |
| QPen | d_pen |
| QBrush | d_brush |
| QString | d_title |
| int | d_options |
| int | d_splineSize |
| struct { | |
| bool isDirty | |
| double minXValue | |
| double maxXValue | |
| double minYValue | |
| double maxYValue | |
| } | d_rangeCache |
This class can be used to display data as a curve in the x-y plane. It supports different display styles, spline interpolation and symbols.
Definition at line 59 of file qwt_curve.h.
|
|
Curve options.
Definition at line 81 of file qwt_curve.h. |
|
|
Curve styles.
Definition at line 66 of file qwt_curve.h. |
|
|
Ctor.
Definition at line 336 of file qwt_curve.cpp. References init(). |
|
|
Copy Constructor.
Definition at line 76 of file qwt_curve.cpp. |
|
|
Dtor.
Definition at line 60 of file qwt_curve.cpp. |
|
|
Return the value of the baseline.
Definition at line 912 of file qwt_curve.cpp. References d_ref. Referenced by QwtPlot::curveBaseline(). |
|
|
Return the brush used to fill the area between lines and the baseline.
Definition at line 212 of file qwt_curve.cpp. References d_brush. Referenced by QwtPlot::curveBrush(). |
|
||||||||||||||||
|
Complete a polygon to be a closed polygon including the area between the original polygon and the baseline.
Definition at line 843 of file qwt_curve.cpp. References d_options, d_ref, QwtDiMap::transform(), and Xfy. Referenced by drawDots(), drawLines(), drawSpline(), and drawSteps(). |
|
|
Copy the contents of a curve into another curve.
Definition at line 34 of file qwt_curve.cpp. References d_options, d_pen, d_rangeCache, d_raw, d_ref, d_splineSize, d_style, d_sym, d_title, d_x, and d_y. Referenced by operator=(), and QwtCurve(). |
|
|
Notify a change of attributes. This virtual function is called when an attribute of the curve has changed. It can be redefined by derived classes. The default implementation does nothing.
Reimplemented in QwtPlotCurve. Definition at line 975 of file qwt_curve.cpp. Referenced by operator=(), setBaseline(), setBrush(), setData(), setOptions(), setPen(), setRawData(), setSplineSize(), setStyle(), setSymbol(), and setTitle(). |
|
|
Return the size of the data arrays Definition at line 920 of file qwt_curve.cpp. References d_x, d_y, and qwtMin. Referenced by QwtPlot::closestCurve(), draw(), drawCurve(), drawSpline(), QwtPlot::updateAxes(), and verifyRange(). |
|
||||||||||||||||||||||||
|
Draw an intervall of the curve.
Definition at line 370 of file qwt_curve.cpp. References d_brush, d_pen, d_style, d_sym, dataSize(), drawCurve(), drawSymbols(), QwtSymbol::None, QwtSymbol::style(), and verifyRange(). Referenced by QwtPlot::drawCanvasItems(), and QwtPlot::drawCurve(). |
|
||||||||||||||||||||||||||||
|
Draw the line part (without symbols) of a curve interval.
Definition at line 414 of file qwt_curve.cpp. References dataSize(), Dots, drawDots(), drawLines(), drawSpline(), drawSteps(), drawSticks(), Lines, NoCurve, Spline, Steps, and Sticks. Referenced by draw(). |
|
||||||||||||||||||||||||
|
Draw dots.
Definition at line 514 of file qwt_curve.cpp. References closePolyline(), d_x, d_y, QwtPainter::drawPoint(), QwtPainter::drawPolygon(), QwtDiMap::transform(), x(), and y(). Referenced by drawCurve(). |
|
||||||||||||||||||||||||
|
Draw lines.
Definition at line 454 of file qwt_curve.cpp. References closePolyline(), d_x, d_y, QwtPainter::drawPolygon(), QwtPainter::drawPolyline(), QwtDiMap::transform(), x(), and y(). Referenced by drawCurve(), and drawSpline(). |
|
||||||||||||||||
|
Draw a spline.
Definition at line 595 of file qwt_curve.cpp. References closePolyline(), d_options, d_splineSize, d_spx, d_spy, d_x, d_y, dataSize(), drawLines(), QwtPainter::drawPolygon(), QwtPainter::drawPolyline(), Parametric, Periodic, qwtChkMono(), qwtGetMax(), qwtGetMin(), qwtMax, qwtSqr(), qwtTwistArray(), QwtSpline::recalc(), QwtSpline::value(), Xfy, QwtDiMap::xTransform(), and Yfx. Referenced by drawCurve(). |
|
||||||||||||||||||||||||
|
Draw step function.
Definition at line 551 of file qwt_curve.cpp. References closePolyline(), d_options, d_x, d_y, QwtPainter::drawPolygon(), QwtPainter::drawPolyline(), Inverted, QwtDiMap::transform(), x(), y(), and Yfx. Referenced by drawCurve(). |
|
||||||||||||||||||||||||
|
Draw sticks.
Definition at line 486 of file qwt_curve.cpp. References d_options, d_ref, d_x, d_y, QwtPainter::drawLine(), QwtDiMap::transform(), x(), Xfy, and y(). Referenced by drawCurve(). |
|
||||||||||||||||||||||||||||
|
Draw symbols.
Definition at line 877 of file qwt_curve.cpp. References d_x, d_y, QwtSymbol::draw(), and QwtDiMap::transform(). Referenced by draw(). |
|
|
Initialize data members.
Definition at line 19 of file qwt_curve.cpp. References Auto, d_options, d_pen, d_rangeCache, d_raw, d_ref, d_splineSize, d_style, d_title, and Lines. Referenced by QwtCurve(). |
|
|
Referenced by QwtPlot::updateAxes(). |
|
|
Referenced by QwtPlot::updateAxes(). |
|
|
Referenced by QwtPlot::updateAxes(). |
|
|
Referenced by QwtPlot::updateAxes(). |
|
|
Copy Assignment.
Definition at line 89 of file qwt_curve.cpp. References copy(), and curveChanged(). Referenced by QwtPlotCurve::operator=(). |
|
|
Return the current style options.
Definition at line 807 of file qwt_curve.cpp. References d_options. Referenced by QwtPlot::curveOptions(). |
|
|
Return the pen used to draw the lines.
Definition at line 181 of file qwt_curve.cpp. References d_pen. Referenced by QwtPlotPrintFilter::apply(), QwtPlot::curvePen(), QwtPlotPrintFilter::reset(), and QwtPlot::updateLegendItem(). |
|
|
Set the value of the baseline. The baseline is needed for filling the curve with a brush or the QwtCurve::Sticks drawing style. The default value is 0.0. The interpretation of the baseline depends on the style options. With QwtCurve::Yfx, the baseline is interpreted as a horizontal line at y = baseline(), with QwtCurve::Yfy, it is interpreted as a vertical line at x = baseline().
Definition at line 902 of file qwt_curve.cpp. References curveChanged(), and d_ref. Referenced by QwtPlot::setCurveBaseline(). |
|
|
Assign a brush. In case of brush.style() != QBrush::NoBrush and style() != QwtCurve::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).
Definition at line 198 of file qwt_curve.cpp. References curveChanged(), and d_brush. Referenced by QwtPlot::setCurveBrush(). |
|
||||||||||||||||
|
Copy x-y data from specified arrays.
Definition at line 224 of file qwt_curve.cpp. References curveChanged(), d_rangeCache, d_raw, d_x, and d_y. Referenced by QwtPlot::setCurveData(). |
|
|
Specify options for the drawing style. The options can be used to modify the drawing style. Options can be or-combined. The following options are defined:
Definition at line 797 of file qwt_curve.cpp. References curveChanged(), and d_options. Referenced by QwtPlot::setCurveOptions(). |
|
|
Assign a pen.
Definition at line 168 of file qwt_curve.cpp. References curveChanged(), and d_pen. Referenced by QwtPlotPrintFilter::apply(), QwtPlotPrintFilter::reset(), and QwtPlot::setCurvePen(). |
|
||||||||||||||||
|
Attach raw data. setRawData is provided for efficiency. In contrast to setData, it does not copy the data, so it is important to keep the pointers valid while they are attached. The QwtCurve destructor does not delete the attached data, so you can safely call setRawData and setData several times subsequently.
Definition at line 253 of file qwt_curve.cpp. References curveChanged(), d_rangeCache, d_raw, d_x, and d_y. Referenced by QwtPlot::setCurveRawData(). |
|
|
Change the number of interpolated points.
Definition at line 817 of file qwt_curve.cpp. References curveChanged(), d_splineSize, and qwtMax. Referenced by QwtPlot::setCurveSplineSize(). |
|
||||||||||||
|
Set the curve's drawing style. Valid styles are:
Definition at line 126 of file qwt_curve.cpp. References curveChanged(), d_options, and d_style. Referenced by QwtPlot::setCurveStyle(). |
|
|
Assign a symbol.
Definition at line 148 of file qwt_curve.cpp. References curveChanged(), and d_sym. Referenced by QwtPlotPrintFilter::apply(), QwtPlotPrintFilter::reset(), and QwtPlot::setCurveSymbol(). |
|
|
Assign a title to a curve.
Definition at line 273 of file qwt_curve.cpp. References curveChanged(), and d_title. Referenced by QwtPlot::insertCurve(), and QwtPlot::setCurveTitle(). |
|
|
Return the spline size.
Definition at line 829 of file qwt_curve.cpp. References d_splineSize. Referenced by QwtPlot::curveSplineSize(). |
|
|
Return the current style.
Definition at line 138 of file qwt_curve.cpp. References d_style. Referenced by QwtPlot::curveStyle(), and QwtPlot::updateLegendItem(). |
|
|
Return the current symbol.
Definition at line 158 of file qwt_curve.cpp. References d_sym. Referenced by QwtPlotPrintFilter::apply(), QwtPlot::curveSymbol(), QwtPlotPrintFilter::reset(), and QwtPlot::updateLegendItem(). |
|
|
Return the title.
Definition at line 283 of file qwt_curve.cpp. References d_title. Referenced by QwtPlot::curveTitle(), and QwtPlot::updateLegendItem(). |
|
|
Update the the min/max value cache. Definition at line 928 of file qwt_curve.cpp. References d_rangeCache, d_x, d_y, x(), and y(). |
|
||||||||||||
|
Checks if a range of indices is valid and corrects it if necessary.
Definition at line 346 of file qwt_curve.cpp. References dataSize(), qwtLim(), and qwtSort(). Referenced by draw(). |
|
|
Definition at line 208 of file qwt_curve.h. References d_x. Referenced by QwtPlot::closestCurve(), drawDots(), drawLines(), drawSteps(), drawSticks(), and updateRangeCache(). |
|
|
Definition at line 217 of file qwt_curve.h. References d_y. Referenced by QwtPlot::closestCurve(), drawDots(), drawLines(), drawSteps(), drawSticks(), and updateRangeCache(). |
|
|
Definition at line 188 of file qwt_curve.h. Referenced by brush(), draw(), and setBrush(). |
|
|
Definition at line 191 of file qwt_curve.h. Referenced by closePolyline(), copy(), drawSpline(), drawSteps(), drawSticks(), init(), options(), setOptions(), and setStyle(). |
|
|
Definition at line 187 of file qwt_curve.h. |
|
|
Referenced by copy(), init(), setData(), setRawData(), and updateRangeCache(). |
|
|
Definition at line 174 of file qwt_curve.h. Referenced by copy(), init(), setData(), setRawData(), and ~QwtCurve(). |
|
|
Definition at line 183 of file qwt_curve.h. Referenced by baseline(), closePolyline(), copy(), drawSticks(), init(), and setBaseline(). |
|
|
Definition at line 192 of file qwt_curve.h. Referenced by copy(), drawSpline(), init(), setSplineSize(), and splineSize(). |
|
|
Definition at line 178 of file qwt_curve.h. Referenced by drawSpline(). |
|
|
Definition at line 179 of file qwt_curve.h. Referenced by drawSpline(). |
|
|
Definition at line 182 of file qwt_curve.h. Referenced by copy(), draw(), init(), setStyle(), and style(). |
|
|
Definition at line 185 of file qwt_curve.h. Referenced by copy(), draw(), setSymbol(), and symbol(). |
|
|
Definition at line 189 of file qwt_curve.h. Referenced by copy(), init(), QwtCurve(), setTitle(), and title(). |
|
|
Definition at line 175 of file qwt_curve.h. Referenced by copy(), dataSize(), drawDots(), drawLines(), drawSpline(), drawSteps(), drawSticks(), drawSymbols(), setData(), setRawData(), updateRangeCache(), x(), and ~QwtCurve(). |
|
|
Definition at line 176 of file qwt_curve.h. Referenced by copy(), dataSize(), drawDots(), drawLines(), drawSpline(), drawSteps(), drawSticks(), drawSymbols(), setData(), setRawData(), updateRangeCache(), y(), and ~QwtCurve(). |
|
|
Definition at line 196 of file qwt_curve.h. |
|
|
find the largest x value
Definition at line 313 of file qwt_curve.cpp. |
|
|
find the largest y value
Definition at line 324 of file qwt_curve.cpp. |
|
|
find the smallest x value
Definition at line 291 of file qwt_curve.cpp. |
|
|
find the smallest y value
Definition at line 302 of file qwt_curve.cpp. |
1.3.2