##

PlotTracker.hh
Go to the documentation of this file.
/*
* Copyright (C) 2016 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GAZEBO_GUI_PLOT_PLOTTRACKER_HH_
#define GAZEBO_GUI_PLOT_PLOTTRACKER_HH_
#include <memory>
#include "gazebo/gui/plot/qwt_gazebo.h"
namespace gazebo
{
namespace gui
{
class PlotTrackerPrivate;
class PlotTracker: public QwtPlotPicker
{
#if (QWT_VERSION < ((6 << 16) | (1 << 8) | 0))
public: explicit PlotTracker(QwtPlotCanvas *_canvas);
#else
public: explicit PlotTracker(QWidget *_canvas);
#endif
public: void Update();
protected: virtual void updateDisplay();
protected: virtual QwtText trackerTextF(const QPointF &_pos) const;
protected: virtual void widgetMousePressEvent(QMouseEvent *_e);
protected: virtual void widgetMouseReleaseEvent(QMouseEvent *_e);
private: QString CurveInfoAt(const QwtPlotCurve *_curve,
const QPointF &_pos) const;
private: QLineF CurveLineAt(const QwtPlotCurve *_curve,
const double _x) const;
private: int UpperSampleIndex(const QwtSeriesData<QPointF> &_series,
const double _value) const;
private: std::unique_ptr<PlotTrackerPrivate> dataPtr;
};
}
}
#endif
qwt_gazebo.h
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::gui::PlotTracker::widgetMouseReleaseEvent
virtual void widgetMouseReleaseEvent(QMouseEvent *_e)
Mouse release event used to determine when to show/hide hover line.
gazebo::gui::PlotTracker::trackerTextF
virtual QwtText trackerTextF(const QPointF &_pos) const
Overriden to provide customized hover text.
gazebo::gui::PlotTracker::widgetMousePressEvent
virtual void widgetMousePressEvent(QMouseEvent *_e)
Mouse press event used to determine when to show/hide hover line.
gazebo::gui::PlotTracker::Update
void Update()
Update the tracker text.
gui
gui
Definition: KeyEventHandler.hh:29
gazebo::gui::PlotTracker::PlotTracker
PlotTracker(QwtPlotCanvas *_canvas)
Constructor.
gazebo::gui::PlotTracker::updateDisplay
virtual void updateDisplay()
Overriden to update the hover line and tracker text.
gazebo::gui::PlotTracker
Mouse hover tracking.
Definition: PlotTracker.hh:32