|
RADLib
RADical C++ application framework
|
Mutable X/Y plot data model that emits dataChanged on edits. More...
#include <RADPlot.h>
Inheritance diagram for RADUi::PlotModel:
Collaboration diagram for RADUi::PlotModel:Public Member Functions | |
| PlotModel () | |
| Creates an empty plot model. More... | |
| ~PlotModel () override | |
| Destroys the model implementation. More... | |
| size_t | addSeries (std::string name, PlotSeriesStyle style={}) |
| Adds a named series and returns its index. More... | |
| size_t | seriesCount () const |
| Returns the number of series in the model. More... | |
| void | clear () |
| Removes all series data. More... | |
| void | clearSeries (size_t seriesIndex) |
| Removes all points from one series. More... | |
| void | append (size_t seriesIndex, double x, double y) |
| Appends one X/Y point to a series. More... | |
| void | append (size_t seriesIndex, PlotPoint point) |
| Appends one point to a series. More... | |
| void | appendBatch (size_t seriesIndex, const std::vector< PlotPoint > &points) |
| Appends a batch of points to a series. More... | |
| void | setMaxPointCount (size_t maxPointCount) |
| Sets the maximum retained points per series; 0 means unlimited. More... | |
| size_t | maxPointCount () const |
| Returns the maximum retained points per series. More... | |
| void | setRollingXWindow (double width) |
| Sets a rolling X-axis window width; 0 disables rolling range. More... | |
| double | rollingXWindow () const |
| Returns the rolling X-axis window width. More... | |
| void | setAutoRange (bool enabled) |
| Enables or disables automatic range calculation. More... | |
| bool | autoRange () const |
| Returns true when ranges are calculated from data. More... | |
| void | setXRange (PlotRange range) |
| Sets the manual X-axis range. More... | |
| void | setYRange (PlotRange range) |
| Sets the manual Y-axis range. More... | |
| PlotRange | xRange () const |
| Returns the current X-axis range. More... | |
| PlotRange | yRange () const |
| Returns the current Y-axis range. More... | |
| void | setSeriesStyle (size_t seriesIndex, PlotSeriesStyle style) |
| Updates the rendering style for one series. More... | |
| PlotModelSnapshot | snapshot () const |
| Returns an immutable model snapshot for rendering. More... | |
Public Member Functions inherited from RADCore::RADObject | |
| RADObject () | |
| Creates a RADObject bound to the current thread. More... | |
| virtual | ~RADObject () |
| Disconnects tracked event links and releases lifetime token. More... | |
| void | registerLink (const ConnectionRecord &record) |
| Registers a connection for cleanup when this object is destroyed. More... | |
| std::thread::id | threadId () const |
| Returns the thread id this object is currently associated with. More... | |
| EventLoop * | associatedEventLoop () const |
| Returns the associated event loop, if any. More... | |
| ThreadAffinity | threadAffinity () const |
| Returns both thread id and associated loop atomically. More... | |
| std::weak_ptr< void > | lifetimeToken () const |
| Returns a weak token used to drop queued callbacks after destruction. More... | |
| void | moveToThread (std::thread::id tId, EventLoop *loop=nullptr) |
| Moves the object's affinity to tId and optional loop. More... | |
Public Attributes | |
| RADCore::Event< void() > | dataChanged |
| Raised when series data, ranges, or styles change. More... | |
Mutable X/Y plot data model that emits dataChanged on edits.
| RADUi::PlotModel::PlotModel | ( | ) |
Creates an empty plot model.
|
override |
Destroys the model implementation.
| size_t RADUi::PlotModel::addSeries | ( | std::string | name, |
| PlotSeriesStyle | style = {} |
||
| ) |
Adds a named series and returns its index.
| void RADUi::PlotModel::append | ( | size_t | seriesIndex, |
| double | x, | ||
| double | y | ||
| ) |
Appends one X/Y point to a series.
| void RADUi::PlotModel::append | ( | size_t | seriesIndex, |
| PlotPoint | point | ||
| ) |
Appends one point to a series.
| void RADUi::PlotModel::appendBatch | ( | size_t | seriesIndex, |
| const std::vector< PlotPoint > & | points | ||
| ) |
Appends a batch of points to a series.
| bool RADUi::PlotModel::autoRange | ( | ) | const |
Returns true when ranges are calculated from data.
| void RADUi::PlotModel::clear | ( | ) |
Removes all series data.
| void RADUi::PlotModel::clearSeries | ( | size_t | seriesIndex | ) |
Removes all points from one series.
| size_t RADUi::PlotModel::maxPointCount | ( | ) | const |
Returns the maximum retained points per series.
| double RADUi::PlotModel::rollingXWindow | ( | ) | const |
Returns the rolling X-axis window width.
| size_t RADUi::PlotModel::seriesCount | ( | ) | const |
Returns the number of series in the model.
| void RADUi::PlotModel::setAutoRange | ( | bool | enabled | ) |
Enables or disables automatic range calculation.
| void RADUi::PlotModel::setMaxPointCount | ( | size_t | maxPointCount | ) |
Sets the maximum retained points per series; 0 means unlimited.
| void RADUi::PlotModel::setRollingXWindow | ( | double | width | ) |
Sets a rolling X-axis window width; 0 disables rolling range.
| void RADUi::PlotModel::setSeriesStyle | ( | size_t | seriesIndex, |
| PlotSeriesStyle | style | ||
| ) |
Updates the rendering style for one series.
| void RADUi::PlotModel::setXRange | ( | PlotRange | range | ) |
Sets the manual X-axis range.
| void RADUi::PlotModel::setYRange | ( | PlotRange | range | ) |
Sets the manual Y-axis range.
| PlotModelSnapshot RADUi::PlotModel::snapshot | ( | ) | const |
Returns an immutable model snapshot for rendering.
| PlotRange RADUi::PlotModel::xRange | ( | ) | const |
Returns the current X-axis range.
| PlotRange RADUi::PlotModel::yRange | ( | ) | const |
Returns the current Y-axis range.
| RADCore::Event<void () > RADUi::PlotModel::dataChanged |
Raised when series data, ranges, or styles change.