Index: trunk/BNC/qwt/qwt_series_data.cpp
===================================================================
--- trunk/BNC/qwt/qwt_series_data.cpp	(revision 9383)
+++ trunk/BNC/qwt/qwt_series_data.cpp	(revision 11158)
@@ -1,3 +1,3 @@
-/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+/******************************************************************************
  * Qwt Widget Library
  * Copyright (C) 1997   Josef Wilgen
@@ -9,22 +9,22 @@
 
 #include "qwt_series_data.h"
-#include "qwt_math.h"
-
-static inline QRectF qwtBoundingRect( const QPointF &sample )
+#include "qwt_point_polar.h"
+
+static inline QRectF qwtBoundingRect( const QPointF& sample )
 {
     return QRectF( sample.x(), sample.y(), 0.0, 0.0 );
 }
 
-static inline QRectF qwtBoundingRect( const QwtPoint3D &sample )
+static inline QRectF qwtBoundingRect( const QwtPoint3D& sample )
 {
     return QRectF( sample.x(), sample.y(), 0.0, 0.0 );
 }
 
-static inline QRectF qwtBoundingRect( const QwtPointPolar &sample )
+static inline QRectF qwtBoundingRect( const QwtPointPolar& sample )
 {
     return QRectF( sample.azimuth(), sample.radius(), 0.0, 0.0 );
 }
 
-static inline QRectF qwtBoundingRect( const QwtIntervalSample &sample )
+static inline QRectF qwtBoundingRect( const QwtIntervalSample& sample )
 {
     return QRectF( sample.interval.minValue(), sample.value,
@@ -32,5 +32,5 @@
 }
 
-static inline QRectF qwtBoundingRect( const QwtSetSample &sample )
+static inline QRectF qwtBoundingRect( const QwtSetSample& sample )
 {
     if ( sample.set.empty() )
@@ -52,5 +52,5 @@
 }
 
-static inline QRectF qwtBoundingRect( const QwtOHLCSample &sample )
+static inline QRectF qwtBoundingRect( const QwtOHLCSample& sample )
 {
     const QwtInterval interval = sample.boundingInterval();
@@ -58,19 +58,30 @@
 }
 
-/*!
-  \brief Calculate the bounding rectangle of a series subset
-
-  Slow implementation, that iterates over the series.
-
-  \param series Series
-  \param from Index of the first sample, <= 0 means from the beginning
-  \param to Index of the last sample, < 0 means to the end
-
-  \return Bounding rectangle
-*/
-
-template <class T>
-QRectF qwtBoundingRectT(
-    const QwtSeriesData<T>& series, int from, int to )
+static inline QRectF qwtBoundingRect( const QwtVectorFieldSample& sample )
+{
+    /*
+        When displaying a sample as an arrow its length will be
+        proportional to the magnitude - but not the same.
+        As the factor between length and magnitude is not known
+        we can't include vx/vy into the bounding rectangle.
+     */
+
+    return QRectF( sample.x, sample.y, 0, 0 );
+}
+
+/*!
+   \brief Calculate the bounding rectangle of a series subset
+
+   Slow implementation, that iterates over the series.
+
+   \param series Series
+   \param from Index of the first sample, <= 0 means from the beginning
+   \param to Index of the last sample, < 0 means to the end
+
+   \return Bounding rectangle
+ */
+
+template< class T >
+QRectF qwtBoundingRectT( const QwtSeriesData< T >& series, int from, int to )
 {
     QRectF boundingRect( 1.0, 1.0, -2.0, -2.0 ); // invalid;
@@ -113,235 +124,121 @@
 
 /*!
-  \brief Calculate the bounding rectangle of a series subset
-
-  Slow implementation, that iterates over the series.
-
-  \param series Series
-  \param from Index of the first sample, <= 0 means from the beginning
-  \param to Index of the last sample, < 0 means to the end
-
-  \return Bounding rectangle
-*/
-QRectF qwtBoundingRect(
-    const QwtSeriesData<QPointF> &series, int from, int to )
-{
-    return qwtBoundingRectT<QPointF>( series, from, to );
-}
-
-/*!
-  \brief Calculate the bounding rectangle of a series subset
-
-  Slow implementation, that iterates over the series.
-
-  \param series Series
-  \param from Index of the first sample, <= 0 means from the beginning
-  \param to Index of the last sample, < 0 means to the end
-
-  \return Bounding rectangle
-*/
-QRectF qwtBoundingRect(
-    const QwtSeriesData<QwtPoint3D> &series, int from, int to )
-{
-    return qwtBoundingRectT<QwtPoint3D>( series, from, to );
-}
-
-/*!
-  \brief 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.
-
-  \param series Series
-  \param from Index of the first sample, <= 0 means from the beginning
-  \param to Index of the last sample, < 0 means to the end
-
-  \return Bounding rectangle
-*/
-QRectF qwtBoundingRect(
-    const QwtSeriesData<QwtPointPolar> &series, int from, int to )
-{
-    return qwtBoundingRectT<QwtPointPolar>( series, from, to );
-}
-
-/*!
-  \brief Calculate the bounding rectangle of a series subset
-
-  Slow implementation, that iterates over the series.
-
-  \param series Series
-  \param from Index of the first sample, <= 0 means from the beginning
-  \param to Index of the last sample, < 0 means to the end
-
-  \return Bounding rectangle
-*/
-QRectF qwtBoundingRect(
-    const QwtSeriesData<QwtIntervalSample>& series, int from, int to )
-{
-    return qwtBoundingRectT<QwtIntervalSample>( series, from, to );
-}
-
-/*!
-  \brief Calculate the bounding rectangle of a series subset
-
-  Slow implementation, that iterates over the series.
-
-  \param series Series
-  \param from Index of the first sample, <= 0 means from the beginning
-  \param to Index of the last sample, < 0 means to the end
-
-  \return Bounding rectangle
-*/
-QRectF qwtBoundingRect(
-    const QwtSeriesData<QwtOHLCSample>& series, int from, int to )
-{
-    return qwtBoundingRectT<QwtOHLCSample>( series, from, to );
-}
-
-/*!
-  \brief Calculate the bounding rectangle of a series subset
-
-  Slow implementation, that iterates over the series.
-
-  \param series Series
-  \param from Index of the first sample, <= 0 means from the beginning
-  \param to Index of the last sample, < 0 means to the end
-
-  \return Bounding rectangle
-*/
-QRectF qwtBoundingRect(
-    const QwtSeriesData<QwtSetSample>& series, int from, int to )
-{
-    return qwtBoundingRectT<QwtSetSample>( series, from, to );
-}
-
-/*!
-   Constructor
-   \param samples Samples
-*/
-QwtPointSeriesData::QwtPointSeriesData(
-        const QVector<QPointF> &samples ):
-    QwtArraySeriesData<QPointF>( samples )
-{
-}
-
-/*!
-  \brief Calculate the bounding rectangle
-
-  The bounding rectangle is calculated once by iterating over all
-  points and is stored for all following requests.
-
-  \return Bounding rectangle
-*/
-QRectF QwtPointSeriesData::boundingRect() const
-{
-    if ( d_boundingRect.width() < 0.0 )
-        d_boundingRect = qwtBoundingRect( *this );
-
-    return d_boundingRect;
-}
-
-/*!
-   Constructor
-   \param samples Samples
-*/
-QwtPoint3DSeriesData::QwtPoint3DSeriesData(
-        const QVector<QwtPoint3D> &samples ):
-    QwtArraySeriesData<QwtPoint3D>( samples )
-{
-}
-
-/*!
-  \brief Calculate the bounding rectangle
-
-  The bounding rectangle is calculated once by iterating over all
-  points and is stored for all following requests.
-
-  \return Bounding rectangle
-*/
-QRectF QwtPoint3DSeriesData::boundingRect() const
-{
-    if ( d_boundingRect.width() < 0.0 )
-        d_boundingRect = qwtBoundingRect( *this );
-
-    return d_boundingRect;
-}
-
-/*!
-   Constructor
-   \param samples Samples
-*/
-QwtIntervalSeriesData::QwtIntervalSeriesData(
-        const QVector<QwtIntervalSample> &samples ):
-    QwtArraySeriesData<QwtIntervalSample>( samples )
-{
-}
-
-/*!
-  \brief Calculate the bounding rectangle
-
-  The bounding rectangle is calculated once by iterating over all
-  points and is stored for all following requests.
-
-  \return Bounding rectangle
-*/
-QRectF QwtIntervalSeriesData::boundingRect() const
-{
-    if ( d_boundingRect.width() < 0.0 )
-        d_boundingRect = qwtBoundingRect( *this );
-
-    return d_boundingRect;
-}
-
-/*!
-   Constructor
-   \param samples Samples
-*/
-QwtSetSeriesData::QwtSetSeriesData(
-        const QVector<QwtSetSample> &samples ):
-    QwtArraySeriesData<QwtSetSample>( samples )
-{
-}
-
-/*!
-  \brief Calculate the bounding rectangle
-
-  The bounding rectangle is calculated once by iterating over all
-  points and is stored for all following requests.
-
-  \return Bounding rectangle
-*/
-QRectF QwtSetSeriesData::boundingRect() const
-{
-    if ( d_boundingRect.width() < 0.0 )
-        d_boundingRect = qwtBoundingRect( *this );
-
-    return d_boundingRect;
-}
-
-/*!
-   Constructor
-   \param samples Samples
-*/
-QwtTradingChartData::QwtTradingChartData(
-        const QVector<QwtOHLCSample> &samples ):
-    QwtArraySeriesData<QwtOHLCSample>( samples )
-{
-}
-
-/*!
-  \brief Calculate the bounding rectangle
-
-  The bounding rectangle is calculated once by iterating over all
-  points and is stored for all following requests.
-
-  \return Bounding rectangle
-*/
-QRectF QwtTradingChartData::boundingRect() const
-{
-    if ( d_boundingRect.width() < 0.0 )
-        d_boundingRect = qwtBoundingRect( *this );
-
-    return d_boundingRect;
-}
+   \brief Calculate the bounding rectangle of a series subset
+
+   Slow implementation, that iterates over the series.
+
+   \param series Series
+   \param from Index of the first sample, <= 0 means from the beginning
+   \param to Index of the last sample, < 0 means to the end
+
+   \return Bounding rectangle
+ */
+QRectF qwtBoundingRect( const QwtSeriesData< QPointF >& series, int from, int to )
+{
+    return qwtBoundingRectT< QPointF >( series, from, to );
+}
+
+/*!
+   \brief Calculate the bounding rectangle of a series subset
+
+   Slow implementation, that iterates over the series.
+
+   \param series Series
+   \param from Index of the first sample, <= 0 means from the beginning
+   \param to Index of the last sample, < 0 means to the end
+
+   \return Bounding rectangle
+ */
+QRectF qwtBoundingRect(
+    const QwtSeriesData< QwtPoint3D >& series, int from, int to )
+{
+    return qwtBoundingRectT< QwtPoint3D >( series, from, to );
+}
+
+/*!
+   \brief 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.
+
+   \param series Series
+   \param from Index of the first sample, <= 0 means from the beginning
+   \param to Index of the last sample, < 0 means to the end
+
+   \return Bounding rectangle
+ */
+QRectF qwtBoundingRect(
+    const QwtSeriesData< QwtPointPolar >& series, int from, int to )
+{
+    return qwtBoundingRectT< QwtPointPolar >( series, from, to );
+}
+
+/*!
+   \brief Calculate the bounding rectangle of a series subset
+
+   Slow implementation, that iterates over the series.
+
+   \param series Series
+   \param from Index of the first sample, <= 0 means from the beginning
+   \param to Index of the last sample, < 0 means to the end
+
+   \return Bounding rectangle
+ */
+QRectF qwtBoundingRect(
+    const QwtSeriesData< QwtIntervalSample >& series, int from, int to )
+{
+    return qwtBoundingRectT< QwtIntervalSample >( series, from, to );
+}
+
+/*!
+   \brief Calculate the bounding rectangle of a series subset
+
+   Slow implementation, that iterates over the series.
+
+   \param series Series
+   \param from Index of the first sample, <= 0 means from the beginning
+   \param to Index of the last sample, < 0 means to the end
+
+   \return Bounding rectangle
+ */
+QRectF qwtBoundingRect(
+    const QwtSeriesData< QwtOHLCSample >& series, int from, int to )
+{
+    return qwtBoundingRectT< QwtOHLCSample >( series, from, to );
+}
+
+/*!
+   \brief Calculate the bounding rectangle of a series subset
+
+   Slow implementation, that iterates over the series.
+
+   \param series Series
+   \param from Index of the first sample, <= 0 means from the beginning
+   \param to Index of the last sample, < 0 means to the end
+
+   \return Bounding rectangle
+ */
+QRectF qwtBoundingRect(
+    const QwtSeriesData< QwtSetSample >& series, int from, int to )
+{
+    return qwtBoundingRectT< QwtSetSample >( series, from, to );
+}
+
+/*!
+   \brief Calculate the bounding rectangle of a series subset
+
+   Slow implementation, that iterates over the series.
+
+   \param series Series
+   \param from Index of the first sample, <= 0 means from the beginning
+   \param to Index of the last sample, < 0 means to the end
+
+   \return Bounding rectangle
+ */
+QRectF qwtBoundingRect(
+    const QwtSeriesData< QwtVectorFieldSample >& series, int from, int to )
+{
+    return qwtBoundingRectT< QwtVectorFieldSample >( series, from, to );
+}
