@@ -163,6 +163,21 public: | |||
|
163 | 163 | dataSeries->unlock(); |
|
164 | 164 | } |
|
165 | 165 | |
|
166 | void purge(double min, double max) override | |
|
167 | { | |
|
168 | if (min > max) { | |
|
169 | std::swap(min, max); | |
|
170 | } | |
|
171 | ||
|
172 | lockWrite(); | |
|
173 | ||
|
174 | auto it = std::remove_if( | |
|
175 | begin(), end(), [min, max](const auto &it) { return it.x() < min || it.x() > max; }); | |
|
176 | erase(it, end()); | |
|
177 | ||
|
178 | unlock(); | |
|
179 | } | |
|
180 | ||
|
166 | 181 | // ///////// // |
|
167 | 182 | // Iterators // |
|
168 | 183 | // ///////// // |
@@ -57,6 +57,9 public: | |||
|
57 | 57 | virtual Unit valuesUnit() const = 0; |
|
58 | 58 | |
|
59 | 59 | virtual void merge(IDataSeries *dataSeries) = 0; |
|
60 | /// Removes from data series all entries whose value on the x-axis is not between min and max | |
|
61 | virtual void purge(double min, double max) = 0; | |
|
62 | ||
|
60 | 63 | /// @todo Review the name and signature of this method |
|
61 | 64 | virtual std::shared_ptr<IDataSeries> subDataSeries(const SqpRange &range) = 0; |
|
62 | 65 |
General Comments 0
You need to be logged in to leave comments.
Login now