customtracker.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 CUSTOMTRACKER_H
8 #define CUSTOMTRACKER_H
9 
10 #include <QEvent>
11 #include <QPointF>
12 #include "qwt_plot_picker.h"
13 #include "qwt_picker_machine.h"
14 #include "qwt_plot_marker.h"
15 
16 class QwtPlotCurve;
17 
18 class CurveTracker : public QObject
19 {
20  Q_OBJECT
21 public:
22  explicit CurveTracker(QwtPlot*);
23 
24  ~CurveTracker();
25 
26  QPointF actualPosition() const;
27 
28  typedef enum
29  {
33  } Parameter;
34 
35 public slots:
36 
37  void setPosition(const QPointF& pos);
38 
39  void setParameter(Parameter par);
40 
41  void setEnabled(bool enable);
42 
43  bool isEnabled() const;
44 
45  void redraw()
46  {
48  }
49 
50 private:
51  QLineF curveLineAt(const QwtPlotCurve*, double x) const;
52 
53  QPointF transform(QPoint);
54 
55  QPoint invTransform(QPointF);
56 
58  std::vector<QwtPlotMarker*> _marker;
62  Parameter _param;
63  bool _visible;
64 };
65 
66 #endif // CUSTOMTRACKER_H
CurveTracker(QwtPlot *)
QPointF transform(QPoint)
A plot item, that represents a series of points.
Parameter _param
Definition: customtracker.h:62
A 2-D plotting widget.
Definition: qwt_plot.h:78
QwtPlotMarker * _line_marker
Definition: customtracker.h:59
bool isEnabled() const
QPoint invTransform(QPointF)
void setEnabled(bool enable)
QPointF actualPosition() const
QwtPlotMarker * _text_marker
Definition: customtracker.h:60
QPointF _prev_trackerpoint
Definition: customtracker.h:57
std::vector< QwtPlotMarker * > _marker
Definition: customtracker.h:58
QwtPlot * _plot
Definition: customtracker.h:61
std::enable_if_t< all< Args... >::value, enable_t > enable
Definition: sol.hpp:2244
void setPosition(const QPointF &pos)
QLineF curveLineAt(const QwtPlotCurve *, double x) const
void setParameter(Parameter par)
A class for drawing markers.


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Jun 19 2023 03:01:01