QWT API (English) 7.3.0
Qt Widget Library for Technical Applications - English API Documentation
Loading...
Searching...
No Matches
qwt_point_mapper.h
1/******************************************************************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the Qwt License, Version 1.0
8 *
9 * Modified by ChenZongYan in 2024 <czy.t@163.com>
10 * Summary of major modifications (see ChangeLog.md for full history):
11 * 1. CMake build system & C++11 throughout.
12 * 2. Core panner/ zoomer refactored:
13 * - QwtPanner → QwtCachePanner (pixmap-cache version)
14 * - New real-time QwtPlotPanner derived from QwtPicker.
15 * 3. Zoomer supports multi-axis.
16 * 4. Parasite-plot framework:
17 * - QwtFigure, QwtPlotParasiteLayout, QwtPlotTransparentCanvas,
18 * - QwtPlotScaleEventDispatcher, built-in pan/zoom on axis.
19 * 5. New picker: QwtPlotSeriesDataPicker (works with date axis).
20 * 6. Raster & color-map extensions:
21 * - QwtGridRasterData (2-D table + interpolation)
22 * - QwtLinearColorMap::stopColors(), stopPos() API rename.
23 * 7. Bar-chart: expose pen/brush control.
24 * 8. Amalgamated build: single QwtPlot.h / QwtPlot.cpp pair in src-amalgamate.
25 *****************************************************************************/
26
27#ifndef QWT_POINT_MAPPER_H
28#define QWT_POINT_MAPPER_H
29
30#include "qwt_global.h"
31
32class QwtScaleMap;
33template< typename T >
34class QwtSeriesData;
35class QPolygonF;
36class QPointF;
37class QRectF;
38class QPolygon;
39class QPen;
40class QImage;
41
51class QWT_EXPORT QwtPointMapper
52{
53public:
60 {
62 RoundPoints = 0x01,
63
65 WeedOutPoints = 0x02,
66
82 WeedOutIntermediatePoints = 0x04,
83
93 PixelColumnReduce = 0x08,
94
107 LTTBReduce = 0x20,
108
118 MinMaxReduce = 0x10,
119
152 AdaptiveColumnReduce = 0x40
153 };
154
155 Q_DECLARE_FLAGS(TransformationFlags, TransformationFlag)
156
157 // Constructor
159 // Destructor
161
162 // Set the transformation flags
163 void setFlags(TransformationFlags);
164 // Get the transformation flags
165 TransformationFlags flags() const;
166
167 // Set or clear a transformation flag
168 void setFlag(TransformationFlag, bool on = true);
169 // Test if a transformation flag is set
170 bool testFlag(TransformationFlag) const;
171
172 // Set the bounding rectangle for mapping
173 void setBoundingRect(const QRectF&);
174 // Get the bounding rectangle
175 QRectF boundingRect() const;
176
177 // Set the device pixel ratio of the target paint device
178 void setDevicePixelRatio(qreal ratio);
179 // Get the device pixel ratio of the target paint device
180 qreal devicePixelRatio() const;
181
182 // Translate a series of points into a QPolygonF
183 QPolygonF
184 toPolygonF(const QwtScaleMap& xMap, const QwtScaleMap& yMap, const QwtSeriesData< QPointF >* series, int from, int to) const;
185
186 // Translate a series of points into a QPolygon
187 QPolygon
188 toPolygon(const QwtScaleMap& xMap, const QwtScaleMap& yMap, const QwtSeriesData< QPointF >* series, int from, int to) const;
189
190 // Translate a series of points into a QPolygon (scattered points)
191 QPolygon
192 toPoints(const QwtScaleMap& xMap, const QwtScaleMap& yMap, const QwtSeriesData< QPointF >* series, int from, int to) const;
193
194 // Translate a series of points into a QPolygonF (scattered points)
195 QPolygonF
196 toPointsF(const QwtScaleMap& xMap, const QwtScaleMap& yMap, const QwtSeriesData< QPointF >* series, int from, int to) const;
197
198 // Translate a series into a QImage
199 QImage toImage(const QwtScaleMap& xMap,
200 const QwtScaleMap& yMap,
201 const QwtSeriesData< QPointF >* series,
202 int from,
203 int to,
204 const QPen&,
205 bool antialiased,
206 uint numThreads) const;
207
208private:
209 QwtPointMapper(const QwtPointMapper&) = delete;
210 QwtPointMapper& operator=(const QwtPointMapper&) = delete;
211
212 QWT_DECLARE_PRIVATE(QwtPointMapper)
213};
214
215Q_DECLARE_OPERATORS_FOR_FLAGS(QwtPointMapper::TransformationFlags)
216
217#endif
A helper class for translating a series of points.
Definition qwt_point_mapper.h:52
TransformationFlag
Flags affecting the transformation process.
Definition qwt_point_mapper.h:60
A scale map.
Definition qwt_scale_map.h:44
Abstract interface for iterating over samples.
Definition qwt_series_data.h:88