Plot canvas. More...
#include <PlotCanvas.hh>
Inherits QWidget.
Signals | |
void | CanvasDeleted () |
Qt signal to request self-deletion. More... | |
Public Member Functions | |
PlotCanvas (QWidget *_parent) | |
Constructor. More... | |
virtual | ~PlotCanvas () |
Destructor. More... | |
unsigned int | AddPlot () |
Add a new plot to the canvas. More... | |
unsigned int | AddVariable (const std::string &_variable, const unsigned int _plotId=EmptyPlot) |
Add a new variable to a plot. More... | |
void | Clear () |
Clear the canvas and remove all variables and plots. More... | |
virtual bool | eventFilter (QObject *_o, QEvent *_event) |
Used to filter scroll wheel events. More... | |
void | Export (const std::string &_dirName, const FileType _type) const |
Export to PDF files in the given directory. More... | |
unsigned int | PlotByVariable (const unsigned int _variableId) const |
Get the plot id which the variable is plotted in. More... | |
unsigned int | PlotCount () const |
Get the number of plots in this canvas. More... | |
PlotCurveWeakPtr | PlotCurve (const unsigned int _variableId) |
Get the curve associated with the variable. More... | |
std::vector< IncrementalPlot * > | Plots () const |
Get all the plots in this canvas. More... | |
void | RemovePlot (const unsigned int _plotId) |
Remove a plot from the canvas. More... | |
void | RemoveVariable (const unsigned int _id, const unsigned int _plotId=EmptyPlot) |
Remove a variable from a plot. More... | |
void | Restart () |
Restart plotting. More... | |
void | SetDeleteCanvasEnabled (const bool _enable) |
Set whether or not to enable the delete canvas option in settings. More... | |
void | SetVariableLabel (const unsigned int _id, const std::string &_label) |
Set the label of a variable. More... | |
std::string | Title () const |
Get the title of the plot. More... | |
void | Update () |
Update plots and curves with new data. More... | |
unsigned int | VariableCount (const unsigned int _plotId) const |
Get the number of variables in a plot. More... | |
Static Public Attributes | |
static const unsigned int | EmptyPlot |
Empty plot used to indicate non-existent plot. More... | |
Plot canvas.
PlotCanvas | ( | QWidget * | _parent | ) |
Constructor.
[in] | _parent | Pointer to the parent widget. |
|
virtual |
Destructor.
unsigned int AddPlot | ( | ) |
Add a new plot to the canvas.
unsigned int AddVariable | ( | const std::string & | _variable, |
const unsigned int | _plotId = EmptyPlot |
||
) |
Add a new variable to a plot.
[in] | _variable | Name of the variable. |
[in] | _plotId | Unique id of the plot to add the variable to. |
|
signal |
Qt signal to request self-deletion.
void Clear | ( | ) |
Clear the canvas and remove all variables and plots.
|
virtual |
Used to filter scroll wheel events.
[in] | _o | Object that receives the event. |
[in] | _event | Pointer to the event. |
void Export | ( | const std::string & | _dirName, |
const FileType | _type | ||
) | const |
Export to PDF files in the given directory.
[in] | _dirName | Name of the directory to save the files into. |
[in] | _type | File type, such as PDFFile or CSVFile. |
unsigned int PlotByVariable | ( | const unsigned int | _variableId | ) | const |
Get the plot id which the variable is plotted in.
[in] | _id | Unique id of the variable |
unsigned int PlotCount | ( | ) | const |
Get the number of plots in this canvas.
PlotCurveWeakPtr PlotCurve | ( | const unsigned int | _variableId | ) |
Get the curve associated with the variable.
[in] | _id | Unique id of the variable |
std::vector<IncrementalPlot *> Plots | ( | ) | const |
Get all the plots in this canvas.
void RemovePlot | ( | const unsigned int | _plotId | ) |
Remove a plot from the canvas.
[in] | _id | Unique id of the plot |
void RemoveVariable | ( | const unsigned int | _id, |
const unsigned int | _plotId = EmptyPlot |
||
) |
Remove a variable from a plot.
[in] | _id | Unique id of the variable |
[in] | _plotId | Unique id of plot to remove the variable from. If EmptyPlot is specified, the function will search through all plots for the variable and remove it from the plot if found. |
void Restart | ( | ) |
Restart plotting.
A new plot curve will be created for each variable in the plot. Existing plot curves will no longer be updated.
void SetDeleteCanvasEnabled | ( | const bool | _enable | ) |
Set whether or not to enable the delete canvas option in settings.
[in] | _enable | True to enable delete canvas option |
void SetVariableLabel | ( | const unsigned int | _id, |
const std::string & | _label | ||
) |
Set the label of a variable.
[in] | _id | Unique id of the variable |
[in] | _label | New variable label. |
std::string Title | ( | ) | const |
Get the title of the plot.
void Update | ( | ) |
Update plots and curves with new data.
unsigned int VariableCount | ( | const unsigned int | _plotId | ) | const |
Get the number of variables in a plot.
[in] | _plotId | Unique plot id |
|
static |
Empty plot used to indicate non-existent plot.