Changeset 9383 in ntrip for trunk/BNC/qwt/qwt_point_mapper.cpp
- Timestamp:
- Mar 19, 2021, 9:15:03 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_point_mapper.cpp
r8127 r9383 23 23 24 24 #if !defined(QT_NO_QFUTURE) 25 #define QWT_USE_THREADS 025 #define QWT_USE_THREADS 1 26 26 #endif 27 27 … … 43 43 static void qwtRenderDots( 44 44 const QwtScaleMap &xMap, const QwtScaleMap &yMap, 45 const QwtDotsCommand command, const QPoint &pos, QImage *image ) 45 const QwtDotsCommand command, const QPoint &pos, QImage *image ) 46 46 { 47 47 const QRgb rgb = command.rgb; … … 95 95 96 96 struct QwtNoRoundF 97 { 97 { 98 98 inline double operator()( double value ) 99 99 { … … 106 106 107 107 template<class Polygon, class Point, class Round> 108 static inline Polygon qwtToPoints( 108 static inline Polygon qwtToPoints( 109 109 const QRectF &boundingRect, 110 110 const QwtScaleMap &xMap, const QwtScaleMap &yMap, 111 const QwtSeriesData<QPointF> *series, 111 const QwtSeriesData<QPointF> *series, 112 112 int from, int to, Round round ) 113 113 { … … 169 169 int from, int to ) 170 170 { 171 return qwtToPoints<QPolygon, QPoint>( 171 return qwtToPoints<QPolygon, QPoint>( 172 172 boundingRect, xMap, yMap, series, from, to, QwtRoundI() ); 173 173 } … … 180 180 int from, int to, Round round ) 181 181 { 182 return qwtToPoints<QPolygonF, QPointF>( 182 return qwtToPoints<QPolygonF, QPointF>( 183 183 boundingRect, xMap, yMap, series, from, to, round ); 184 184 } … … 188 188 189 189 template<class Polygon, class Point, class Round> 190 static inline Polygon qwtToPolylineFiltered( 191 const QwtScaleMap &xMap, const QwtScaleMap &yMap, 192 const QwtSeriesData<QPointF> *series, 190 static inline Polygon qwtToPolylineFiltered( 191 const QwtScaleMap &xMap, const QwtScaleMap &yMap, 192 const QwtSeriesData<QPointF> *series, 193 193 int from, int to, Round round ) 194 194 { … … 239 239 return qwtToPolylineFiltered<QPolygonF, QPointF>( 240 240 xMap, yMap, series, from, to, round ); 241 } 241 } 242 242 243 243 template<class Polygon, class Point> … … 283 283 return qwtToPointsFiltered<QPolygon, QPoint>( 284 284 boundingRect, xMap, yMap, series, from, to ); 285 } 285 } 286 286 287 287 static inline QPolygonF qwtToPointsFilteredF( … … 390 390 391 391 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. 393 393 394 394 When RoundPoints is set all points are rounded to integers … … 414 414 if ( d_data->flags & RoundPoints ) 415 415 { 416 polyline = qwtToPolylineFilteredF( 416 polyline = qwtToPolylineFilteredF( 417 417 xMap, yMap, series, from, to, QwtRoundF() ); 418 418 } 419 419 else 420 420 { 421 polyline = qwtToPolylineFilteredF( 421 polyline = qwtToPolylineFilteredF( 422 422 xMap, yMap, series, from, to, QwtNoRoundF() ); 423 423 } … … 427 427 if ( d_data->flags & RoundPoints ) 428 428 { 429 polyline = qwtToPointsF( qwtInvalidRect, 429 polyline = qwtToPointsF( qwtInvalidRect, 430 430 xMap, yMap, series, from, to, QwtRoundF() ); 431 431 } 432 432 else 433 433 { 434 polyline = qwtToPointsF( qwtInvalidRect, 434 polyline = qwtToPointsF( qwtInvalidRect, 435 435 xMap, yMap, series, from, to, QwtNoRoundF() ); 436 436 } … … 444 444 445 445 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. 447 447 448 448 \param xMap x map … … 462 462 if ( d_data->flags & WeedOutPoints ) 463 463 { 464 polyline = qwtToPolylineFilteredI( 464 polyline = qwtToPolylineFilteredI( 465 465 xMap, yMap, series, from, to ); 466 466 } 467 467 else 468 468 { 469 polyline = qwtToPointsI( 469 polyline = qwtToPointsI( 470 470 qwtInvalidRect, xMap, yMap, series, from, to ); 471 471 } … … 478 478 479 479 - WeedOutPoints & RoundPoints & boundingRect().isValid() 480 All points that are mapped to the same position 480 All points that are mapped to the same position 481 481 will be one point. Points outside of the bounding 482 482 rectangle are ignored. 483 483 484 484 - 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 486 486 will one point 487 487 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 490 490 will one point 491 491 … … 516 516 { 517 517 if ( d_data->boundingRect.isValid() ) 518 { 518 { 519 519 points = qwtToPointsFilteredF( d_data->boundingRect, 520 520 xMap, yMap, series, from, to ); 521 521 } 522 522 else 523 { 523 { 524 524 // without a bounding rectangle all we can 525 525 // do is to filter out duplicates of 526 526 // consecutive points 527 527 528 points = qwtToPolylineFilteredF( 528 points = qwtToPolylineFilteredF( 529 529 xMap, yMap, series, from, to, QwtRoundF() ); 530 530 } … … 535 535 // qwtToPointsFilteredF 536 536 537 points = qwtToPolylineFilteredF( 537 points = qwtToPolylineFilteredF( 538 538 xMap, yMap, series, from, to, QwtNoRoundF() ); 539 539 } … … 560 560 561 561 - WeedOutPoints & boundingRect().isValid() 562 All points that are mapped to the same position 562 All points that are mapped to the same position 563 563 will be one point. Points outside of the bounding 564 564 rectangle are ignored. 565 565 566 566 - 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 568 568 will one point 569 569 … … 597 597 // we can do is to filter out consecutive duplicates 598 598 599 points = qwtToPolylineFilteredI( 599 points = qwtToPolylineFilteredI( 600 600 xMap, yMap, series, from, to ); 601 601 } … … 603 603 else 604 604 { 605 points = qwtToPointsI( 605 points = qwtToPointsI( 606 606 d_data->boundingRect, xMap, yMap, series, from, to ); 607 607 } … … 631 631 QImage QwtPointMapper::toImage( 632 632 const QwtScaleMap &xMap, const QwtScaleMap &yMap, 633 const QwtSeriesData<QPointF> *series, int from, int to, 633 const QwtSeriesData<QPointF> *series, int from, int to, 634 634 const QPen &pen, bool antialiased, uint numThreads ) const 635 635 { … … 681 681 command.to = index0 + numPoints - 1; 682 682 683 futures += QtConcurrent::run( &qwtRenderDots, 683 futures += QtConcurrent::run( &qwtRenderDots, 684 684 xMap, yMap, command, pos, &image ); 685 685 }
Note:
See TracChangeset
for help on using the changeset viewer.