Qwt User's Guide svn
Public Member Functions | Protected Attributes
QwtArraySeriesData< T > Class Template Reference

#include <qwt_series_data.h>

Inherits QwtSeriesData< T >.

List of all members.

Public Member Functions

virtual QRectF boundingRect () const =0
 QwtArraySeriesData ()
 QwtArraySeriesData (const QVector< T > &)
virtual T sample (size_t) const
const QVector< T > samples () const
virtual void setRectOfInterest (const QRectF &)
void setSamples (const QVector< T > &)
virtual size_t size () const

Protected Attributes

QRectF d_boundingRect
QVector< T > d_samples

Detailed Description

template<typename T>
class QwtArraySeriesData< T >

Template class for data, that is organized as QVector.

QVector uses implicit data sharing and can be passed around as argument efficiently.


Constructor & Destructor Documentation

template<typename T >
QwtArraySeriesData< T >::QwtArraySeriesData ( )

Constructor.

template<typename T>
QwtArraySeriesData< T >::QwtArraySeriesData ( const QVector< T > &  samples)

Constructor

Parameters:
samplesArray of samples

Member Function Documentation

template<typename T>
virtual QRectF QwtSeriesData< T >::boundingRect ( ) const [pure virtual, inherited]

Calculate the bounding rect of all samples

The bounding rect is necessary for autoscaling and can be used for a couple of painting optimizations.

qwtBoundingRect(...) offers slow implementations iterating over the samples. For large sets it is recommended to implement something faster f.e. by caching the bounding rect.

Implemented in QwtSyntheticPointData, QwtCPointerData, QwtPointArrayData, QwtSetSeriesData, QwtIntervalSeriesData, QwtPoint3DSeriesData, and QwtPointSeriesData.

template<typename T >
T QwtArraySeriesData< T >::sample ( size_t  i) const [virtual]

Return a sample

Parameters:
iIndex
Returns:
Sample at position i

Implements QwtSeriesData< T >.

template<typename T >
const QVector< T > QwtArraySeriesData< T >::samples ( ) const
Returns:
Array of samples
template<typename T >
void QwtSeriesData< T >::setRectOfInterest ( const QRectF &  ) [virtual, inherited]

Set a the "rect of interest"

QwtPlotSeriesItem defines the current area of the plot canvas as "rect of interest" ( QwtPlotSeriesItem::updateScaleDiv() ). It can be used to implement different levels of details.

The default implementation does nothing.

Reimplemented in QwtSyntheticPointData.

template<typename T>
void QwtArraySeriesData< T >::setSamples ( const QVector< T > &  samples)

Assign an array of samples

Parameters:
samplesArray of samples
template<typename T >
size_t QwtArraySeriesData< T >::size ( ) const [virtual]
Returns:
Number of samples

Implements QwtSeriesData< T >.


Member Data Documentation

template<typename T>
QRectF QwtSeriesData< T >::d_boundingRect [mutable, protected, inherited]

Can be used to cache a calculated bounding rectangle.

template<typename T>
QVector<T> QwtArraySeriesData< T >::d_samples [protected]

Vector of samples.

qmi style