Classes | Functions
qwt_series_data.h File Reference
#include "qwt_global.h"
#include "qwt_samples.h"
#include "qwt_point_3d.h"
#include <qvector.h>
#include <qrect.h>
Include dependency graph for qwt_series_data.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  QwtArraySeriesData< T >
 Template class for data, that is organized as QVector. More...
 
class  QwtIntervalSeriesData
 Interface for iterating over an array of intervals. More...
 
class  QwtPoint3DSeriesData
 Interface for iterating over an array of 3D points. More...
 
class  QwtPointSeriesData
 Interface for iterating over an array of points. More...
 
class  QwtSeriesData< T >
 Abstract interface for iterating over samples. More...
 
class  QwtSetSeriesData
 Interface for iterating over an array of samples. More...
 
class  QwtTradingChartData
 
class  QwtVectorFieldData
 

Functions

QWT_EXPORT QRectF qwtBoundingRect (const QwtSeriesData< QPointF > &, int from=0, int to=-1)
 Calculate the bounding rectangle of a series subset. More...
 
QWT_EXPORT QRectF qwtBoundingRect (const QwtSeriesData< QwtPoint3D > &, int from=0, int to=-1)
 Calculate the bounding rectangle of a series subset. More...
 
QWT_EXPORT QRectF qwtBoundingRect (const QwtSeriesData< QwtPointPolar > &, int from=0, int to=-1)
 Calculate the bounding rectangle of a series subset. More...
 
QWT_EXPORT QRectF qwtBoundingRect (const QwtSeriesData< QwtIntervalSample > &, int from=0, int to=-1)
 Calculate the bounding rectangle of a series subset. More...
 
QWT_EXPORT QRectF qwtBoundingRect (const QwtSeriesData< QwtSetSample > &, int from=0, int to=-1)
 Calculate the bounding rectangle of a series subset. More...
 
QWT_EXPORT QRectF qwtBoundingRect (const QwtSeriesData< QwtOHLCSample > &, int from=0, int to=-1)
 Calculate the bounding rectangle of a series subset. More...
 
QWT_EXPORT QRectF qwtBoundingRect (const QwtSeriesData< QwtVectorFieldSample > &, int from=0, int to=-1)
 Calculate the bounding rectangle of a series subset. More...
 
template<typename T , typename LessThan >
int qwtUpperSampleIndex (const QwtSeriesData< T > &series, double value, LessThan lessThan)
 

Function Documentation

QWT_EXPORT QRectF qwtBoundingRect ( const QwtSeriesData< QPointF > &  series,
int  from,
int  to 
)

Calculate the bounding rectangle of a series subset.

Slow implementation, that iterates over the series.

Parameters
seriesSeries
fromIndex of the first sample, <= 0 means from the beginning
toIndex of the last sample, < 0 means to the end
Returns
Bounding rectangle

Definition at line 137 of file qwt_series_data.cpp.

QWT_EXPORT QRectF qwtBoundingRect ( const QwtSeriesData< QwtPoint3D > &  series,
int  from,
int  to 
)

Calculate the bounding rectangle of a series subset.

Slow implementation, that iterates over the series.

Parameters
seriesSeries
fromIndex of the first sample, <= 0 means from the beginning
toIndex of the last sample, < 0 means to the end
Returns
Bounding rectangle

Definition at line 154 of file qwt_series_data.cpp.

QWT_EXPORT QRectF qwtBoundingRect ( const QwtSeriesData< QwtPointPolar > &  series,
int  from,
int  to 
)

Calculate the bounding rectangle of a series subset.

The horizontal coordinates represent the azimuth, the vertical coordinates the radius.

Slow implementation, that iterates over the series.

Parameters
seriesSeries
fromIndex of the first sample, <= 0 means from the beginning
toIndex of the last sample, < 0 means to the end
Returns
Bounding rectangle

Definition at line 174 of file qwt_series_data.cpp.

QWT_EXPORT QRectF qwtBoundingRect ( const QwtSeriesData< QwtIntervalSample > &  series,
int  from,
int  to 
)

Calculate the bounding rectangle of a series subset.

Slow implementation, that iterates over the series.

Parameters
seriesSeries
fromIndex of the first sample, <= 0 means from the beginning
toIndex of the last sample, < 0 means to the end
Returns
Bounding rectangle

Definition at line 191 of file qwt_series_data.cpp.

QWT_EXPORT QRectF qwtBoundingRect ( const QwtSeriesData< QwtSetSample > &  series,
int  from,
int  to 
)

Calculate the bounding rectangle of a series subset.

Slow implementation, that iterates over the series.

Parameters
seriesSeries
fromIndex of the first sample, <= 0 means from the beginning
toIndex of the last sample, < 0 means to the end
Returns
Bounding rectangle

Definition at line 225 of file qwt_series_data.cpp.

QWT_EXPORT QRectF qwtBoundingRect ( const QwtSeriesData< QwtOHLCSample > &  series,
int  from,
int  to 
)

Calculate the bounding rectangle of a series subset.

Slow implementation, that iterates over the series.

Parameters
seriesSeries
fromIndex of the first sample, <= 0 means from the beginning
toIndex of the last sample, < 0 means to the end
Returns
Bounding rectangle

Definition at line 208 of file qwt_series_data.cpp.

QWT_EXPORT QRectF qwtBoundingRect ( const QwtSeriesData< QwtVectorFieldSample > &  series,
int  from,
int  to 
)

Calculate the bounding rectangle of a series subset.

Slow implementation, that iterates over the series.

Parameters
seriesSeries
fromIndex of the first sample, <= 0 means from the beginning
toIndex of the last sample, < 0 means to the end
Returns
Bounding rectangle

Definition at line 242 of file qwt_series_data.cpp.

template<typename T , typename LessThan >
int qwtUpperSampleIndex ( const QwtSeriesData< T > &  series,
double  value,
LessThan  lessThan 
)
inline

Binary search for a sorted series of samples

qwtUpperSampleIndex returns the index of sample that is the upper bound of value. Is the the value smaller than the smallest value the return value will be 0. Is the value greater or equal than the largest value the return value will be -1.

Example
The following example shows finds a point of curve from an x coordinate
1 #include <qwt_series_data.h>
2 #include <qwt_plot_curve.h>
3 
4 struct compareX
5 {
6  inline bool operator()( const double x, const QPointF &pos ) const
7  {
8  return ( x < pos.x() );
9  }
10 };
11 
12 QLineF curveLineAt( const QwtPlotCurve *curve, double x )
13 {
14  int index = qwtUpperSampleIndex<QPointF>(
15  *curve->data(), x, compareX() );
16 
17  if ( index == -1 &&
18  x == curve->sample( curve->dataSize() - 1 ).x() )
19  {
20  // the last sample is excluded from qwtUpperSampleIndex
21  index = curve->dataSize() - 1;
22  }
23 
24  QLineF line; // invalid
25  if ( index > 0 )
26  {
27  line.setP1( curve->sample( index - 1 ) );
28  line.setP2( curve->sample( index ) );
29  }
30 
31  return line;
32 }
Parameters
seriesSeries of samples
valueValue
lessThanCompare operation
Note
The samples must be sorted according to the order specified by the lessThan object

Definition at line 350 of file qwt_series_data.h.



plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 04:02:49