20 #include <QMouseEvent> 22 #include <qwt/qwt_plot.h> 23 #include <qwt/qwt_plot_canvas.h> 24 #include <qwt/qwt_scale_div.h> 41 "rqt_multiplot").
append(
"/resource/23x23/move.png"))), 11, 11);
44 canvas->installEventFilter(
this);
56 if (!
panning_ && (event->type() == QEvent::MouseButtonPress)) {
57 QMouseEvent* mouseEvent =
static_cast<QMouseEvent*
>(event);
59 if (mouseEvent->button() == Qt::LeftButton) {
65 #if QWT_VERSION >= 0x060100 67 canvas_->plot()->axisScaleDiv(QwtPlot::xBottom).lowerBound(),
68 canvas_->plot()->axisScaleDiv(QwtPlot::yLeft).lowerBound());
70 canvas_->plot()->axisScaleDiv(QwtPlot::xBottom).upperBound(),
71 canvas_->plot()->axisScaleDiv(QwtPlot::yLeft).upperBound());
74 canvas_->plot()->axisScaleDiv(QwtPlot::xBottom)->lowerBound(),
75 canvas_->plot()->axisScaleDiv(QwtPlot::yLeft)->lowerBound());
77 canvas_->plot()->axisScaleDiv(QwtPlot::xBottom)->upperBound(),
78 canvas_->plot()->axisScaleDiv(QwtPlot::yLeft)->upperBound());
90 else if (
panning_ && (event->type() == QEvent::MouseMove)) {
91 QMouseEvent* mouseEvent =
static_cast<QMouseEvent*
>(event);
93 double dx = mouseEvent->pos().x()-
position_.x();
94 double dy = mouseEvent->pos().y()-
position_.y();
103 bool autoReplot =
canvas_->plot()->autoReplot();
104 canvas_->plot()->setAutoReplot(
false);
106 canvas_->plot()->setAxisScale(QwtPlot::xBottom, minimum.x(),
108 canvas_->plot()->setAxisScale(QwtPlot::yLeft, minimum.y(),
111 canvas_->plot()->setAutoReplot(autoReplot);
114 else if (
panning_ && (event->type() == QEvent::MouseButtonRelease)) {
bool eventFilter(QObject *object, QEvent *event)
BoundingRectangle bounds_
void setMaximum(const QPointF &maximum)
PlotPanner(QwtPlotCanvas *canvas)
void setMinimum(const QPointF &minimum)
ROSLIB_DECL std::string getPath(const std::string &package_name)
ROSCPP_DECL std::string append(const std::string &left, const std::string &right)