-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathplottable-curve.sip
92 lines (76 loc) · 2.95 KB
/
plottable-curve.sip
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/** PyQt5 binding for QCustomPlot v2.0.0
*
* Authors: Dmitry Voronin, Giuseppe Corbelli
* License: MIT
*
* QCustomPlot author: Emanuel Eichhammer
* QCustomPlot Website/Contact: http://www.qcustomplot.com
*/
class QCPCurveData
{
%TypeHeaderCode
#include <QCustomPlot/src/plottables/plottable-curve.h>
%End
public:
QCPCurveData();
QCPCurveData(double t, double key, double value);
double sortKey() const;
static QCPCurveData fromSortKey(double sortKey);
static bool sortKeyIsMainKey();
double mainKey() const;
double mainValue() const;
QCPRange valueRange() const;
double t;
double key;
double value;
};
typedef QCPAbstractPlottable1D<QCPCurveData> QCPAbstractPlottable1D_QCPCurveData;
class QCPCurve : public QCPAbstractPlottable1D_QCPCurveData
{
%TypeHeaderCode
#include <QCustomPlot/src/qcp.h>
typedef QCPAbstractPlottable1D<QCPCurveData> QCPAbstractPlottable1D_QCPCurveData;
%End
public:
enum LineStyle { lsNone ///< No line is drawn between data points (e.g. only scatters)
,lsLine ///< Data points are connected with a straight line
};
// Ownership acquired by QCustomPlot tied to the axis
explicit QCPCurve(QCPAxis *keyAxis, QCPAxis *valueAxis) /Transfer/;
virtual ~QCPCurve();
// getters:
// TODO: provide methodcode
// QSharedPointer<QCPCurveDataContainer> data() const { return mDataContainer; }
QCPScatterStyle scatterStyle() const;
int scatterSkip() const;
LineStyle lineStyle() const;
// setters:
// TODO: provide methodcode
// void setData(QSharedPointer<QCPCurveDataContainer> data);
void setData(const QVector<double> &t, const QVector<double> &keys, const QVector<double> &values, bool alreadySorted=false);
void setData(const QVector<double> &keys, const QVector<double> &values);
void setScatterStyle(const QCPScatterStyle &style);
void setScatterSkip(int skip);
void setLineStyle(LineStyle style);
// non-property methods:
void addData(const QVector<double> &t, const QVector<double> &keys, const QVector<double> &values, bool alreadySorted=false);
void addData(const QVector<double> &keys, const QVector<double> &values);
void addData(double t, double key, double value);
void addData(double key, double value);
// reimplemented virtual methods:
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const;
virtual QCPRange getKeyRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth) const;
virtual QCPRange getValueRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange()) const;
//! This is not in QCustomPlot, but I found it handy
Q_SLOT void setSelected(bool selected);
%MethodCode
Py_BEGIN_ALLOW_THREADS
QCPDataSelection current_selection = sipCpp->selection();
if (a0)
current_selection += sipCpp->data()->dataRange();
else
current_selection.clear();
sipCpp->setSelection(current_selection);
Py_END_ALLOW_THREADS
%End
};