QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
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
92 PixelColumnReduce = 0x08,
93
102 MinMaxReduce = 0x10
103 };
104
105 Q_DECLARE_FLAGS(TransformationFlags, TransformationFlag)
106
107 // Constructor
109 // Destructor
111
112 // Set the transformation flags
113 void setFlags(TransformationFlags);
114 // Get the transformation flags
115 TransformationFlags flags() const;
116
117 // Set or clear a transformation flag
118 void setFlag(TransformationFlag, bool on = true);
119 // Test if a transformation flag is set
120 bool testFlag(TransformationFlag) const;
121
122 // Set the bounding rectangle for mapping
123 void setBoundingRect(const QRectF&);
124 // Get the bounding rectangle
125 QRectF boundingRect() const;
126
127 // Translate a series of points into a QPolygonF
128 QPolygonF
129 toPolygonF(const QwtScaleMap& xMap, const QwtScaleMap& yMap, const QwtSeriesData< QPointF >* series, int from, int to) const;
130
131 // Translate a series of points into a QPolygon
132 QPolygon
133 toPolygon(const QwtScaleMap& xMap, const QwtScaleMap& yMap, const QwtSeriesData< QPointF >* series, int from, int to) const;
134
135 // Translate a series of points into a QPolygon (scattered points)
136 QPolygon
137 toPoints(const QwtScaleMap& xMap, const QwtScaleMap& yMap, const QwtSeriesData< QPointF >* series, int from, int to) const;
138
139 // Translate a series of points into a QPolygonF (scattered points)
140 QPolygonF
141 toPointsF(const QwtScaleMap& xMap, const QwtScaleMap& yMap, const QwtSeriesData< QPointF >* series, int from, int to) const;
142
143 // Translate a series into a QImage
144 QImage toImage(const QwtScaleMap& xMap,
145 const QwtScaleMap& yMap,
146 const QwtSeriesData< QPointF >* series,
147 int from,
148 int to,
149 const QPen&,
150 bool antialiased,
151 uint numThreads) const;
152
153private:
154 QwtPointMapper(const QwtPointMapper&) = delete;
155 QwtPointMapper& operator=(const QwtPointMapper&) = delete;
156
157 QWT_DECLARE_PRIVATE(QwtPointMapper)
158};
159
160Q_DECLARE_OPERATORS_FOR_FLAGS(QwtPointMapper::TransformationFlags)
161
162#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