@@ -1,4 +1,5 | |||
|
1 | 1 | #include "Visualization/VisualizationGraphWidget.h" |
|
2 | #include "Visualization/GraphPlottablesFactory.h" | |
|
2 | 3 | #include "ui_VisualizationGraphWidget.h" |
|
3 | 4 | |
|
4 | 5 | #include <Variable/Variable.h> |
@@ -18,8 +19,7 const auto VERTICAL_ZOOM_MODIFIER = Qt::ControlModifier; | |||
|
18 | 19 | struct VisualizationGraphWidget::VisualizationGraphWidgetPrivate { |
|
19 | 20 | |
|
20 | 21 | // 1 variable -> n qcpplot |
|
21 |
std::unordered_map<std::shared_ptr<Variable>, |
|
|
22 | m_VariableToPlotMap; | |
|
22 | std::unordered_map<std::shared_ptr<Variable>, QCPAbstractPlottable *> m_VariableToPlotMap; | |
|
23 | 23 | }; |
|
24 | 24 | |
|
25 | 25 | VisualizationGraphWidget::VisualizationGraphWidget(QWidget *parent) |
@@ -44,7 +44,12 VisualizationGraphWidget::~VisualizationGraphWidget() | |||
|
44 | 44 | |
|
45 | 45 | void VisualizationGraphWidget::addVariable(std::shared_ptr<Variable> variable) |
|
46 | 46 | { |
|
47 | // todo: first check is variable contains data then check how many plot have to be created | |
|
47 | // Uses delegate to create the qcpplot components according to the variable | |
|
48 | auto createdPlottables = GraphPlottablesFactory::create(variable.get(), *ui->widget); | |
|
49 | ||
|
50 | for (auto createdPlottable : qAsConst(createdPlottables)) { | |
|
51 | impl->m_VariableToPlotMap.insert({variable, createdPlottable}); | |
|
52 | } | |
|
48 | 53 | } |
|
49 | 54 | |
|
50 | 55 | void VisualizationGraphWidget::accept(IVisualizationWidget *visitor) |
General Comments 0
You need to be logged in to leave comments.
Login now