plot.h 878 Bytes
Newer Older
Tobias WEBER's avatar
Tobias WEBER committed
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
/**
 * plotter
 * @author Tobias Weber <tweber@ill.fr>
 * @date 15-Jun-2018
 * @license see 'LICENSE' file
 */

#ifndef __PLOT_H__
#define __PLOT_H__

#include <QtWidgets/QWidget>
#include "qcp/qcustomplot.h"

#include "data.h"


class Plotter : public QWidget
{
private:
	QCustomPlot *m_pPlotter = new QCustomPlot(this);

public:
	Plotter(QWidget *parent);
	virtual ~Plotter();

	QCustomPlot* GetPlotter() { return m_pPlotter; }
	const QCustomPlot* GetPlotter() const { return m_pPlotter; }

	void Plot(const Dataset &dataset);
Tobias WEBER's avatar
Tobias WEBER committed
30
	void Clear();
Tobias WEBER's avatar
Tobias WEBER committed
31
32
33
};


Tobias WEBER's avatar
Tobias WEBER committed
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

/**
 * the dock which contains the plotter
 */
class PlotterDock : public QDockWidget
{
private:
	std::unique_ptr<Plotter> m_pPlot;

public:
	PlotterDock(QWidget* pParent = nullptr);
	virtual ~PlotterDock();

	const Plotter* GetWidget() const { return m_pPlot.get(); }
	Plotter* GetWidget() { return m_pPlot.get(); }
};

Tobias WEBER's avatar
Tobias WEBER committed
51
#endif