##// END OF EJS Templates
Generates vectors (2)...
Alexandre Leroux -
r785:7548fc623435
parent child
Show More
@@ -3,6 +3,7
3
3
4 #include <Data/DataProviderParameters.h>
4 #include <Data/DataProviderParameters.h>
5 #include <Data/ScalarSeries.h>
5 #include <Data/ScalarSeries.h>
6 #include <Data/VectorSeries.h>
6
7
7 #include <cmath>
8 #include <cmath>
8
9
@@ -26,6 +27,29 struct ICosinusType {
26 Unit valuesUnit) const = 0;
27 Unit valuesUnit) const = 0;
27 };
28 };
28
29
30 struct ScalarCosinus : public ICosinusType {
31 int componentCount() const override { return 1; }
32
33 std::shared_ptr<IDataSeries> createDataSeries(std::vector<double> xAxisData,
34 std::vector<double> valuesData, Unit xAxisUnit,
35 Unit valuesUnit) const override
36 {
37 return std::make_shared<ScalarSeries>(std::move(xAxisData), std::move(valuesData),
38 xAxisUnit, valuesUnit);
39 }
40 };
41 struct VectorCosinus : public ICosinusType {
42 int componentCount() const override { return 3; }
43
44 std::shared_ptr<IDataSeries> createDataSeries(std::vector<double> xAxisData,
45 std::vector<double> valuesData, Unit xAxisUnit,
46 Unit valuesUnit) const override
47 {
48 return std::make_shared<VectorSeries>(std::move(xAxisData), std::move(valuesData),
49 xAxisUnit, valuesUnit);
50 }
51 };
52
29 } // namespace
53 } // namespace
30
54
31 std::shared_ptr<IDataProvider> CosinusProvider::clone() const
55 std::shared_ptr<IDataProvider> CosinusProvider::clone() const
General Comments 0
You need to be logged in to leave comments. Login now