Inheritance diagram for QwtCurve:
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.
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 *xData, const double *yData, int size) |
void | setData (const QwtArray< double > &xData, const QwtArray< double > &yData) |
void | setData (const QwtArray< QwtDoublePoint > &data) |
void | setData (const QwtData &data) |
int | dataSize () const |
double | x (int i) const |
double | y (int i) const |
virtual QwtDoubleRect | boundingRect () const |
double | minXValue () const |
double | maxXValue () const |
double | minYValue () const |
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) |
Protected Attributes | |
QwtSpline | d_spx |
QwtSpline | d_spy |
|
Curve options.
|
|
Curve styles.
|
|
Ctor.
|
|
Copy Constructor.
|
|
Dtor.
|
|
Return the value of the baseline.
|
|
Returns the bounding rectangle of the curve data. If there is no bounding rect, like for empty data the rectangle is invalid: QwtDoubleRect.isValid() == FALSE |
|
Return the brush used to fill the area between lines and the baseline.
|
|
Complete a polygon to be a closed polygon including the area between the original polygon and the baseline.
|
|
Copy the contents of a curve into another curve.
|
|
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. |
|
Return the size of the data arrays |
|
Draw an intervall of the curve.
|
|
Draw the line part (without symbols) of a curve interval.
|
|
Draw dots.
|
|
Draw lines.
|
|
Draw a spline.
|
|
Draw step function.
|
|
Draw sticks.
|
|
Draw symbols.
|
|
Initialize data members.
|
|
boundingRect().x2()
|
|
boundingRect().y2()
|
|
boundingRect().x1()
|
|
boundingRect().y1()
|
|
Copy Assignment.
|
|
Return the current style options.
|
|
Return the pen used to draw the lines.
|
|
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().
|
|
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).
|
|
Initialize data with a pointer to QwtData.
|
|
Initialize data with an array of points (explicitly shared).
|
|
Initialize data with x- and y-arrays (explicitly shared).
|
|
Set data by copying x- and y-values from specified memory blocks Contrary to QwtPlot::setCurveRawData, this function makes a 'deep copy' of the data.
|
|
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:
|
|
Assign a pen.
|
|
Initialize the data by pointing to memory blocks which are not managed by QwtCurve. setRawData is provided for efficiency. It is important to keep the pointers during the lifetime of the underlying QwtCPointerData class.
|
|
Change the number of interpolated points.
|
|
Set the curve's drawing style. Valid styles are:
|
|
Assign a symbol.
|
|
Assign a title to a curve.
|
|
Return the spline size.
|
|
Return the current style.
|
|
Return the current symbol.
|
|
Return the title.
|
|
Checks if a range of indices is valid and corrects it if necessary.
|
|
|
|
|