|
rock_widget_collection
0.1
|
A plottable representing a parametric curve in a plot. More...
#include <qcustomplot.h>
Inherits QCPAbstractPlottable.
Public Member Functions | |
| QCPCurve (QCPAxis *keyAxis, QCPAxis *valueAxis) | |
| virtual | ~QCPCurve () |
| const QCPCurveDataMap * | data () const |
| void | setData (QCPCurveDataMap *data, bool copy=false) |
| void | setData (const QVector< double > &t, const QVector< double > &key, const QVector< double > &value) |
| void | setData (const QVector< double > &key, const QVector< double > &value) |
| void | addData (const QCPCurveDataMap &dataMap) |
| void | addData (const QCPCurveData &data) |
| void | addData (double t, double key, double value) |
| void | addData (double key, double value) |
| void | addData (const QVector< double > &ts, const QVector< double > &keys, const QVector< double > &values) |
| void | removeDataBefore (double t) |
| void | removeDataAfter (double t) |
| void | removeData (double fromt, double tot) |
| void | removeData (double t) |
| virtual void | clearData () |
Public Member Functions inherited from QCPAbstractPlottable | |
| QCPAbstractPlottable (QCPAxis *keyAxis, QCPAxis *valueAxis) | |
| virtual | ~QCPAbstractPlottable () |
Protected Member Functions | |
| virtual void | draw (QPainter *painter) const |
| virtual void | drawLegendIcon (QPainter *painter, const QRect &rect) const |
| void | getCurveData (QVector< QPointF > *lineData) const |
| QPointF | outsideCoordsToPixels (double key, double value, int region) const |
| virtual QCPRange | getKeyRange (bool &validRange, SignDomain inSignDomain=SDBoth) const |
| virtual QCPRange | getValueRange (bool &validRange, SignDomain inSignDomain=SDBoth) const |
Protected Member Functions inherited from QCPAbstractPlottable | |
| void | coordsToPixels (double key, double value, double &x, double &y) const |
| const QPointF | coordsToPixels (double key, double value) const |
Protected Attributes | |
| QCPCurveDataMap * | mData |
Protected Attributes inherited from QCPAbstractPlottable | |
| QCustomPlot * | mParentPlot |
| QString | mName |
| bool | mVisible |
| QPen | mPen |
| QBrush | mBrush |
| QCPAxis * | mKeyAxis |
| QCPAxis * | mValueAxis |
Friends | |
| class | QCustomPlot |
| class | QCPLegend |
Additional Inherited Members | |
Public Slots inherited from QCPAbstractPlottable | |
| QCustomPlot * | parentPlot () const |
| QString | name () const |
| bool | visible () const |
| QPen | pen () const |
| QBrush | brush () const |
| QCPAxis * | keyAxis () const |
| QCPAxis * | valueAxis () const |
| void | setName (const QString &name) |
| void | setVisible (bool visible) |
| void | setPen (const QPen &pen) |
| void | setBrush (const QBrush &brush) |
| void | setKeyAxis (QCPAxis *axis) |
| void | setValueAxis (QCPAxis *axis) |
| void | rescaleAxes (bool onlyEnlarge=false) const |
| void | rescaleKeyAxis (bool onlyEnlarge=false) const |
| void | rescaleValueAxis (bool onlyEnlarge=false) const |
| virtual bool | addToLegend () const |
| virtual bool | removeFromLegend () const |
Protected Types inherited from QCPAbstractPlottable | |
| enum | SignDomain { SDNegative, SDBoth, SDPositive } |
A plottable representing a parametric curve in a plot.
To plot data, assign it with the setData or addData functions.
The appearance of the curve is determined by the pen and the brush (setPen, setBrush).
Like all data representing objects in QCustomPlot, the QCPCurve is a plottable (QCPAbstractPlottable). So the plottable-interface of QCustomPlot applies (QCustomPlot::plottable, QCustomPlot::addPlottable, QCustomPlot::removePlottable, etc.)
Usually, you first create an instance:
add it to the customPlot with QCustomPlot::addPlottable:
and then modify the properties of the newly created plottable, e.g.:
Definition at line 330 of file qcustomplot.h.
Constructs a curve which uses keyAxis as its key axis ("x") and valueAxis as its value axis ("y"). keyAxis and valueAxis must both reside in the same QCustomPlot.
The constructed QCPCurve can be added to the plot with QCustomPlot::addPlottable, QCustomPlot then takes ownership of the graph.
Definition at line 6560 of file qcustomplot.cc.
|
virtual |
Definition at line 6570 of file qcustomplot.cc.
| void QCPCurve::addData | ( | const QCPCurveDataMap & | dataMap | ) |
Adds the provided data points in dataMap to the current data.
Definition at line 6640 of file qcustomplot.cc.
| void QCPCurve::addData | ( | const QCPCurveData & | data | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Adds the provided single data point in data to the current data.
Definition at line 6649 of file qcustomplot.cc.
| void QCPCurve::addData | ( | double | t, |
| double | key, | ||
| double | value | ||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Adds the provided single data point as t, key and value tuple to the current data
Definition at line 6658 of file qcustomplot.cc.
| void QCPCurve::addData | ( | double | key, |
| double | value | ||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Adds the provided single data point as key and value pair to the current data The t parameter of the data point is set to the t of the last data point plus 1. If there is no last data point, t will be set to 0.
Definition at line 6675 of file qcustomplot.cc.
| void QCPCurve::addData | ( | const QVector< double > & | ts, |
| const QVector< double > & | keys, | ||
| const QVector< double > & | values | ||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Adds the provided data points as t, key and value tuples to the current data.
Definition at line 6691 of file qcustomplot.cc.
|
virtual |
Removes all data points.
Implements QCPAbstractPlottable.
Definition at line 6763 of file qcustomplot.cc.
|
inline |
Definition at line 338 of file qcustomplot.h.
|
protectedvirtual |
Implements QCPAbstractPlottable.
Definition at line 6769 of file qcustomplot.cc.
|
protectedvirtual |
Implements QCPAbstractPlottable.
Definition at line 6800 of file qcustomplot.cc.
|
protected |
Definition at line 6819 of file qcustomplot.cc.
|
protectedvirtual |
Implements QCPAbstractPlottable.
Definition at line 6960 of file qcustomplot.cc.
|
protectedvirtual |
Implements QCPAbstractPlottable.
Definition at line 6993 of file qcustomplot.cc.
|
protected |
Definition at line 6936 of file qcustomplot.cc.
| void QCPCurve::removeData | ( | double | fromt, |
| double | tot | ||
| ) |
Removes all data points with curve parameter t between fromt and tot. if fromt is greater or equal to tot, the function does nothing. To remove a single data point with known t, use removeData(double t).
Definition at line 6736 of file qcustomplot.cc.
| void QCPCurve::removeData | ( | double | t | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Removes a single data point at curve parameter t. If the position is not known with absolute precision, consider using removeData(double fromt, double tot) with a small fuzziness interval around the suspected position, depeding on the precision with which the curve parameter is known.
Definition at line 6754 of file qcustomplot.cc.
| void QCPCurve::removeDataAfter | ( | double | t | ) |
Removes all data points with curve parameter t greater than t.
Definition at line 6721 of file qcustomplot.cc.
| void QCPCurve::removeDataBefore | ( | double | t | ) |
Removes all data points with curve parameter t smaller than t.
Definition at line 6710 of file qcustomplot.cc.
| void QCPCurve::setData | ( | QCPCurveDataMap * | data, |
| bool | copy = false |
||
| ) |
Replaces the current data with the provided data.
If copy is set to true, data points in data will only be copied. if false, the plottable takes ownership of the passed data and replaces the internal data pointer with it. This is significantly faster than copying for large datasets.
Definition at line 6582 of file qcustomplot.cc.
| void QCPCurve::setData | ( | const QVector< double > & | t, |
| const QVector< double > & | key, | ||
| const QVector< double > & | value | ||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Replaces the current data with the provided points in t, key and value tuples. The provided vectors should have equal length. Else, the number of added points will be the size of the smallest vector.
Definition at line 6600 of file qcustomplot.cc.
| void QCPCurve::setData | ( | const QVector< double > & | key, |
| const QVector< double > & | value | ||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Replaces the current data with the provided key and value pairs. The t parameter of each data point will be set to the integer index of the respective key/value pair.
Definition at line 6621 of file qcustomplot.cc.
|
friend |
Definition at line 369 of file qcustomplot.h.
|
friend |
Definition at line 368 of file qcustomplot.h.
|
protected |
Definition at line 358 of file qcustomplot.h.
1.8.13