plotmagnifier.h
Go to the documentation of this file.
1 #ifndef PLOTMAGNIFIER_H
2 #define PLOTMAGNIFIER_H
3 
4 #include <QTimer>
5 #include "qwt_plot_magnifier.h"
6 #include "qwt_plot.h"
7 #include <QEvent>
8 
10 {
11  Q_OBJECT
12 
13 public:
14  explicit PlotMagnifier(QWidget* canvas);
15  virtual ~PlotMagnifier() override;
16 
17  void setAxisLimits(int axis, double lower, double upper);
18  virtual void widgetWheelEvent(QWheelEvent* event) override;
19 
20  enum AxisMode
21  {
25  };
26 
27  virtual void rescale(double factor) override
28  {
29  rescale(factor, _default_mode);
30  }
31 
33  {
34  _default_mode = mode;
35  }
36 
37  void rescale(double factor, AxisMode axis);
38 
39 protected:
40  virtual void widgetMousePressEvent(QMouseEvent* event) override;
41 
44 
45  QPointF _mouse_position;
46 
47 signals:
48  void rescaled(QRectF new_size);
49 
50 private:
51  QPointF invTransform(QPoint pos);
52  QTimer _future_emit;
54 };
55 
56 #endif // PLOTMAGNIFIER_H
QTimer _future_emit
Definition: plotmagnifier.h:52
virtual void rescale(double factor) override
Definition: plotmagnifier.h:27
QwtPlotMagnifier provides zooming, by magnifying in steps.
Number of axes.
Definition: qwt_plot.h:109
QPointF invTransform(QPoint pos)
virtual void widgetMousePressEvent(QMouseEvent *event) override
double _upper_bounds[QwtPlot::axisCnt]
Definition: plotmagnifier.h:43
double _lower_bounds[QwtPlot::axisCnt]
Definition: plotmagnifier.h:42
QPointF _mouse_position
Definition: plotmagnifier.h:45
virtual void widgetWheelEvent(QWheelEvent *event) override
virtual ~PlotMagnifier() override
void setDefaultMode(AxisMode mode)
Definition: plotmagnifier.h:32
void rescaled(QRectF new_size)
char upper
Definition: utf-8.c:50
QWidget * canvas()
Return observed plot canvas.
AxisMode _default_mode
Definition: plotmagnifier.h:53
void setAxisLimits(int axis, double lower, double upper)
PlotMagnifier(QWidget *canvas)
char lower
Definition: utf-8.c:49


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 03:48:10