OpenCurves  0.9
PlotInstanceSampler Class Reference

An adaptor class converting from PlotInstance data to QwtSeriesData. More...

#include <plotinstancesampler.h>

Inheritance diagram for PlotInstanceSampler:

Public Member Functions

 PlotInstanceSampler (const PlotInstance *curveData)
 Create a sampler for the give plot. More...
 
void setCurve (const PlotInstance *curveData)
 Sets the curve, replacing the existing curve.
 
const PlotInstancecurve () const
 Access the curve to sample. More...
 
size_t size () const override
 Returns the number of samples in the PlotInstance. More...
 
QPointF sample (size_t i) const override
 Samples the ith element of the plot. More...
 
QRectF boundingRect () const override
 Overridden to recalculate the as required bounds. More...
 
void invalidateBoundingRect ()
 Invalidate the bounding rectangle, to be recalculated.
 
QRectF calculateBoundingRect (size_t from=0, size_t to=~(size_t)(0u)) const
 Calculate the bounds. More...
 

Detailed Description

An adaptor class converting from PlotInstance data to QwtSeriesData.

The sampler provides two primary functions: adapting the PlotInstance for display in Qwt widgets and resolving the time values for samples as dictated by the PlotSource. This includes accessing the time column, adjusting the time-base and time scaling (in that order).

A PlotInstance must outlive all its samplers.

Constructor & Destructor Documentation

PlotInstanceSampler::PlotInstanceSampler ( const PlotInstance curveData)

Create a sampler for the give plot.

Parameters
curveDataThe plot to sample.

Member Function Documentation

QRectF PlotInstanceSampler::boundingRect ( ) const
override

Overridden to recalculate the as required bounds.

Returns
The curve bounds.
QRectF PlotInstanceSampler::calculateBoundingRect ( size_t  from = 0,
size_t  to = ~(size_t)(0u) 
) const

Calculate the bounds.

Returns
The curve bounds.
const PlotInstance* PlotInstanceSampler::curve ( ) const
inline

Access the curve to sample.

Returns
The curve to sample.
QPointF PlotInstanceSampler::sample ( size_t  i) const
override

Samples the ith element of the plot.

Respects timing conversions.

Parameters
iThe sample number to request: [0, size()).
Returns
The plot sample. The y value is the sample value, while the x value is the sample index or adjusted time.
size_t PlotInstanceSampler::size ( ) const
override

Returns the number of samples in the PlotInstance.

Returns
The curve sample count.

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