26 #ifndef QCP_PLOTTABLE_CURVE_H
27 #define QCP_PLOTTABLE_CURVE_H
29 #include "../global.h"
31 #include "../plottable.h"
32 #include "../painter.h"
55 typedef QMapIterator<double, QCPCurveData> QCPCurveDataMapIterator;
56 typedef QMutableMapIterator<double, QCPCurveData> QCPCurveDataMutableMapIterator;
63 Q_PROPERTY(
QCPScatterStyle scatterStyle READ scatterStyle WRITE setScatterStyle)
64 Q_PROPERTY(
LineStyle lineStyle READ lineStyle WRITE setLineStyle)
81 LineStyle lineStyle()
const {
return mLineStyle; }
85 void setData(
const QVector<double> &t,
const QVector<double> &key,
const QVector<double> &value);
86 void setData(
const QVector<double> &key,
const QVector<double> &value);
88 void setLineStyle(LineStyle style);
93 void addData(
double t,
double key,
double value);
94 void addData(
double key,
double value);
95 void addData(
const QVector<double> &ts,
const QVector<double> &keys,
const QVector<double> &values);
96 void removeDataBefore(
double t);
97 void removeDataAfter(
double t);
98 void removeData(
double fromt,
double tot);
99 void removeData(
double t);
103 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
109 LineStyle mLineStyle;
118 virtual void drawScatterPlot(
QCPPainter *painter,
const QVector<QPointF> *pointData)
const;
121 void getCurveData(QVector<QPointF> *lineData)
const;
122 int getRegion(
double x,
double y,
double rectLeft,
double rectTop,
double rectRight,
double rectBottom)
const;
123 QPointF getOptimizedPoint(
int prevRegion,
double prevKey,
double prevValue,
double key,
double value,
double rectLeft,
double rectTop,
double rectRight,
double rectBottom)
const;
124 QVector<QPointF> getOptimizedCornerPoints(
int prevRegion,
int currentRegion,
double prevKey,
double prevValue,
double key,
double value,
double rectLeft,
double rectTop,
double rectRight,
double rectBottom)
const;
125 bool mayTraverse(
int prevRegion,
int currentRegion)
const;
126 bool getTraverse(
double prevKey,
double prevValue,
double key,
double value,
double rectLeft,
double rectTop,
double rectRight,
double rectBottom, QPointF &crossA, QPointF &crossB)
const;
127 void getTraverseCornerPoints(
int prevRegion,
int currentRegion,
double rectLeft,
double rectTop,
double rectRight,
double rectBottom, QVector<QPointF> &beforeTraverse, QVector<QPointF> &afterTraverse)
const;
128 double pointDistance(
const QPointF &pixelPoint)
const;
134 #endif // QCP_PLOTTABLE_CURVE_H
virtual QCPRange getValueRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const =0
Represents the range an axis is encompassing.
Definition: range.h:31
Holds the data of one single data point for QCPCurve.
Definition: plottable-curve.h:37
Represents the visual appearance of scatter points.
Definition: painter.h:33
virtual QCPRange getKeyRange(bool &foundRange, SignDomain inSignDomain=sdBoth) const =0
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const =0
The central class of the library. This is the QWidget which displays the plot and interacts with the ...
Definition: core.h:42
virtual void draw(QCPPainter *painter)=0
Manages a legend inside a QCustomPlot.
Definition: layoutelement-legend.h:126
QPainter subclass used internally.
Definition: painter.h:111
A plottable representing a parametric curve in a plot.
Definition: plottable-curve.h:59
Manages a single axis inside a QCustomPlot.
Definition: axis.h:94
The abstract base class for all data representing objects in a plot.
Definition: plottable.h:36
QMap< double, QCPCurveData > QCPCurveDataMap
Definition: plottable-curve.h:54
virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const =0
LineStyle
Definition: plottable-curve.h:72
virtual void clearData()=0