From 098cadc4596cfd365d4a5f89b26add841c4de81d 2017-08-18 14:18:57 From: Alexandre Leroux Date: 2017-08-18 14:18:57 Subject: [PATCH] Handles QCustomPlot plottables for vectors (1) - Uses a map that associate a component index to a plottable. - Replaces the current structure by the map in VisualizationGraphHelper For example: - for a scalar, there is a QCPGraph at index 0 - for a vector, there is three QCPGraph at indexes 0, 1 and 2 --- diff --git a/gui/include/Visualization/VisualizationDefs.h b/gui/include/Visualization/VisualizationDefs.h new file mode 100644 index 0000000..06c5945 --- /dev/null +++ b/gui/include/Visualization/VisualizationDefs.h @@ -0,0 +1,10 @@ +#ifndef SCIQLOP_VISUALIZATIONDEFS_H +#define SCIQLOP_VISUALIZATIONDEFS_H + +#include + +class QCPAbstractPlottable; + +using PlottablesMap = std::map; + +#endif // SCIQLOP_VISUALIZATIONDEFS_H diff --git a/gui/include/Visualization/VisualizationGraphHelper.h b/gui/include/Visualization/VisualizationGraphHelper.h index b721858..be0b95d 100644 --- a/gui/include/Visualization/VisualizationGraphHelper.h +++ b/gui/include/Visualization/VisualizationGraphHelper.h @@ -1,6 +1,8 @@ #ifndef SCIQLOP_VISUALIZATIONGRAPHHELPER_H #define SCIQLOP_VISUALIZATIONGRAPHHELPER_H +#include "Visualization/VisualizationDefs.h" + #include #include @@ -28,13 +30,10 @@ struct VisualizationGraphHelper { * components. * @return the list of the components created */ - static QVector create(std::shared_ptr variable, - QCustomPlot &plot) noexcept; - static QVector createV2(std::shared_ptr variable, - QCustomPlot &plot) noexcept; + static PlottablesMap create(std::shared_ptr variable, QCustomPlot &plot) noexcept; - static void updateData(QVector plotableVect, - std::shared_ptr dataSeries, const SqpRange &dateTime); + static void updateData(PlottablesMap &plottables, IDataSeries *dataSeries, + const SqpRange &dateTime); }; #endif // SCIQLOP_VISUALIZATIONGRAPHHELPER_H