QwtPointMapper(3)
β¨ NAME β¨
okay so this is QwtPointMapper(3) from the Library Functions Manual β and it's giving helper class energy, bestie. Officially: QwtPointMapper β A helper class for translating a series of points. π
π¦ SYNOPSIS π¦
#include <qwt_point_mapper.h>
Public Types
enum TransformationFlag { RoundPoints = 0x01, WeedOutPoints = 0x02, WeedOutIntermediatePoints = 0x04 }β Flags affecting the transformation process.typedef QFlags< TransformationFlag > TransformationFlags
Public Member Functions
QwtPointMapper ()β Constructor.~QwtPointMapper ()β Destructor.void setFlags (TransformationFlags)TransformationFlags flags () constvoid setFlag (TransformationFlag, bool on=true)bool testFlag (TransformationFlag) constvoid setBoundingRect (const QRectF &)QRectF boundingRect () constQPolygonF toPolygonF (const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QwtSeriesData< QPointF > *series, int from, int to) constβ Translate a series of points into aQPolygonF.QPolygon toPolygon (const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QwtSeriesData< QPointF > *series, int from, int to) constβ Translate a series of points into aQPolygon.QPolygon toPoints (const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QwtSeriesData< QPointF > *series, int from, int to) constβ Translate a series of points into aQPolygon.QPolygonF toPointsF (const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QwtSeriesData< QPointF > *series, int from, int to) constβ Translate a series into aQPolygonF.QImage toImage (const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QwtSeriesData< QPointF > *series, int from, int to, const QPen &, bool antialiased, uint numThreads) constβ Translate a series into aQImage.
π Detailed Description π
A helper class for translating a series of points.
QwtPointMapper is a little collection of methods and optimizations for translating a series of points into paint device coordinates. It is used by QwtPlotCurve, but it might also be useful for similar plot items displaying a QwtSeriesData<QPointF>. iykyk π¦
Definition at line 32 of file qwt_point_mapper.h.
π Member Typedef Documentation π
typedef QFlags<TransformationFlag > QwtPointMapper::TransformationFlags
An ORed combination of TransformationFlag values. slay β¨
Definition at line 71 of file qwt_point_mapper.h.
πΈ Member Enumeration Documentation πΈ
enum QwtPointMapper::TransformationFlag
Flags affecting the transformation process.
See also: setFlag(), setFlags()
Enumerator:
RoundPointsβ Round points to integer values.WeedOutPointsβ Try to remove points, that are translated to the same position.WeedOutIntermediatePointsβ An even more aggressive weeding algorithm, that can be used intoPolygon().
When a consecutive chunk of points maps to the same x coordinate, it gets reduced to 4 points:
- first point
- point with the minimum y coordinate
- point with the maximum y coordinate
- last point
Worst case: if the first and last points are never one of the extremes, the number of points will be 4 times the width.
Because the algorithm is fast, it can be used inside of a polyline render cycle. periodt π
Definition at line 39 of file qwt_point_mapper.h.
π§ Constructor & Destructor Documentation π§
QwtPointMapper::QwtPointMapper ()
Constructor. Fresh mapper, fresh vibes. π
Definition at line 547 of file qwt_point_mapper.cpp.
QwtPointMapper::~QwtPointMapper ()
Destructor.
Definition at line 553 of file qwt_point_mapper.cpp.
π Member Function Documentation π
QRectF QwtPointMapper::boundingRect () const
Returns:
- Bounding rectangle
See also: setBoundingRect()
Definition at line 621 of file qwt_point_mapper.cpp.
QwtPointMapper::TransformationFlags QwtPointMapper::flags () const
Returns:
- Flags affecting the transformation process
See also: setFlags(), setFlag()
Definition at line 573 of file qwt_point_mapper.cpp.
void QwtPointMapper::setBoundingRect (const QRectF & rect)
Sets a bounding rectangle for the point mapping algorithm.
A valid bounding rectangle can be used for optimizations. lowkey useful β¨
Parameters:
rectβ Bounding rectangle
See also: boundingRect()
Definition at line 612 of file qwt_point_mapper.cpp.
void QwtPointMapper::setFlag (TransformationFlag flag, bool on = true)
Modifies one flag affecting the transformation process.
Parameters:
flagβ Flag typeonβ Value
See also: flag(), setFlags()
Definition at line 586 of file qwt_point_mapper.cpp.
void QwtPointMapper::setFlags (TransformationFlags flags)
Sets the flags affecting the transformation process.
Parameters:
flagsβ Flags
See also: flags(), setFlag()
Definition at line 564 of file qwt_point_mapper.cpp.
bool QwtPointMapper::testFlag (TransformationFlag flag) const
Returns:
- True, when the flag is set
Parameters:
flagβ Flag type
See also: setFlag(), setFlags()
Definition at line 599 of file qwt_point_mapper.cpp.
QImage QwtPointMapper::toImage (const QwtScaleMap & xMap, const QwtScaleMap & yMap, const QwtSeriesData< QPointF > * series, int from, int to, const QPen & pen, bool antialiased, uint numThreads) const
Translates a series into a QImage. main character rendering moment π¨
Parameters:
xMapβ x mapyMapβ y mapseriesβ Series of points to be mappedfromβ Index of the first point to be paintedtoβ Index of the last point to be paintedpenβ Pen used for drawing a point of the image, where a point is mapped toantialiasedβ True, when the dots should be displayed antialiasednumThreadsβ Number of threads to be used for rendering. IfnumThreadsis set to 0, the system specific ideal thread count is used.
Returns:
- Image displaying the series
Definition at line 883 of file qwt_point_mapper.cpp.
QPolygon QwtPointMapper::toPoints (const QwtScaleMap & xMap, const QwtScaleMap & yMap, const QwtSeriesData< QPointF > * series, int from, int to) const
Translates a series of points into a QPolygon. Here's the vibe-check breakdown:
WeedOutPoints&boundingRect().isValid()All points that are mapped to the same position will be one point. Points outside of the bounding rectangle are ignored.WeedOutPoints&!boundingRect().isValid()All consecutive points that are mapped to the same position will one point!WeedOutPoints&boundingRect().isValid()Points outside of the bounding rectangle are ignored.
Parameters:
xMapβ x mapyMapβ y mapseriesβ Series of points to be mappedfromβ Index of the first point to be paintedtoβ Index of the last point to be painted
Returns:
- Translated polygon
Definition at line 833 of file qwt_point_mapper.cpp.
QPolygonF QwtPointMapper::toPointsF (const QwtScaleMap & xMap, const QwtScaleMap & yMap, const QwtSeriesData< QPointF > * series, int from, int to) const
Translates a series into a QPolygonF. Another little rules lineup:
WeedOutPoints&RoundPoints&boundingRect().isValid()All points that are mapped to the same position will be one point. Points outside of the bounding rectangle are ignored.WeedOutPoints&RoundPoints&!boundingRect().isValid()All consecutive points that are mapped to the same position will one pointWeedOutPoints&!RoundPointsAll consecutive points that are mapped to the same position will one point!WeedOutPoints&boundingRect().isValid()Points outside of the bounding rectangle are ignored.
When RoundPoints is set all points are rounded to integers but returned as PolygonF - what only makes sense when the further processing of the values need a QPolygonF. no cap π
Parameters:
xMapβ x mapyMapβ y mapseriesβ Series of points to be mappedfromβ Index of the first point to be paintedtoβ Index of the last point to be painted
Returns:
- Translated polygon
Definition at line 759 of file qwt_point_mapper.cpp.
QPolygon QwtPointMapper::toPolygon (const QwtScaleMap & xMap, const QwtScaleMap & yMap, const QwtSeriesData< QPointF > * series, int from, int to) const
Translates a series of points into a QPolygon. When the WeedOutPoints flag is enabled, consecutive points that are mapped to the same position will be one point.
Parameters:
xMapβ x mapyMapβ y mapseriesβ Series of points to be mappedfromβ Index of the first point to be paintedtoβ Index of the last point to be painted
Returns:
- Translated polygon
Definition at line 702 of file qwt_point_mapper.cpp.
QPolygonF QwtPointMapper::toPolygonF (const QwtScaleMap & xMap, const QwtScaleMap & yMap, const QwtSeriesData< QPointF > * series, int from, int to) const
Translates a series of points into a QPolygonF. When the WeedOutPoints flag is enabled, consecutive points that are mapped to the same position will be one point.
When RoundPoints is set all points are rounded to integers but returned as PolygonF - what only makes sense when the further processing of the values need a QPolygonF.
When RoundPoints & WeedOutIntermediatePoints is enabled an even more aggressive weeding algorithm is enabled. ate π₯
Parameters:
xMapβ x mapyMapβ y mapseriesβ Series of points to be mappedfromβ Index of the first point to be paintedtoβ Index of the last point to be painted
Returns:
- Translated polygon
Definition at line 647 of file qwt_point_mapper.cpp.
π«Ά Author π«Ά
Generated automatically by Doxygen for Qwt User's Guide from the source code.
mwah π β source/version tea: this page comes from the Qwt User's Guide, and the footer is QwtPointMapper(3); no date was printed, so that's all the footer lore, bestie. π«Ά
π¦ where this page comes from
- alpine 3.24: qwt-doc 6.3.0-r0 Β· custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms