10#ifndef QWT_SERIES_DATA_H
11#define QWT_SERIES_DATA_H
13#include "qwt_global.h"
14#include "qwt_samples.h"
15#include "qwt_point_3d.h"
58#ifndef QWT_PYTHON_WRAPPER
61 virtual size_t size()
const = 0;
68 virtual T
sample(
size_t i )
const = 0;
72 virtual size_t size()
const {
return 0; }
73 virtual T
sample(
size_t i )
const {
return T(); }
129template<
typename T >
131 : cachedBoundingRect( 0.0, 0.0, -1.0, -1.0 )
135template<
typename T >
140template<
typename T >
151template<
typename T >
174 virtual size_t size()
const QWT_OVERRIDE;
182 virtual T
sample(
size_t index )
const QWT_OVERRIDE;
189template<
typename T >
194template<
typename T >
196 : m_samples( samples )
200template<
typename T >
207template<
typename T >
213template<
typename T >
216 return m_samples.size();
219template<
typename T >
222 return m_samples[
static_cast< int >( i ) ];
243QWT_EXPORT QRectF qwtBoundingRect(
246QWT_EXPORT QRectF qwtBoundingRect(
249QWT_EXPORT QRectF qwtBoundingRect(
252QWT_EXPORT QRectF qwtBoundingRect(
255QWT_EXPORT QRectF qwtBoundingRect(
258QWT_EXPORT QRectF qwtBoundingRect(
261QWT_EXPORT QRectF qwtBoundingRect(
319template<
typename T,
typename LessThan >
321 double value, LessThan lessThan )
323 const int indexMax = series.
size() - 1;
325 if ( indexMax < 0 || !lessThan( value, series.
sample( indexMax ) ) )
333 const int half = n >> 1;
334 const int indexMid = indexMin + half;
336 if ( lessThan( value, series.
sample( indexMid ) ) )
342 indexMin = indexMid + 1;
Template class for data, that is organized as QVector.
virtual T sample(size_t index) const override
virtual size_t size() const override
QwtArraySeriesData()
Constructor.
void setSamples(const QVector< T > &samples)
QVector< T > m_samples
Vector of samples.
const QVector< T > samples() const
A point in polar coordinates.
Abstract interface for iterating over samples.
virtual void setRectOfInterest(const QRectF &rect)
virtual size_t size() const =0
QwtSeriesData()
Constructor.
virtual ~QwtSeriesData()
Destructor.
QRectF cachedBoundingRect
Can be used to cache a calculated bounding rectangle.
virtual QRectF boundingRect() const
virtual T sample(size_t i) const =0