##

IncrementalPlot Class Reference

A plotting widget that handles incremental addition of data. More...

`#include <IncrementalPlot.hh>`

Inherits QwtPlot.

## Public Types

enum | PlotAxis { X_BOTTOM_AXIS = 0, X_TOP_AXIS = 1, Y_LEFT_AXIS = 2, Y_RIGHT_AXIS = 3 }
| Axis enum. More...

## Signals

void | VariableAdded (const std::string &_name)
| Qt signal emitted when a variable pill is added. More...

## Public Member Functions

| IncrementalPlot (QWidget *_parent=nullptr)
| Constructor. More...
virtual | ~IncrementalPlot ()
| Destructor. More...
PlotCurveWeakPtr | AddCurve (const std::string &_label)
| Add a named curve. More...
void | AddPoint (const unsigned int _id, const ignition::math::Vector2d &_pt)
| Add a new point to a curve. More...
void | AddPoints (const unsigned int _id, const std::vector< ignition::math::Vector2d > &_pts)
| Add new points to a curve. More...
void | AttachCurve (PlotCurveWeakPtr _curve)
| Attach a curve to this plot. More...
void | Clear ()
| Clear all points from the plot. More...
PlotCurveWeakPtr | Curve (const std::string &_label) const
| Find a plot curve by name. More...
PlotCurveWeakPtr | Curve (const unsigned int _id) const
| Find a plot curve by id. More...
std::vector< PlotCurveWeakPtr > | Curves () const
| Get all curves in this plot. More...
PlotCurvePtr | DetachCurve (const unsigned int _id)
| Detach a curve from this plot. More...
bool | IsShowGrid () const
| Get whether the grid lines are shown. More...
bool | IsShowHoverLine () const
| Get whether the hover line is shown. More...
void | RemoveCurve (const unsigned int _id)
| Remove a curve by id. More...
void | SetCurveLabel (const unsigned int _id, const std::string &_label)
| Set a new label for the given curve. More...
void | SetPeriod (const common::Time &_time)
| Set the period over which to plot. More...
void | ShowAxisLabel (const PlotAxis _axis, const bool _show)
| Set whether to show the axis label. More...
void | ShowGrid (const bool _show)
| Set whether to show the grid lines. More...
void | ShowHoverLine (const bool _show)
| Set whether to show the hover line. More...
virtual QSize | sizeHint () const
| Give QT a size hint. More...
void | Update ()
| Update all the curves in the plot. More...

## Protected Member Functions

void | dragEnterEvent (QDragEnterEvent *_evt)
| Used to accept drag enter events. More...
void | dropEvent (QDropEvent *_evt)
| Used to accept drop events. More...

## Detailed Description

A plotting widget that handles incremental addition of data.

## Member Enumeration Documentation

## PlotAxis

enum PlotAxis

Axis enum.

Enumerator
X_BOTTOM_AXIS | bottom x axis
X_TOP_AXIS | top x axis
Y_LEFT_AXIS | left y axis
Y_RIGHT_AXIS | right y axis

## Constructor & Destructor Documentation

## IncrementalPlot()

IncrementalPlot | ( | QWidget * | _parent = `nullptr` | ) |

explicit

Constructor.

Parameters

  [in] | _parent | Pointer to a parent widget

## ~IncrementalPlot()

virtual ~IncrementalPlot | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## AddCurve()

PlotCurveWeakPtr AddCurve | ( | const std::string & | _label | ) |

Add a named curve.

Parameters

  [in] | _label | Name of the curve.

Returns
  A pointer to the new curve.

## AddPoint()

void AddPoint | ( | const unsigned int | _id,
|  | const ignition::math::Vector2d & | _pt
| ) |  |

Add a new point to a curve.

Parameters

  [in] | _id | Unique id of the curve
  [in] | _pt | Point to add.

## AddPoints()

