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;
63  bool _visible;
64 };
65 
66 #endif // CUSTOMTRACKER_H
CurveTracker::VALUE_NAME
@ VALUE_NAME
Definition: customtracker.h:32
CurveTracker::VALUE
@ VALUE
Definition: customtracker.h:31
QwtPlot
A 2-D plotting widget.
Definition: qwt_plot.h:78
mqtt_test_proto.x
x
Definition: mqtt_test_proto.py:34
CurveTracker::transform
QPointF transform(QPoint)
CurveTracker::_param
Parameter _param
Definition: customtracker.h:62
CurveTracker::isEnabled
bool isEnabled() const
Definition: customtracker.cpp:74
CurveTracker::redraw
void redraw()
Definition: customtracker.h:45
CurveTracker::setEnabled
void setEnabled(bool enable)
Definition: customtracker.cpp:62
CurveTracker::_marker
std::vector< QwtPlotMarker * > _marker
Definition: customtracker.h:58
CurveTracker
Definition: customtracker.h:18
CurveTracker::LINE_ONLY
@ LINE_ONLY
Definition: customtracker.h:30
sol::meta::enable
std::enable_if_t< all< Args... >::value, enable_t > enable
Definition: sol.hpp:2244
qwt_picker_machine.h
CurveTracker::setPosition
void setPosition(const QPointF &pos)
Definition: customtracker.cpp:79
qwt_plot_picker.h
CurveTracker::_line_marker
QwtPlotMarker * _line_marker
Definition: customtracker.h:59
CurveTracker::~CurveTracker
~CurveTracker()
Definition: customtracker.cpp:42
CurveTracker::setParameter
void setParameter(Parameter par)
Definition: customtracker.cpp:51
CurveTracker::curveLineAt
QLineF curveLineAt(const QwtPlotCurve *, double x) const
Definition: customtracker.cpp:235
CurveTracker::_visible
bool _visible
Definition: customtracker.h:63
CurveTracker::actualPosition
QPointF actualPosition() const
Definition: customtracker.cpp:46
CurveTracker::invTransform
QPoint invTransform(QPointF)
CurveTracker::_prev_trackerpoint
QPointF _prev_trackerpoint
Definition: customtracker.h:57
QwtPlotMarker
A class for drawing markers.
Definition: qwt_plot_marker.h:45
CurveTracker::_text_marker
QwtPlotMarker * _text_marker
Definition: customtracker.h:60
CurveTracker::CurveTracker
CurveTracker(QwtPlot *)
Definition: customtracker.cpp:27
CurveTracker::Parameter
Parameter
Definition: customtracker.h:28
CurveTracker::_plot
QwtPlot * _plot
Definition: customtracker.h:61
QwtPlotCurve
A plot item, that represents a series of points.
Definition: qwt_plot_curve.h:56
qwt_plot_marker.h


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