##// END OF EJS Templates
Adds method into ArrayData and DataSeries iterator to get all values
Alexandre Leroux -
r667:91c7adcb7714
parent child
Show More
@@ -87,10 +87,9 public:
87 87 return it != end ? *it : std::numeric_limits<double>::quiet_NaN();
88 88 }
89 89
90 private:
91 std::vector<double> values() const
90 QVector<double> values() const override
92 91 {
93 auto result = std::vector<double>{};
92 auto result = QVector<double>{};
94 93 for (auto i = 0; i < m_NbComponents; ++i) {
95 94 result.push_back(*(m_It + i));
96 95 }
@@ -98,6 +97,7 private:
98 97 return result;
99 98 }
100 99
100 private:
101 101 DataContainer::const_iterator m_It;
102 102 int m_NbComponents;
103 103 };
@@ -4,6 +4,7
4 4 #include "CoreGlobal.h"
5 5 #include "Data/SqpIterator.h"
6 6
7 #include <QVector>
7 8 #include <memory>
8 9
9 10 /**
@@ -25,6 +26,7 public:
25 26 virtual double first() const = 0;
26 27 virtual double min() const = 0;
27 28 virtual double max() const = 0;
29 virtual QVector<double> values() const = 0;
28 30 };
29 31
30 32 explicit ArrayDataIteratorValue(std::unique_ptr<Impl> impl);
@@ -46,6 +48,8 public:
46 48 double min() const;
47 49 /// Gets max value among all components
48 50 double max() const;
51 /// Gets all values
52 QVector<double> values() const;
49 53
50 54 private:
51 55 std::unique_ptr<Impl> m_Impl;
@@ -67,6 +67,7 public:
67 67 double value(int componentIndex) const override { return m_ValuesIt->at(componentIndex); }
68 68 double minValue() const override { return m_ValuesIt->min(); }
69 69 double maxValue() const override { return m_ValuesIt->max(); }
70 QVector<double> values() const override { return m_ValuesIt->values(); }
70 71
71 72 private:
72 73 ArrayDataIterator m_XIt;
@@ -4,6 +4,7
4 4 #include "CoreGlobal.h"
5 5 #include "Data/SqpIterator.h"
6 6
7 #include <QVector>
7 8 #include <memory>
8 9
9 10 /**
@@ -27,6 +28,7 public:
27 28 virtual double value(int componentIndex) const = 0;
28 29 virtual double minValue() const = 0;
29 30 virtual double maxValue() const = 0;
31 virtual QVector<double> values() const = 0;
30 32 };
31 33
32 34 explicit DataSeriesIteratorValue(std::unique_ptr<Impl> impl);
@@ -50,6 +52,8 public:
50 52 double minValue() const;
51 53 /// Gets max of all values data
52 54 double maxValue() const;
55 /// Gets all values data
56 QVector<double> values() const;
53 57
54 58 private:
55 59 std::unique_ptr<Impl> m_Impl;
@@ -50,3 +50,8 double ArrayDataIteratorValue::max() const
50 50 {
51 51 return m_Impl->max();
52 52 }
53
54 QVector<double> ArrayDataIteratorValue::values() const
55 {
56 return m_Impl->values();
57 }
@@ -56,3 +56,8 double DataSeriesIteratorValue::maxValue() const
56 56 {
57 57 return m_Impl->maxValue();
58 58 }
59
60 QVector<double> DataSeriesIteratorValue::values() const
61 {
62 return m_Impl->values();
63 }
General Comments 0
You need to be logged in to leave comments. Login now