-
Notifications
You must be signed in to change notification settings - Fork 27
/
core.sip
165 lines (148 loc) · 7.69 KB
/
core.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
/** 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 QCustomPlot : public QWidget
{
%TypeHeaderCode
#include <QCustomPlot/src/qcp.h>
%End
public:
enum LayerInsertMode { limBelow ///< Layer is inserted below other layer
,limAbove ///< Layer is inserted above other layer
};
enum RefreshPriority { rpImmediateRefresh ///< Replots immediately and repaints the widget immediately by calling QWidget::repaint() after the replot
,rpQueuedRefresh ///< Replots immediately, but queues the widget repaint, by calling QWidget::update() after the replot. This way multiple redundant widget repaints can be avoided.
,rpRefreshHint ///< Whether to use immediate or queued refresh depends on whether the plotting hint \ref QCP::phImmediateRefresh is set, see \ref setPlottingHints.
,rpQueuedReplot ///< Queues the entire replot for the next event loop iteration. This way multiple redundant replots can be avoided. The actual replot is then done with \ref rpRefreshHint priority.
};
QCustomPlot(QWidget *parent /TransferThis/ = 0);
virtual ~QCustomPlot();
// getters:
QRect viewport() const;
double bufferDevicePixelRatio() const;
QPixmap background() const;
bool backgroundScaled() const;
Qt::AspectRatioMode backgroundScaledMode() const;
QCPLayoutGrid *plotLayout() const;
QCP::AntialiasedElements antialiasedElements() const;
QCP::AntialiasedElements notAntialiasedElements() const;
bool autoAddPlottableToLegend() const;
const QCP::Interactions interactions() const;
int selectionTolerance() const;
bool noAntialiasingOnDrag() const;
QCP::PlottingHints plottingHints() const;
Qt::KeyboardModifier multiSelectModifier() const;
QCP::SelectionRectMode selectionRectMode() const;
QCPSelectionRect *selectionRect() const;
bool openGl() const;
bool repaintAll() const;
// setters:
void setViewport(const QRect &rect);
void setBufferDevicePixelRatio(double ratio);
void setBackground(const QPixmap &pm);
void setBackground(const QPixmap &pm, bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding);
void setBackground(const QBrush &brush);
void setBackgroundScaled(bool scaled);
void setBackgroundScaledMode(Qt::AspectRatioMode mode);
void setAntialiasedElements(const QCP::AntialiasedElements &antialiasedElements);
void setAntialiasedElement(QCP::AntialiasedElement antialiasedElement, bool enabled=true);
void setNotAntialiasedElements(const QCP::AntialiasedElements ¬AntialiasedElements);
void setNotAntialiasedElement(QCP::AntialiasedElement notAntialiasedElement, bool enabled=true);
void setAutoAddPlottableToLegend(bool on);
void setInteractions(const QCP::Interactions &interactions);
void setInteraction(const QCP::Interaction &interaction, bool enabled=true);
void setSelectionTolerance(int pixels);
void setNoAntialiasingOnDrag(bool enabled);
void setPlottingHints(const QCP::PlottingHints &hints);
void setPlottingHint(QCP::PlottingHint hint, bool enabled=true);
void setMultiSelectModifier(Qt::KeyboardModifier modifier);
void setSelectionRectMode(QCP::SelectionRectMode mode);
void setSelectionRect(QCPSelectionRect *selectionRect);
void setOpenGl(bool enabled, int multisampling=16);
void setRepaintAll(bool repaint);
// non-property methods:
// plottable interface:
QCPAbstractPlottable *plottable(int index);
QCPAbstractPlottable *plottable();
bool removePlottable(QCPAbstractPlottable *plottable);
bool removePlottable(int index);
int clearPlottables();
int plottableCount() const;
QList<QCPAbstractPlottable*> selectedPlottables() const;
QCPAbstractPlottable *plottableAt(const QPointF &pos, bool onlySelectable=false) const;
bool hasPlottable(QCPAbstractPlottable *plottable) const;
// specialized interface for QCPGraph:
QCPGraph *graph(int index) const;
QCPGraph *graph() const;
QCPGraph *addGraph(QCPAxis *keyAxis=0, QCPAxis *valueAxis=0);
bool removeGraph(QCPGraph *graph);
bool removeGraph(int index);
int clearGraphs();
int graphCount() const;
QList<QCPGraph*> selectedGraphs() const;
// item interface:
QCPAbstractItem *item(int index) const;
QCPAbstractItem *item() const;
bool removeItem(QCPAbstractItem *item);
bool removeItem(int index);
int clearItems();
int itemCount() const;
QList<QCPAbstractItem*> selectedItems() const;
QCPAbstractItem *itemAt(const QPointF &pos, bool onlySelectable=false) const;
bool hasItem(QCPAbstractItem *item) const;
// layer interface:
QCPLayer *layer(const QString &name) const;
QCPLayer *layer(int index) const;
QCPLayer *currentLayer() const;
bool setCurrentLayer(const QString &name);
bool setCurrentLayer(QCPLayer *layer);
int layerCount() const;
bool addLayer(const QString &name, QCPLayer *otherLayer=0, LayerInsertMode insertMode=limAbove);
bool removeLayer(QCPLayer *layer);
bool moveLayer(QCPLayer *layer, QCPLayer *otherLayer, LayerInsertMode insertMode=limAbove);
// axis rect/layout interface:
int axisRectCount() const;
QCPAxisRect* axisRect(int index=0) const;
QList<QCPAxisRect*> axisRects() const;
QCPLayoutElement* layoutElementAt(const QPointF &pos) const;
QCPAxisRect* axisRectAt(const QPointF &pos) const;
Q_SLOT void rescaleAxes(bool onlyVisiblePlottables=false);
QList<QCPAxis*> selectedAxes() const;
QList<QCPLegend*> selectedLegends() const;
Q_SLOT void deselectAll();
bool savePdf(const QString &fileName, int width=0, int height=0, QCP::ExportPen exportPen=QCP::epAllowCosmetic, const QString &pdfCreator=QString(), const QString &pdfTitle=QString());
bool savePng(const QString &fileName, int width=0, int height=0, double scale=1.0, int quality=-1, int resolution=96, QCP::ResolutionUnit resolutionUnit=QCP::ruDotsPerInch);
bool saveJpg(const QString &fileName, int width=0, int height=0, double scale=1.0, int quality=-1, int resolution=96, QCP::ResolutionUnit resolutionUnit=QCP::ruDotsPerInch);
bool saveBmp(const QString &fileName, int width=0, int height=0, double scale=1.0, int resolution=96, QCP::ResolutionUnit resolutionUnit=QCP::ruDotsPerInch);
bool saveRastered(const QString &fileName, int width, int height, double scale, const char *format, int quality=-1, int resolution=96, QCP::ResolutionUnit resolutionUnit=QCP::ruDotsPerInch);
QPixmap toPixmap(int width=0, int height=0, double scale=1.0);
void toPainter(QCPPainter *painter, int width=0, int height=0);
Q_SLOT void replot(QCustomPlot::RefreshPriority refreshPriority=QCustomPlot::rpRefreshHint);
QCPAxis *xAxis;
QCPAxis *yAxis;
QCPAxis *xAxis2;
QCPAxis *yAxis2;
QCPLegend *legend;
signals:
void mouseDoubleClick(QMouseEvent *event);
void mousePress(QMouseEvent *event);
void mouseMove(QMouseEvent *event);
void mouseRelease(QMouseEvent *event);
void mouseWheel(QWheelEvent *event);
void plottableClick(QCPAbstractPlottable *plottable, int dataIndex, QMouseEvent *event);
void plottableDoubleClick(QCPAbstractPlottable *plottable, int dataIndex, QMouseEvent *event);
void itemClick(QCPAbstractItem *item, QMouseEvent *event);
void itemDoubleClick(QCPAbstractItem *item, QMouseEvent *event);
void axisClick(QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event);
void axisDoubleClick(QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event);
void legendClick(QCPLegend *legend, QCPAbstractLegendItem *item, QMouseEvent *event);
void legendDoubleClick(QCPLegend *legend, QCPAbstractLegendItem *item, QMouseEvent *event);
void selectionChangedByUser();
void beforeReplot();
void afterReplot();
};