17#ifndef GAZEBO_GUI_PLOT_PLOTCANVAS_HH_
18#define GAZEBO_GUI_PLOT_PLOTCANVAS_HH_
24#include <ignition/math/Vector2.hh>
36 class IncrementalPlot;
37 class PlotCanvasPrivate;
55 const std::string &_label);
61 public:
unsigned int AddVariable(
const std::string &_variable,
62 const unsigned int _plotId = EmptyPlot);
70 const unsigned int _plotId = EmptyPlot);
103 public: std::vector<IncrementalPlot *>
Plots()
const;
131 public:
void Export(
const std::string &_dirName,
137 private:
void ExportPDF(
const std::string &_dirName)
const;
142 private:
void ExportCSV(
const std::string &_dirName)
const;
150 private:
void AddVariable(
const unsigned int _id,
151 const std::string &_variable,
152 const unsigned int _plotId = EmptyPlot);
157 private:
void UpdateAxisLabel();
164 private slots:
void OnAddVariable(
const std::string &_variable);
171 private slots:
void OnAddVariable(
const unsigned int _id,
172 const std::string &_variable,
const unsigned int _targetId);
178 private slots:
void OnRemoveVariable(
const unsigned int _id,
179 const unsigned int _targetId);
185 private slots:
void OnMoveVariable(
const unsigned int _id,
186 const unsigned int _targetId);
191 private slots:
void OnSetVariableLabel(
const unsigned int _id,
192 const std::string &_label);
195 private slots:
void OnClearCanvas();
198 private slots:
void OnDeleteCanvas();
201 private slots:
void OnShowGrid();
204 private slots:
void OnShowHoverLine();
211 private: std::unique_ptr<PlotCanvasPrivate> dataPtr;
gui
Definition KeyEventHandler.hh:29
default namespace for gazebo
Plot canvas.
Definition PlotCanvas.hh:41
PlotCurveWeakPtr PlotCurve(const unsigned int _variableId)
Get the curve associated with the variable.
unsigned int AddPlot()
Add a new plot to the canvas.
virtual ~PlotCanvas()
Destructor.
std::vector< IncrementalPlot * > Plots() const
Get all the plots in this canvas.
static const unsigned int EmptyPlot
Empty plot used to indicate non-existent plot.
Definition PlotCanvas.hh:207
void SetVariableLabel(const unsigned int _id, const std::string &_label)
Set the label of a variable.
unsigned int VariableCount(const unsigned int _plotId) const
Get the number of variables in a plot.
std::string Title() const
Get the title of the plot.
void RemovePlot(const unsigned int _plotId)
Remove a plot from the canvas.
void Restart()
Restart plotting.
void SetDeleteCanvasEnabled(const bool _enable)
Set whether or not to enable the delete canvas option in settings.
PlotCanvas(QWidget *_parent)
Constructor.
void Export(const std::string &_dirName, const FileType _type) const
Export to PDF files in the given directory.
unsigned int AddVariable(const std::string &_variable, const unsigned int _plotId=EmptyPlot)
Add a new variable to a plot.
void Clear()
Clear the canvas and remove all variables and plots.
unsigned int PlotByVariable(const unsigned int _variableId) const
Get the plot id which the variable is plotted in.
void CanvasDeleted()
Qt signal to request self-deletion.
unsigned int PlotCount() const
Get the number of plots in this canvas.
void RemoveVariable(const unsigned int _id, const unsigned int _plotId=EmptyPlot)
Remove a variable from a plot.
void Update()
Update plots and curves with new data.
virtual bool eventFilter(QObject *_o, QEvent *_event)
Used to filter scroll wheel events.
FileType
Supported file types.
Definition ExportDialog.hh:35
std::weak_ptr< PlotCurve > PlotCurveWeakPtr
Definition PlottingTypes.hh:41
Forward declarations for the common classes.
Definition Animation.hh:27