point_series_xy.h
Go to the documentation of this file.
1 /*
2  * This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
5  */
6 
7 #ifndef POINT_SERIES_H
8 #define POINT_SERIES_H
9 
10 #include "timeseries_qwt.h"
11 
13 {
14 public:
15  PointSeriesXY(const PlotData* x_axis, const PlotData* y_axis);
16 
17  virtual QPointF sample(size_t i) const override
18  {
19  const auto& p = _cached_curve.at(i);
20  return QPointF(p.x, p.y);
21  }
22 
23  size_t size() const override;
24 
25  std::optional<QPointF> sampleFromTime(double t) override;
26 
27  RangeOpt getVisualizationRangeY(Range range_X) override;
28 
29  void updateCache(bool reset_old_data) override;
30 
32 
33  const PlotData* dataX() const
34  {
35  return _x_axis;
36  }
37  const PlotData* dataY() const
38  {
39  return _y_axis;
40  }
41 
42  const PlotDataXY* plotData() const override
43  {
44  return &_cached_curve;
45  }
46 
47 protected:
48  const PlotData* _x_axis;
49  const PlotData* _y_axis;
51 };
52 
53 #endif // POINT_SERIES_H
PJ::TimeseriesBase
Definition: timeseries.h:16
PointSeriesXY::getVisualizationRangeY
RangeOpt getVisualizationRangeY(Range range_X) override
Definition: point_series_xy.cpp:41
PointSeriesXY::_cached_curve
PlotDataXY _cached_curve
Definition: point_series_xy.h:50
PointSeriesXY::getVisualizationRangeX
RangeOpt getVisualizationRangeX() override
Definition: point_series_xy.cpp:76
PointSeriesXY::PointSeriesXY
PointSeriesXY(const PlotData *x_axis, const PlotData *y_axis)
Definition: point_series_xy.cpp:11
PointSeriesXY::size
size_t size() const override
Definition: point_series_xy.cpp:20
PointSeriesXY::sample
virtual QPointF sample(size_t i) const override
Definition: point_series_xy.h:17
PointSeriesXY::plotData
const PlotDataXY * plotData() const override
Definition: point_series_xy.h:42
PointSeriesXY
Definition: point_series_xy.h:12
timeseries_qwt.h
PJ::Range
Definition: plotdatabase.h:24
PointSeriesXY::updateCache
void updateCache(bool reset_old_data) override
Definition: point_series_xy.cpp:46
QwtTimeseries
Definition: timeseries_qwt.h:44
PointSeriesXY::dataY
const PlotData * dataY() const
Definition: point_series_xy.h:37
PointSeriesXY::_y_axis
const PlotData * _y_axis
Definition: point_series_xy.h:49
PointSeriesXY::dataX
const PlotData * dataX() const
Definition: point_series_xy.h:33
PJ::RangeOpt
std::optional< Range > RangeOpt
Definition: plotdatabase.h:36
PointSeriesXY::sampleFromTime
std::optional< QPointF > sampleFromTime(double t) override
Definition: point_series_xy.cpp:25
PJ::PlotDataBase::at
const Point & at(size_t index) const
Definition: plotdatabase.h:193
PointSeriesXY::_x_axis
const PlotData * _x_axis
Definition: point_series_xy.h:48
PJ::PlotDataBase
Definition: plotdatabase.h:122


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:45