CurveDataVector.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_VECTOR_H
20 #define RQT_MULTIPLOT_CURVE_DATA_VECTOR_H
21 
22 #include <QVector>
23 
24 #include <boost/container/flat_set.hpp>
25 
27 
28 namespace rqt_multiplot {
30  public CurveData {
31  public:
34 
35  size_t getNumPoints() const;
36  QPointF getPoint(size_t index) const;
37  QVector<size_t> getPointsInDistance(double x, double maxDistance)
38  const;
40 
41  void appendPoint(const QPointF& point);
42  void clearPoints();
43 
44  private:
46  public:
47  inline XCoordinateRef(double x = 0.0, size_t index = 0) :
48  x_(x),
49  index_(index) {
50  };
51 
52  inline XCoordinateRef(const XCoordinateRef& src) :
53  x_(src.x_),
54  index_(src.index_) {
55  };
56 
57  inline bool operator==(const XCoordinateRef& reference) const {
58  return (x_ == reference.x_);
59  };
60 
61  inline bool operator<(const XCoordinateRef& reference) const {
62  return (x_ < reference.x_);
63  };
64 
65  double x_;
66  size_t index_;
67  };
68 
69  typedef boost::container::flat_set<XCoordinateRef> XCoordinateRefSet;
70 
71  QVector<QPointF> points_;
72  XCoordinateRefSet x_;
73 
75  };
76 };
77 
78 #endif
QPointF getPoint(size_t index) const
boost::container::flat_set< XCoordinateRef > XCoordinateRefSet
bool operator==(const XCoordinateRef &reference) const
BoundingRectangle getBounds() const
XCoordinateRef(double x=0.0, size_t index=0)
QVector< size_t > getPointsInDistance(double x, double maxDistance) const
void appendPoint(const QPointF &point)
bool operator<(const XCoordinateRef &reference) const


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