Go to the documentation of this file.
17 #ifndef GAZEBO_GUI_PLOT_INCREMENTALPLOT_HH_
18 #define GAZEBO_GUI_PLOT_INCREMENTALPLOT_HH_
24 #include <ignition/math/Vector2.hh>
43 class IncrementalPlotPrivate;
81 public:
void AddPoint(
const unsigned int _id,
82 const ignition::math::Vector2d &_pt);
87 public:
void AddPoints(
const unsigned int _id,
88 const std::vector<ignition::math::Vector2d> &_pts);
104 public:
void Update();
108 public:
void RemoveCurve(
const unsigned int _id);
121 public:
PlotCurvePtr DetachCurve(
const unsigned int _id);
126 public:
void SetCurveLabel(
const unsigned int _id,
127 const std::string &_label);
132 public:
void ShowAxisLabel(
const PlotAxis _axis,
const bool _show);
136 public:
void ShowGrid(
const bool _show);
140 public:
bool IsShowGrid()
const;
144 public:
void ShowHoverLine(
const bool _show);
148 public:
bool IsShowHoverLine()
const;
152 public: std::vector<PlotCurveWeakPtr> Curves()
const;
156 public:
virtual QSize sizeHint()
const;
160 protected:
void dragEnterEvent(QDragEnterEvent *_evt);
164 protected:
void dropEvent(QDropEvent *_evt);
168 Q_SIGNALS:
void VariableAdded(
const std::string &_name);
172 private: std::unique_ptr<IncrementalPlotPrivate> dataPtr;
void Update()
Update all the curves in the plot.
IncrementalPlot(QWidget *_parent=nullptr)
Constructor.
default namespace for gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
@ Y_RIGHT_AXIS
right y axis
Definition: IncrementalPlot.hh:63
A Time class, can be used to hold wall- or sim-time. stored as sec and nano-sec.
Definition: Time.hh:47
PlotAxis
Axis enum.
Definition: IncrementalPlot.hh:51
common
Definition: FuelModelDatabase.hh:37
@ Y_LEFT_AXIS
left y axis
Definition: IncrementalPlot.hh:60
void AttachCurve(PlotCurveWeakPtr _curve)
Attach a curve to this plot.
PlotCurveWeakPtr Curve(const std::string &_label) const
Find a plot curve by name.
void dragEnterEvent(QDragEnterEvent *_evt)
Used to accept drag enter events.
void ShowGrid(const bool _show)
Set whether to show the grid lines.
PlotCurvePtr DetachCurve(const unsigned int _id)
Detach a curve from this plot.
void Clear()
Clear all points from the plot.
PlotCurveWeakPtr AddCurve(const std::string &_label)
Add a named curve.
bool IsShowGrid() const
Get whether the grid lines are shown.
void SetPeriod(const common::Time &_time)
Set the period over which to plot.
void AddPoint(const unsigned int _id, const ignition::math::Vector2d &_pt)
Add a new point to a curve.
void RemoveCurve(const unsigned int _id)
Remove a curve by id.
@ X_TOP_AXIS
top x axis
Definition: IncrementalPlot.hh:57
void VariableAdded(const std::string &_name)
Qt signal emitted when a variable pill is added.
gui
Definition: KeyEventHandler.hh:29
A plotting widget that handles incremental addition of data.
Definition: IncrementalPlot.hh:46
void ShowAxisLabel(const PlotAxis _axis, const bool _show)
Set whether to show the axis label.
std::vector< PlotCurveWeakPtr > Curves() const
Get all curves in this plot.
std::shared_ptr< PlotCurve > PlotCurvePtr
Definition: PlottingTypes.hh:37
std::weak_ptr< PlotCurve > PlotCurveWeakPtr
Definition: PlottingTypes.hh:41
void ShowHoverLine(const bool _show)
Set whether to show the hover line.
void SetCurveLabel(const unsigned int _id, const std::string &_label)
Set a new label for the given curve.
virtual QSize sizeHint() const
Give QT a size hint.
void AddPoints(const unsigned int _id, const std::vector< ignition::math::Vector2d > &_pts)
Add new points to a curve.
@ X_BOTTOM_AXIS
bottom x axis
Definition: IncrementalPlot.hh:54
void dropEvent(QDropEvent *_evt)
Used to accept drop events.
virtual ~IncrementalPlot()
Destructor.
bool IsShowHoverLine() const
Get whether the hover line is shown.