void AddPoints | ( | const unsigned int | _id,
|  | const std::vector< ignition::math::Vector2d > & | _pts
| ) |  |

Add new points to a curve.

Parameters

  [in] | _id | Unique id of the curve
  [in] | _pt | Points to add.

## AttachCurve()

void AttachCurve | ( | PlotCurveWeakPtr | _curve | ) |

Attach a curve to this plot.

Parameters

  [in] | _plotCurve | The curve to attach to the plot.

## Clear()

void Clear | ( |  | ) |

Clear all points from the plot.

## Curve() [1/2]

PlotCurveWeakPtr Curve | ( | const std::string & | _label | ) | const

Find a plot curve by name.

Parameters

  [in] | _label | Name of the curve to look for.

Returns
  Plot curve if found, nullptr otherwise.

## Curve() [2/2]

PlotCurveWeakPtr Curve | ( | const unsigned int | _id | ) | const

Find a plot curve by id.

Parameters

  [in] | _id | Unique id of the plot curve.

Returns
  Plot curve if found, nullptr otherwise.

## Curves()

std::vector<PlotCurveWeakPtr> Curves | ( |  | ) | const

Get all curves in this plot.

Returns
  A list of curves in this plot.

## DetachCurve()

PlotCurvePtr DetachCurve | ( | const unsigned int | _id | ) |

Detach a curve from this plot.

Parameters

  [in] | _id | Unique id of the plot curve to detach.

Returns
  Pointer to the plot curve

## dragEnterEvent()

void dragEnterEvent | ( | QDragEnterEvent * | _evt | ) |

protected

Used to accept drag enter events.

Parameters

  [in] | _evt | The drag event.

## dropEvent()

void dropEvent | ( | QDropEvent * | _evt | ) |

protected

Used to accept drop events.

Parameters

  [in] | _evt | The drop event.

## IsShowGrid()

bool IsShowGrid | ( |  | ) | const

Get whether the grid lines are shown.

Returns
  True if the grid lines are visible.

## IsShowHoverLine()

bool IsShowHoverLine | ( |  | ) | const

Get whether the hover line is shown.

Returns
  True if the hover line is visible.

## RemoveCurve()

void RemoveCurve | ( | const unsigned int | _id | ) |

Remove a curve by id.

Parameters

  [in] | _id | Unique id of the curve.

## SetCurveLabel()

void SetCurveLabel | ( | const unsigned int | _id,
|  | const std::string & | _label
| ) |  |

Set a new label for the given curve.

Parameters

  [in] | _id | Unique id of the plot curve
  [in] | _label | New label to set the plot curve to.

## SetPeriod()

void SetPeriod | ( | const common::Time & | _time | ) |

Set the period over which to plot.

Parameters

  [in] | _time | Period duration in seconds.

## ShowAxisLabel()

void ShowAxisLabel | ( | const PlotAxis | _axis,
|  | const bool | _show
| ) |  |

Set whether to show the axis label.

Parameters

  [in] | _axis | Plot axis: X_BOTTOM_AXIS or Y_LEFT_AXIS.
  [in] | _show | True to show the label, false to hide it.

## ShowGrid()

void ShowGrid | ( | const bool | _show | ) |

Set whether to show the grid lines.

Parameters

  [in] | _show | True to show grid lines.

## ShowHoverLine()

void ShowHoverLine | ( | const bool | _show | ) |

Set whether to show the hover line.

Parameters

  [in] | _show | True to show hover line.

## sizeHint()

virtual QSize sizeHint | ( |  | ) | const

virtual

Give QT a size hint.

Returns
  Default size of the plot.

## Update()

void Update | ( |  | ) |

Update all the curves in the plot.

## VariableAdded

void VariableAdded | ( | const std::string & | _name | ) |

signal

Qt signal emitted when a variable pill is added.

Parameters

  [in] | _name | Name of variable pill added.

The documentation for this class was generated from the following file:

- IncrementalPlot.hh