Qwt User's Guide: QwtArraySeriesData< T > Class Template Reference

Qwt User's Guide 6.0.1

- Main Page
- Related Pages
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Attributes

# QwtArraySeriesData< T > Class Template Reference

Template class for data, that is organized as QVector. More...

`#include <qwt_series_data.h>`

Inheritance diagram for QwtArraySeriesData< T >:
[legend]

List of all members.

## Public Member Functions
virtual QRectF | boundingRect () const =0
| QwtArraySeriesData (const QVector< T > &)
| QwtArraySeriesData ()
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:

  samples | Array 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 QwtPointSeriesData, QwtPoint3DSeriesData, QwtIntervalSeriesData, QwtSetSeriesData, QwtPointArrayData, QwtCPointerData, and QwtSyntheticPointData.

template<typename T >

T QwtArraySeriesData< T >::sample | ( | size_t | i | ) | const`[virtual]`

Return a sample

Parameters:

  i | Index

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:

  samples | Array 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.