Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_raster_data.cpp


Ignore:
Timestamp:
Nov 3, 2026, 10:53:35 AM (3 weeks ago)
Author:
stuerze
Message:

deprecated functions exchanged libs updated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/qwt/qwt_raster_data.cpp

    r9383 r11158  
    1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
     1/******************************************************************************
    22 * Qwt Widget Library
    33 * Copyright (C) 1997   Josef Wilgen
    … …  
    1010#include "qwt_raster_data.h"
    1111#include "qwt_point_3d.h"
     12#include "qwt_interval.h"
     13
     14#include <qrect.h>
     15#include <qpolygon.h>
    1216#include <qnumeric.h>
     17#include <qlist.h>
     18#include <qmap.h>
    1319
    1420class QwtRasterData::ContourPlane
    1521{
    16 public:
    17     inline ContourPlane( double z ):
    18         d_z( z )
     22  public:
     23    explicit inline ContourPlane( double z ):
     24        m_z( z )
    1925    {
    2026    }
    … …  
    2329        QPointF line[2], bool ignoreOnPlane ) const;
    2430
    25     inline double z() const { return d_z; }
    26 
    27 private:
     31    inline double z() const { return m_z; }
     32
     33  private:
    2834    inline int compare( double z ) const;
    2935    inline QPointF intersection(
    30         const QwtPoint3D& p1, const QwtPoint3D &p2 ) const;
    31 
    32     double d_z;
     36        const QwtPoint3D& p1, const QwtPoint3D& p2 ) const;
     37
     38    double m_z;
    3339};
    3440
    … …  
    6571    };
    6672
    67     const int edgeType = tab[eq1+1][eq2+1][eq3+1];
     73    const int edgeType = tab[eq1 + 1][eq2 + 1][eq3 + 1];
    6874    switch ( edgeType )
    6975    {
    … …  
    135141inline int QwtRasterData::ContourPlane::compare( double z ) const
    136142{
    137     if ( z > d_z )
     143    if ( z > m_z )
    138144        return 1;
    139145
    140     if ( z < d_z )
     146    if ( z < m_z )
    141147        return -1;
    142148
    … …  
    145151
    146152inline QPointF QwtRasterData::ContourPlane::intersection(
    147     const QwtPoint3D& p1, const QwtPoint3D &p2 ) const
    148 {
    149     const double h1 = p1.z() - d_z;
    150     const double h2 = p2.z() - d_z;
     153    const QwtPoint3D& p1, const QwtPoint3D& p2 ) const
     154{
     155    const double h1 = p1.z() - m_z;
     156    const double h2 = p2.z() - m_z;
    151157
    152158    const double x = ( h2 * p1.x() - h1 * p2.x() ) / ( h2 - h1 );
    … …  
    156162}
    157163
     164class QwtRasterData::PrivateData
     165{
     166  public:
     167    QwtRasterData::Attributes attributes;
     168};
     169
    158170//! Constructor
    159171QwtRasterData::QwtRasterData()
    160172{
     173    m_data = new PrivateData();
    161174}
    162175
    … …  
    164177QwtRasterData::~QwtRasterData()
    165178{
    166 }
    167 
    168 /*!
    169    Set the bounding interval for the x, y or z coordinates.
    170 
    171    \param axis Axis
    172    \param interval Bounding interval
    173 
    174    \sa interval()
    175 */
    176 void QwtRasterData::setInterval( Qt::Axis axis, const QwtInterval &interval )
    177 {
    178     d_intervals[axis] = interval;
    179 }
    180 
    181 /*!
    182   \brief Initialize a raster
    183 
    184   Before the composition of an image QwtPlotSpectrogram calls initRaster(),
    185   announcing the area and its resolution that will be requested.
    186 
    187   The default implementation does nothing, but for data sets that
    188   are stored in files, it might be good idea to reimplement initRaster(),
    189   where the data is resampled and loaded into memory.
    190 
    191   \param area Area of the raster
    192   \param raster Number of horizontal and vertical pixels
    193 
    194   \sa initRaster(), value()
    195 */
    196 void QwtRasterData::initRaster( const QRectF &area, const QSize &raster )
     179    delete m_data;
     180}
     181
     182/*!
     183   Specify an attribute of the data
     184
     185   \param attribute Attribute
     186   \param on On/Off
     187   /sa Attribute, testAttribute()
     188 */
     189void QwtRasterData::setAttribute( Attribute attribute, bool on )
     190{
     191    if ( on )
     192        m_data->attributes |= attribute;
     193    else
     194        m_data->attributes &= ~attribute;
     195}
     196
     197/*!
     198    \return True, when attribute is enabled
     199    \sa Attribute, setAttribute()
     200 */
     201bool QwtRasterData::testAttribute( Attribute attribute ) const
     202{
     203    return m_data->attributes & attribute;
     204}
     205
     206/*!
     207   \brief Initialize a raster
     208
     209   Before the composition of an image QwtPlotSpectrogram calls initRaster(),
     210   announcing the area and its resolution that will be requested.
     211
     212   The default implementation does nothing, but for data sets that
     213   are stored in files, it might be good idea to reimplement initRaster(),
     214   where the data is resampled and loaded into memory.
     215
     216   \param area Area of the raster
     217   \param raster Number of horizontal and vertical pixels
     218
     219   \sa initRaster(), value()
     220 */
     221void QwtRasterData::initRaster( const QRectF& area, const QSize& raster )
    197222{
    198223    Q_UNUSED( area );
    … …  
    201226
    202227/*!
    203   \brief Discard a raster
    204 
    205   After the composition of an image QwtPlotSpectrogram calls discardRaster().
    206 
    207   The default implementation does nothing, but if data has been loaded
    208   in initRaster(), it could deleted now.
    209 
    210   \sa initRaster(), value()
    211 */
     228   \brief Discard a raster
     229
     230   After the composition of an image QwtPlotSpectrogram calls discardRaster().
     231
     232   The default implementation does nothing, but if data has been loaded
     233   in initRaster(), it could deleted now.
     234
     235   \sa initRaster(), value()
     236 */
    212237void QwtRasterData::discardRaster()
    213238{
    … …  
    239264
    240265   \return Bounding rectangle of a pixel
    241 */
    242 QRectF QwtRasterData::pixelHint( const QRectF &area ) const
     266 */
     267QRectF QwtRasterData::pixelHint( const QRectF& area ) const
    243268{
    244269    Q_UNUSED( area );
    … …  
    258283   An adaption of CONREC, a simple contouring algorithm.
    259284   http://local.wasp.uwa.edu.au/~pbourke/papers/conrec/
    260 */
     285 */
    261286QwtRasterData::ContourLines QwtRasterData::contourLines(
    262     const QRectF &rect, const QSize &raster,
    263     const QList<double> &levels, ConrecFlags flags ) const
     287    const QRectF& rect, const QSize& raster,
     288    const QList< double >& levels, ConrecFlags flags ) const
    264289{
    265290    ContourLines contourLines;
    … …  
    279304        ignoreOutOfRange = flags & IgnoreOutOfRange;
    280305
    281     QwtRasterData *that = const_cast<QwtRasterData *>( this );
     306    QwtRasterData* that = const_cast< QwtRasterData* >( this );
    282307    that->initRaster( rect, raster );
    283 
    284 #if __GNUC__ >= 9
    285 #pragma GCC diagnostic push
    286 #pragma GCC diagnostic ignored "-Wdeprecated-copy"
    287 #endif
    288308
    289309    for ( int y = 0; y < raster.height() - 1; y++ )
    … …  
    313333                xy[TopRight].setZ(
    314334                    value( xy[TopRight].x(), xy[TopRight].y() )
    315                 );
     335                    );
    316336
    317337                xy[BottomRight].setX( pos.x() );
    … …  
    319339                xy[BottomRight].setZ(
    320340                    value( xy[BottomRight].x(), xy[BottomRight].y() )
    321                 );
     341                    );
    322342            }
    323343
    … …  
    332352            xy[TopRight].setZ(
    333353                value( xy[TopRight].x(), xy[TopRight].y() )
    334             );
     354                );
    335355            xy[BottomRight].setZ(
    336356                value( xy[BottomRight].x(), xy[BottomRight].y() )
    337             );
     357                );
    338358
    339359            double zMin = xy[TopLeft].z();
    … …  
    380400                if ( level < zMin || level > zMax )
    381401                    continue;
    382                 QPolygonF &lines = contourLines[level];
     402                QPolygonF& lines = contourLines[level];
    383403                const ContourPlane plane( level );
    384404
    … …  
    404424    }
    405425
    406 #if __GNUC__ >= 9
    407 #pragma GCC diagnostic pop
    408 #endif
    409 
    410426    that->discardRaster();
    411427
Note: See TracChangeset for help on using the changeset viewer.