Changeset 9383 in ntrip for trunk/BNC/qwt/qwt_point_mapper.cpp


Ignore:
Timestamp:
Mar 19, 2021, 9:15:03 AM (3 years ago)
Author:
stoecker
Message:

update to qwt verion 6.1.1 to fix build with newer Qt5

File:
1 edited

Legend:

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

    r8127 r9383  
    2323
    2424#if !defined(QT_NO_QFUTURE)
    25 #define QWT_USE_THREADS 0
     25#define QWT_USE_THREADS 1
    2626#endif
    2727
     
    4343static void qwtRenderDots(
    4444    const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    45     const QwtDotsCommand command, const QPoint &pos, QImage *image ) 
     45    const QwtDotsCommand command, const QPoint &pos, QImage *image )
    4646{
    4747    const QRgb rgb = command.rgb;
     
    9595
    9696struct QwtNoRoundF
    97 {   
     97{
    9898    inline double operator()( double value )
    9999    {
     
    106106
    107107template<class Polygon, class Point, class Round>
    108 static inline Polygon qwtToPoints( 
     108static inline Polygon qwtToPoints(
    109109    const QRectF &boundingRect,
    110110    const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    111     const QwtSeriesData<QPointF> *series, 
     111    const QwtSeriesData<QPointF> *series,
    112112    int from, int to, Round round )
    113113{
     
    169169    int from, int to )
    170170{
    171     return qwtToPoints<QPolygon, QPoint>( 
     171    return qwtToPoints<QPolygon, QPoint>(
    172172        boundingRect, xMap, yMap, series, from, to, QwtRoundI() );
    173173}
     
    180180    int from, int to, Round round )
    181181{
    182     return qwtToPoints<QPolygonF, QPointF>( 
     182    return qwtToPoints<QPolygonF, QPointF>(
    183183        boundingRect, xMap, yMap, series, from, to, round );
    184184}
     
    188188
    189189template<class Polygon, class Point, class Round>
    190 static inline Polygon qwtToPolylineFiltered( 
    191     const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    192     const QwtSeriesData<QPointF> *series, 
     190static inline Polygon qwtToPolylineFiltered(
     191    const QwtScaleMap &xMap, const QwtScaleMap &yMap,
     192    const QwtSeriesData<QPointF> *series,
    193193    int from, int to, Round round )
    194194{
     
    239239    return qwtToPolylineFiltered<QPolygonF, QPointF>(
    240240        xMap, yMap, series, from, to, round );
    241 } 
     241}
    242242
    243243template<class Polygon, class Point>
     
    283283    return qwtToPointsFiltered<QPolygon, QPoint>(
    284284        boundingRect, xMap, yMap, series, from, to );
    285 } 
     285}
    286286
    287287static inline QPolygonF qwtToPointsFilteredF(
     
    390390
    391391  When the WeedOutPoints flag is enabled consecutive points,
    392   that are mapped to the same position will be one point. 
     392  that are mapped to the same position will be one point.
    393393
    394394  When RoundPoints is set all points are rounded to integers
     
    414414        if ( d_data->flags & RoundPoints )
    415415        {
    416             polyline = qwtToPolylineFilteredF( 
     416            polyline = qwtToPolylineFilteredF(
    417417                xMap, yMap, series, from, to, QwtRoundF() );
    418418        }
    419419        else
    420420        {
    421             polyline = qwtToPolylineFilteredF( 
     421            polyline = qwtToPolylineFilteredF(
    422422                xMap, yMap, series, from, to, QwtNoRoundF() );
    423423        }
     
    427427        if ( d_data->flags & RoundPoints )
    428428        {
    429             polyline = qwtToPointsF( qwtInvalidRect, 
     429            polyline = qwtToPointsF( qwtInvalidRect,
    430430                xMap, yMap, series, from, to, QwtRoundF() );
    431431        }
    432432        else
    433433        {
    434             polyline = qwtToPointsF( qwtInvalidRect, 
     434            polyline = qwtToPointsF( qwtInvalidRect,
    435435                xMap, yMap, series, from, to, QwtNoRoundF() );
    436436        }
     
    444444
    445445  When the WeedOutPoints flag is enabled consecutive points,
    446   that are mapped to the same position will be one point. 
     446  that are mapped to the same position will be one point.
    447447
    448448  \param xMap x map
     
    462462    if ( d_data->flags & WeedOutPoints )
    463463    {
    464         polyline = qwtToPolylineFilteredI( 
     464        polyline = qwtToPolylineFilteredI(
    465465            xMap, yMap, series, from, to );
    466466    }
    467467    else
    468468    {
    469         polyline = qwtToPointsI( 
     469        polyline = qwtToPointsI(
    470470            qwtInvalidRect, xMap, yMap, series, from, to );
    471471    }
     
    478478
    479479  - WeedOutPoints & RoundPoints & boundingRect().isValid()
    480     All points that are mapped to the same position 
     480    All points that are mapped to the same position
    481481    will be one point. Points outside of the bounding
    482482    rectangle are ignored.
    483  
     483
    484484  - WeedOutPoints & RoundPoints & !boundingRect().isValid()
    485     All consecutive points that are mapped to the same position 
     485    All consecutive points that are mapped to the same position
    486486    will one point
    487487
    488   - WeedOutPoints & !RoundPoints 
    489     All consecutive points that are mapped to the same position 
     488  - WeedOutPoints & !RoundPoints
     489    All consecutive points that are mapped to the same position
    490490    will one point
    491491
     
    516516        {
    517517            if ( d_data->boundingRect.isValid() )
    518             {   
     518            {
    519519                points = qwtToPointsFilteredF( d_data->boundingRect,
    520520                    xMap, yMap, series, from, to );
    521521            }
    522522            else
    523             {   
     523            {
    524524                // without a bounding rectangle all we can
    525525                // do is to filter out duplicates of
    526526                // consecutive points
    527527
    528                 points = qwtToPolylineFilteredF( 
     528                points = qwtToPolylineFilteredF(
    529529                    xMap, yMap, series, from, to, QwtRoundF() );
    530530            }
     
    535535            // qwtToPointsFilteredF
    536536
    537             points = qwtToPolylineFilteredF( 
     537            points = qwtToPolylineFilteredF(
    538538                xMap, yMap, series, from, to, QwtNoRoundF() );
    539539        }
     
    560560
    561561  - WeedOutPoints & boundingRect().isValid()
    562     All points that are mapped to the same position 
     562    All points that are mapped to the same position
    563563    will be one point. Points outside of the bounding
    564564    rectangle are ignored.
    565  
     565
    566566  - WeedOutPoints & !boundingRect().isValid()
    567     All consecutive points that are mapped to the same position 
     567    All consecutive points that are mapped to the same position
    568568    will one point
    569569
     
    597597            // we can do is to filter out consecutive duplicates
    598598
    599             points = qwtToPolylineFilteredI( 
     599            points = qwtToPolylineFilteredI(
    600600                xMap, yMap, series, from, to );
    601601        }
     
    603603    else
    604604    {
    605         points = qwtToPointsI( 
     605        points = qwtToPointsI(
    606606            d_data->boundingRect, xMap, yMap, series, from, to );
    607607    }
     
    631631QImage QwtPointMapper::toImage(
    632632    const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    633     const QwtSeriesData<QPointF> *series, int from, int to, 
     633    const QwtSeriesData<QPointF> *series, int from, int to,
    634634    const QPen &pen, bool antialiased, uint numThreads ) const
    635635{
     
    681681                command.to = index0 + numPoints - 1;
    682682
    683                 futures += QtConcurrent::run( &qwtRenderDots, 
     683                futures += QtConcurrent::run( &qwtRenderDots,
    684684                    xMap, yMap, command, pos, &image );
    685685            }
Note: See TracChangeset for help on using the changeset viewer.