##// END OF EJS Templates
Handles QCustomPlot plottables for vectors (1)...
Alexandre Leroux -
r581:098cadc4596c
parent child
Show More
@@ -0,0 +1,10
1 #ifndef SCIQLOP_VISUALIZATIONDEFS_H
2 #define SCIQLOP_VISUALIZATIONDEFS_H
3
4 #include <map>
5
6 class QCPAbstractPlottable;
7
8 using PlottablesMap = std::map<int, QCPAbstractPlottable *>;
9
10 #endif // SCIQLOP_VISUALIZATIONDEFS_H
@@ -1,40 +1,39
1 #ifndef SCIQLOP_VISUALIZATIONGRAPHHELPER_H
1 #ifndef SCIQLOP_VISUALIZATIONGRAPHHELPER_H
2 #define SCIQLOP_VISUALIZATIONGRAPHHELPER_H
2 #define SCIQLOP_VISUALIZATIONGRAPHHELPER_H
3
3
4 #include "Visualization/VisualizationDefs.h"
5
4 #include <Data/SqpRange.h>
6 #include <Data/SqpRange.h>
5
7
6 #include <QLoggingCategory>
8 #include <QLoggingCategory>
7 #include <QVector>
9 #include <QVector>
8
10
9 #include <memory>
11 #include <memory>
10
12
11 Q_DECLARE_LOGGING_CATEGORY(LOG_VisualizationGraphHelper)
13 Q_DECLARE_LOGGING_CATEGORY(LOG_VisualizationGraphHelper)
12
14
13 class IDataSeries;
15 class IDataSeries;
14 class QCPAbstractPlottable;
16 class QCPAbstractPlottable;
15 class QCustomPlot;
17 class QCustomPlot;
16 class Variable;
18 class Variable;
17
19
18 /**
20 /**
19 * @brief The VisualizationGraphHelper class aims to create the QCustomPlot components relative to a
21 * @brief The VisualizationGraphHelper class aims to create the QCustomPlot components relative to a
20 * variable, depending on the data series of this variable
22 * variable, depending on the data series of this variable
21 */
23 */
22 struct VisualizationGraphHelper {
24 struct VisualizationGraphHelper {
23 /**
25 /**
24 * Creates (if possible) the QCustomPlot components relative to the variable passed in
26 * Creates (if possible) the QCustomPlot components relative to the variable passed in
25 * parameter, and adds these to the plot passed in parameter.
27 * parameter, and adds these to the plot passed in parameter.
26 * @param variable the variable for which to create the components
28 * @param variable the variable for which to create the components
27 * @param plot the plot in which to add the created components. It takes ownership of these
29 * @param plot the plot in which to add the created components. It takes ownership of these
28 * components.
30 * components.
29 * @return the list of the components created
31 * @return the list of the components created
30 */
32 */
31 static QVector<QCPAbstractPlottable *> create(std::shared_ptr<Variable> variable,
33 static PlottablesMap create(std::shared_ptr<Variable> variable, QCustomPlot &plot) noexcept;
32 QCustomPlot &plot) noexcept;
33 static QVector<QCPAbstractPlottable *> createV2(std::shared_ptr<Variable> variable,
34 QCustomPlot &plot) noexcept;
35
34
36 static void updateData(QVector<QCPAbstractPlottable *> plotableVect,
35 static void updateData(PlottablesMap &plottables, IDataSeries *dataSeries,
37 std::shared_ptr<IDataSeries> dataSeries, const SqpRange &dateTime);
36 const SqpRange &dateTime);
38 };
37 };
39
38
40 #endif // SCIQLOP_VISUALIZATIONGRAPHHELPER_H
39 #endif // SCIQLOP_VISUALIZATIONGRAPHHELPER_H
General Comments 0
You need to be logged in to leave comments. Login now