10 #include "qwt_series_data.h" 
   11 #include "qwt_point_polar.h" 
   13 static inline QRectF qwtBoundingRect( 
const QPointF& sample )
 
   15     return QRectF( sample.x(), sample.y(), 0.0, 0.0 );
 
   18 static inline QRectF qwtBoundingRect( 
const QwtPoint3D& sample )
 
   20     return QRectF( sample.
x(), sample.
y(), 0.0, 0.0 );
 
   23 static inline QRectF qwtBoundingRect( 
const QwtPointPolar& sample )
 
   34 static inline QRectF qwtBoundingRect( 
const QwtSetSample& sample )
 
   36     if ( sample.
set.empty() )
 
   37         return QRectF( sample.
value, 0.0, 0.0, -1.0 );
 
   39     double minY = sample.
set[0];
 
   40     double maxY = sample.
set[0];
 
   42     for ( 
int i = 1; i < sample.
set.size(); i++ )
 
   44         if ( sample.
set[i] < minY )
 
   47         if ( sample.
set[i] > maxY )
 
   51     return QRectF( sample.
value, minY, 0.0, maxY - minY );
 
   54 static inline QRectF qwtBoundingRect( 
const QwtOHLCSample& sample )
 
   69     return QRectF( sample.
x, sample.
y, 0, 0 );
 
   87     QRectF boundingRect( 1.0, 1.0, -2.0, -2.0 ); 
 
   93         to = series.
size() - 1;
 
   99     for ( i = from; i <= to; i++ )
 
  101         const QRectF rect = qwtBoundingRect( series.
sample( i ) );
 
  102         if ( rect.width() >= 0.0 && rect.height() >= 0.0 )
 
  110     for ( ; i <= to; i++ )
 
  112         const QRectF rect = qwtBoundingRect( series.
sample( i ) );
 
  113         if ( rect.width() >= 0.0 && rect.height() >= 0.0 )
 
  115             boundingRect.setLeft( qMin( boundingRect.left(), rect.left() ) );
 
  116             boundingRect.setRight( qMax( boundingRect.right(), rect.right() ) );
 
  117             boundingRect.setTop( qMin( boundingRect.top(), rect.top() ) );
 
  118             boundingRect.setBottom( qMax( boundingRect.bottom(), rect.bottom() ) );
 
  138     return qwtBoundingRectT< QPointF >( series, from, to );
 
  152 QRectF qwtBoundingRect(
 
  155     return qwtBoundingRectT< QwtPoint3D >( series, from, to );
 
  172 QRectF qwtBoundingRect(
 
  175     return qwtBoundingRectT< QwtPointPolar >( series, from, to );
 
  189 QRectF qwtBoundingRect(
 
  192     return qwtBoundingRectT< QwtIntervalSample >( series, from, to );
 
  206 QRectF qwtBoundingRect(
 
  209     return qwtBoundingRectT< QwtOHLCSample >( series, from, to );
 
  223 QRectF qwtBoundingRect(
 
  226     return qwtBoundingRectT< QwtSetSample >( series, from, to );
 
  240 QRectF qwtBoundingRect(
 
  243     return qwtBoundingRectT< QwtVectorFieldSample >( series, from, to );
 
Template class for data, that is organized as QVector.
A class representing an interval.
double width() const
Return the width of an interval.
A sample of the types (x1-x2, y) or (x, y1-y2)
QwtInterval interval
Interval.
virtual QRectF boundingRect() const override
Calculate the bounding rectangle.
QwtIntervalSeriesData(const QVector< QwtIntervalSample > &=QVector< QwtIntervalSample >())
Open-High-Low-Close sample used in financial charts.
QwtInterval boundingInterval() const
Calculate the bounding interval of the OHLC values.
QwtPoint3D class defines a 3D point in double coordinates.
QwtPoint3DSeriesData(const QVector< QwtPoint3D > &=QVector< QwtPoint3D >())
virtual QRectF boundingRect() const override
Calculate the bounding rectangle.
A point in polar coordinates.
double radius() const
Returns the radius.
double azimuth() const
Returns the azimuth.
virtual QRectF boundingRect() const override
Calculate the bounding rectangle.
QwtPointSeriesData(const QVector< QPointF > &=QVector< QPointF >())
Abstract interface for iterating over samples.
virtual size_t size() const =0
QRectF cachedBoundingRect
Can be used to cache a calculated bounding rectangle.
virtual T sample(size_t i) const =0
A sample of the types (x1...xn, y) or (x, y1..yn)
QVector< double > set
Vector of values associated to value.
virtual QRectF boundingRect() const override
Calculate the bounding rectangle.
QwtSetSeriesData(const QVector< QwtSetSample > &=QVector< QwtSetSample >())
QwtTradingChartData(const QVector< QwtOHLCSample > &=QVector< QwtOHLCSample >())
virtual QRectF boundingRect() const override
Calculate the bounding rectangle.
QwtVectorFieldData(const QVector< QwtVectorFieldSample > &=QVector< QwtVectorFieldSample >())
virtual QRectF boundingRect() const override
Calculate the bounding rectangle.
Sample used in vector fields.
double y
y coordinate of the position
double x
x coordinate of the position