CurveData.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright (C) 2015 by Ralf Kaestner *
3  * ralf.kaestner@gmail.com *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the Lesser GNU General Public License as published by*
7  * the Free Software Foundation; either version 3 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * Lesser GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the Lesser GNU General Public License *
16  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
17  ******************************************************************************/
18 
19 #ifndef RQT_MULTIPLOT_CURVE_DATA_H
20 #define RQT_MULTIPLOT_CURVE_DATA_H
21 
22 #include <QPair>
23 #include <QPointF>
24 #include <QRectF>
25 #include <QVector>
26 
27 #include <qwt/qwt_series_data.h>
28 
31 
32 namespace rqt_multiplot {
33  class CurveData :
34  public QwtSeriesData<QPointF> {
35  public:
36  CurveData();
37  ~CurveData();
38 
39  virtual size_t getNumPoints() const = 0;
40  double getValue(size_t index, CurveConfig::Axis axis) const;
41  virtual QPointF getPoint(size_t index) const = 0;
42  virtual QVector<size_t> getPointsInDistance(double x, double
43  maxDistance) const;
44  QPair<double, double> getAxisBounds(CurveConfig::Axis axis) const;
45  virtual BoundingRectangle getBounds() const = 0;
46  bool isEmpty() const;
47 
48  size_t size() const;
49  QPointF sample(size_t i) const;
50  QRectF boundingRect() const;
51 
52  virtual void appendPoint(const QPointF& point) = 0;
53  void appendPoint(double x, double y);
54  virtual void clearPoints() = 0;
55 
56  void writeFormatted(QStringList& formattedX, QStringList&
57  formattedY) const;
58  };
59 };
60 
61 #endif
virtual void clearPoints()=0
QPointF sample(size_t i) const
Definition: CurveData.cpp:87
size_t size() const
Definition: CurveData.cpp:83
virtual void appendPoint(const QPointF &point)=0
virtual QVector< size_t > getPointsInDistance(double x, double maxDistance) const
Definition: CurveData.cpp:46
QRectF boundingRect() const
Definition: CurveData.cpp:91
bool isEmpty() const
Definition: CurveData.cpp:75
virtual BoundingRectangle getBounds() const =0
QPair< double, double > getAxisBounds(CurveConfig::Axis axis) const
Definition: CurveData.cpp:62
virtual QPointF getPoint(size_t index) const =0
virtual size_t getNumPoints() const =0
void writeFormatted(QStringList &formattedX, QStringList &formattedY) const
Definition: CurveData.cpp:99
double getValue(size_t index, CurveConfig::Axis axis) const
Definition: CurveData.cpp:37


rqt_multiplot
Author(s): Ralf Kaestner
autogenerated on Wed Jul 10 2019 03:49:44