##// END OF EJS Templates
Sets plot properties in a graph
Alexandre Leroux -
r165:9f84e7d54b1f
parent child
Show More
@@ -1,47 +1,51
1 #include "Visualization/VisualizationGraphWidget.h"
1 #include "Visualization/VisualizationGraphWidget.h"
2 #include "ui_VisualizationGraphWidget.h"
2 #include "ui_VisualizationGraphWidget.h"
3
3
4 #include <Variable/Variable.h>
4 #include <Variable/Variable.h>
5
5
6 #include <unordered_map>
6 #include <unordered_map>
7
7
8 struct VisualizationGraphWidget::VisualizationGraphWidgetPrivate {
8 struct VisualizationGraphWidget::VisualizationGraphWidgetPrivate {
9
9
10 // 1 variable -> n qcpplot
10 // 1 variable -> n qcpplot
11 std::unordered_map<std::shared_ptr<Variable>, std::unique_ptr<QCPAbstractPlottable> >
11 std::unordered_map<std::shared_ptr<Variable>, std::unique_ptr<QCPAbstractPlottable> >
12 m_VariableToPlotMap;
12 m_VariableToPlotMap;
13 };
13 };
14
14
15 VisualizationGraphWidget::VisualizationGraphWidget(QWidget *parent)
15 VisualizationGraphWidget::VisualizationGraphWidget(QWidget *parent)
16 : QWidget{parent},
16 : QWidget{parent},
17 ui{new Ui::VisualizationGraphWidget},
17 ui{new Ui::VisualizationGraphWidget},
18 impl{spimpl::make_unique_impl<VisualizationGraphWidgetPrivate>()}
18 impl{spimpl::make_unique_impl<VisualizationGraphWidgetPrivate>()}
19 {
19 {
20 ui->setupUi(this);
20 ui->setupUi(this);
21
22 // Set qcpplot properties :
23 // - Drag and zoom are enabled
24 ui->widget->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom);
21 }
25 }
22
26
23 VisualizationGraphWidget::~VisualizationGraphWidget()
27 VisualizationGraphWidget::~VisualizationGraphWidget()
24 {
28 {
25 delete ui;
29 delete ui;
26 }
30 }
27
31
28 void VisualizationGraphWidget::addVariable(std::shared_ptr<Variable> variable)
32 void VisualizationGraphWidget::addVariable(std::shared_ptr<Variable> variable)
29 {
33 {
30 // todo: first check is variable contains data then check how many plot have to be created
34 // todo: first check is variable contains data then check how many plot have to be created
31 }
35 }
32
36
33 void VisualizationGraphWidget::accept(IVisualizationWidget *visitor)
37 void VisualizationGraphWidget::accept(IVisualizationWidget *visitor)
34 {
38 {
35 // TODO: manage the visitor
39 // TODO: manage the visitor
36 }
40 }
37
41
38 void VisualizationGraphWidget::close()
42 void VisualizationGraphWidget::close()
39 {
43 {
40 // The main view cannot be directly closed.
44 // The main view cannot be directly closed.
41 return;
45 return;
42 }
46 }
43
47
44 QString VisualizationGraphWidget::name() const
48 QString VisualizationGraphWidget::name() const
45 {
49 {
46 return QStringLiteral("MainView");
50 return QStringLiteral("MainView");
47 }
51 }
General Comments 0
You need to be logged in to leave comments. Login now