Index: trunk/BNC/qwt/qwt_plot_spectrocurve.cpp
===================================================================
--- trunk/BNC/qwt/qwt_plot_spectrocurve.cpp	(revision 9383)
+++ trunk/BNC/qwt/qwt_plot_spectrocurve.cpp	(revision 11158)
@@ -1,3 +1,3 @@
-/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
+/******************************************************************************
  * Qwt Widget Library
  * Copyright (C) 1997   Josef Wilgen
@@ -12,13 +12,15 @@
 #include "qwt_scale_map.h"
 #include "qwt_painter.h"
+#include "qwt_text.h"
+
 #include <qpainter.h>
 
 class QwtPlotSpectroCurve::PrivateData
 {
-public:
-    PrivateData():
-        colorRange( 0.0, 1000.0 ),
-        penWidth(0.0),
-        paintAttributes( QwtPlotSpectroCurve::ClipPoints )
+  public:
+    PrivateData()
+        : colorRange( 0.0, 1000.0 )
+        , penWidth( 0.0 )
+        , paintAttributes( QwtPlotSpectroCurve::ClipPoints )
     {
         colorMap = new QwtLinearColorMap();
@@ -30,7 +32,7 @@
     }
 
-    QwtColorMap *colorMap;
+    QwtColorMap* colorMap;
     QwtInterval colorRange;
-    QVector<QRgb> colorTable;
+    QVector< QRgb > colorTable;
     double penWidth;
     QwtPlotSpectroCurve::PaintAttributes paintAttributes;
@@ -38,9 +40,9 @@
 
 /*!
-  Constructor
-  \param title Title of the curve
-*/
-QwtPlotSpectroCurve::QwtPlotSpectroCurve( const QwtText &title ):
-    QwtPlotSeriesItem( title )
+   Constructor
+   \param title Title of the curve
+ */
+QwtPlotSpectroCurve::QwtPlotSpectroCurve( const QwtText& title )
+    : QwtPlotSeriesItem( title )
 {
     init();
@@ -48,9 +50,9 @@
 
 /*!
-  Constructor
-  \param title Title of the curve
-*/
-QwtPlotSpectroCurve::QwtPlotSpectroCurve( const QString &title ):
-    QwtPlotSeriesItem( QwtText( title ) )
+   Constructor
+   \param title Title of the curve
+ */
+QwtPlotSpectroCurve::QwtPlotSpectroCurve( const QString& title )
+    : QwtPlotSeriesItem( QwtText( title ) )
 {
     init();
@@ -60,10 +62,10 @@
 QwtPlotSpectroCurve::~QwtPlotSpectroCurve()
 {
-    delete d_data;
-}
-
-/*!
-  \brief Initialize data members
-*/
+    delete m_data;
+}
+
+/*!
+   \brief Initialize data members
+ */
 void QwtPlotSpectroCurve::init()
 {
@@ -71,5 +73,5 @@
     setItemAttribute( QwtPlotItem::AutoScale );
 
-    d_data = new PrivateData;
+    m_data = new PrivateData;
     setData( new QwtPoint3DSeriesData() );
 
@@ -84,16 +86,16 @@
 
 /*!
-  Specify an attribute how to draw the curve
-
-  \param attribute Paint attribute
-  \param on On/Off
-  /sa PaintAttribute, testPaintAttribute()
-*/
+   Specify an attribute how to draw the curve
+
+   \param attribute Paint attribute
+   \param on On/Off
+   /sa PaintAttribute, testPaintAttribute()
+ */
 void QwtPlotSpectroCurve::setPaintAttribute( PaintAttribute attribute, bool on )
 {
     if ( on )
-        d_data->paintAttributes |= attribute;
+        m_data->paintAttributes |= attribute;
     else
-        d_data->paintAttributes &= ~attribute;
+        m_data->paintAttributes &= ~attribute;
 }
 
@@ -101,15 +103,15 @@
     \return True, when attribute is enabled
     \sa PaintAttribute, setPaintAttribute()
-*/
+ */
 bool QwtPlotSpectroCurve::testPaintAttribute( PaintAttribute attribute ) const
 {
-    return ( d_data->paintAttributes & attribute );
-}
-
-/*!
-  Initialize data with an array of samples.
-  \param samples Vector of points
-*/
-void QwtPlotSpectroCurve::setSamples( const QVector<QwtPoint3D> &samples )
+    return ( m_data->paintAttributes & attribute );
+}
+
+/*!
+   Initialize data with an array of samples.
+   \param samples Vector of points
+ */
+void QwtPlotSpectroCurve::setSamples( const QVector< QwtPoint3D >& samples )
 {
     setData( new QwtPoint3DSeriesData( samples ) );
@@ -117,15 +119,15 @@
 
 /*!
-  Assign a series of samples
-
-  setSamples() is just a wrapper for setData() without any additional
-  value - beside that it is easier to find for the developer.
-
-  \param data Data
-  \warning The item takes ownership of the data object, deleting
+   Assign a series of samples
+
+   setSamples() is just a wrapper for setData() without any additional
+   value - beside that it is easier to find for the developer.
+
+   \param data Data
+   \warning The item takes ownership of the data object, deleting
            it when its not used anymore.
-*/
+ */
 void QwtPlotSpectroCurve::setSamples(
-    QwtSeriesData<QwtPoint3D> *data )
+    QwtSeriesData< QwtPoint3D >* data )
 {
     setData( data );
@@ -133,20 +135,20 @@
 
 /*!
-  Change the color map
-
-  Often it is useful to display the mapping between intensities and
-  colors as an additional plot axis, showing a color bar.
-
-  \param colorMap Color Map
-
-  \sa colorMap(), setColorRange(), QwtColorMap::color(),
+   Change the color map
+
+   Often it is useful to display the mapping between intensities and
+   colors as an additional plot axis, showing a color bar.
+
+   \param colorMap Color Map
+
+   \sa colorMap(), setColorRange(), QwtColorMap::color(),
       QwtScaleWidget::setColorBarEnabled(), QwtScaleWidget::setColorMap()
-*/
-void QwtPlotSpectroCurve::setColorMap( QwtColorMap *colorMap )
-{
-    if ( colorMap != d_data->colorMap )
-    {
-        delete d_data->colorMap;
-        d_data->colorMap = colorMap;
+ */
+void QwtPlotSpectroCurve::setColorMap( QwtColorMap* colorMap )
+{
+    if ( colorMap != m_data->colorMap )
+    {
+        delete m_data->colorMap;
+        m_data->colorMap = colorMap;
     }
 
@@ -158,8 +160,8 @@
    \return Color Map used for mapping the intensity values to colors
    \sa setColorMap(), setColorRange(), QwtColorMap::color()
-*/
-const QwtColorMap *QwtPlotSpectroCurve::colorMap() const
-{
-    return d_data->colorMap;
+ */
+const QwtColorMap* QwtPlotSpectroCurve::colorMap() const
+{
+    return m_data->colorMap;
 }
 
@@ -171,10 +173,10 @@
 
    \sa colorRange(), setColorMap(), QwtColorMap::color()
-*/
-void QwtPlotSpectroCurve::setColorRange( const QwtInterval &interval )
-{
-    if ( interval != d_data->colorRange )
-    {
-        d_data->colorRange = interval;
+ */
+void QwtPlotSpectroCurve::setColorRange( const QwtInterval& interval )
+{
+    if ( interval != m_data->colorRange )
+    {
+        m_data->colorRange = interval;
 
         legendChanged();
@@ -184,18 +186,18 @@
 
 /*!
-  \return Value interval, that corresponds to the color map
-  \sa setColorRange(), setColorMap(), QwtColorMap::color()
-*/
-QwtInterval &QwtPlotSpectroCurve::colorRange() const
-{
-    return d_data->colorRange;
-}
-
-/*!
-  Assign a pen width
-
-  \param penWidth New pen width
-  \sa penWidth()
-*/
+   \return Value interval, that corresponds to the color map
+   \sa setColorRange(), setColorMap(), QwtColorMap::color()
+ */
+QwtInterval& QwtPlotSpectroCurve::colorRange() const
+{
+    return m_data->colorRange;
+}
+
+/*!
+   Assign a pen width
+
+   \param penWidth New pen width
+   \sa penWidth()
+ */
 void QwtPlotSpectroCurve::setPenWidth(double penWidth)
 {
@@ -203,7 +205,7 @@
         penWidth = 0.0;
 
-    if ( d_data->penWidth != penWidth )
-    {
-        d_data->penWidth = penWidth;
+    if ( m_data->penWidth != penWidth )
+    {
+        m_data->penWidth = penWidth;
 
         legendChanged();
@@ -213,28 +215,28 @@
 
 /*!
-  \return Pen width used to draw a dot
-  \sa setPenWidth()
-*/
+   \return Pen width used to draw a dot
+   \sa setPenWidth()
+ */
 double QwtPlotSpectroCurve::penWidth() const
 {
-    return d_data->penWidth;
-}
-
-/*!
-  Draw a subset of the points
-
-  \param painter Painter
-  \param xMap Maps x-values into pixel coordinates.
-  \param yMap Maps y-values into pixel coordinates.
-  \param canvasRect Contents rectangle of the canvas
-  \param from Index of the first sample to be painted
-  \param to Index of the last sample to be painted. If to < 0 the
+    return m_data->penWidth;
+}
+
+/*!
+   Draw a subset of the points
+
+   \param painter Painter
+   \param xMap Maps x-values into pixel coordinates.
+   \param yMap Maps y-values into pixel coordinates.
+   \param canvasRect Contents rectangle of the canvas
+   \param from Index of the first sample to be painted
+   \param to Index of the last sample to be painted. If to < 0 the
          series will be painted to its last sample.
 
-  \sa drawDots()
-*/
-void QwtPlotSpectroCurve::drawSeries( QPainter *painter,
-    const QwtScaleMap &xMap, const QwtScaleMap &yMap,
-    const QRectF &canvasRect, int from, int to ) const
+   \sa drawDots()
+ */
+void QwtPlotSpectroCurve::drawSeries( QPainter* painter,
+    const QwtScaleMap& xMap, const QwtScaleMap& yMap,
+    const QRectF& canvasRect, int from, int to ) const
 {
     if ( !painter || dataSize() <= 0 )
@@ -254,30 +256,30 @@
 
 /*!
-  Draw a subset of the points
-
-  \param painter Painter
-  \param xMap Maps x-values into pixel coordinates.
-  \param yMap Maps y-values into pixel coordinates.
-  \param canvasRect Contents rectangle of the canvas
-  \param from Index of the first sample to be painted
-  \param to Index of the last sample to be painted. If to < 0 the
+   Draw a subset of the points
+
+   \param painter Painter
+   \param xMap Maps x-values into pixel coordinates.
+   \param yMap Maps y-values into pixel coordinates.
+   \param canvasRect Contents rectangle of the canvas
+   \param from Index of the first sample to be painted
+   \param to Index of the last sample to be painted. If to < 0 the
          series will be painted to its last sample.
 
-  \sa drawSeries()
-*/
-void QwtPlotSpectroCurve::drawDots( QPainter *painter,
-    const QwtScaleMap &xMap, const QwtScaleMap &yMap,
-    const QRectF &canvasRect, int from, int to ) const
-{
-    if ( !d_data->colorRange.isValid() )
+   \sa drawSeries()
+ */
+void QwtPlotSpectroCurve::drawDots( QPainter* painter,
+    const QwtScaleMap& xMap, const QwtScaleMap& yMap,
+    const QRectF& canvasRect, int from, int to ) const
+{
+    if ( !m_data->colorRange.isValid() )
         return;
 
     const bool doAlign = QwtPainter::roundingAlignment( painter );
 
-    const QwtColorMap::Format format = d_data->colorMap->format();
+    const QwtColorMap::Format format = m_data->colorMap->format();
     if ( format == QwtColorMap::Indexed )
-        d_data->colorTable = d_data->colorMap->colorTable( d_data->colorRange );
-
-    const QwtSeriesData<QwtPoint3D> *series = data();
+        m_data->colorTable = m_data->colorMap->colorTable256();
+
+    const QwtSeriesData< QwtPoint3D >* series = data();
 
     for ( int i = from; i <= to; i++ )
@@ -293,5 +295,5 @@
         }
 
-        if ( d_data->paintAttributes & QwtPlotSpectroCurve::ClipPoints )
+        if ( m_data->paintAttributes & QwtPlotSpectroCurve::ClipPoints )
         {
             if ( !canvasRect.contains( xi, yi ) )
@@ -301,16 +303,16 @@
         if ( format == QwtColorMap::RGB )
         {
-            const QRgb rgb = d_data->colorMap->rgb(
-                d_data->colorRange, sample.z() );
-
-            painter->setPen( QPen( QColor::fromRgba( rgb ), d_data->penWidth ) );
+            const QRgb rgb = m_data->colorMap->rgb(
+                m_data->colorRange, sample.z() );
+
+            painter->setPen( QPen( QColor::fromRgba( rgb ), m_data->penWidth ) );
         }
         else
         {
-            const unsigned char index = d_data->colorMap->colorIndex(
-                d_data->colorRange, sample.z() );
-
-            painter->setPen( QPen( QColor::fromRgba( d_data->colorTable[index] ),
-                d_data->penWidth ) );
+            const unsigned char index = m_data->colorMap->colorIndex(
+                256, m_data->colorRange, sample.z() );
+
+            painter->setPen( QPen( QColor::fromRgba( m_data->colorTable[index] ),
+                m_data->penWidth ) );
         }
 
@@ -318,4 +320,4 @@
     }
 
-    d_data->colorTable.clear();
-}
+    m_data->colorTable.clear();
+}
