QWT 7.0.1
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
50class QWT_EXPORT QwtPointMapper
51{
52public:
58 {
60 RoundPoints = 0x01,
61
66 WeedOutPoints = 0x02,
67
86 WeedOutIntermediatePoints = 0x04
87 };
88
89 Q_DECLARE_FLAGS(TransformationFlags, TransformationFlag)
90
93
94 void setFlags(TransformationFlags);
95 TransformationFlags flags() const;
96
97 void setFlag(TransformationFlag, bool on = true);
98 bool testFlag(TransformationFlag) const;
99
100 void setBoundingRect(const QRectF&);
101 QRectF boundingRect() const;
102
103 QPolygonF
104 toPolygonF(const QwtScaleMap& xMap, const QwtScaleMap& yMap, const QwtSeriesData< QPointF >* series, int from, int to) const;
105
106 QPolygon
107 toPolygon(const QwtScaleMap& xMap, const QwtScaleMap& yMap, const QwtSeriesData< QPointF >* series, int from, int to) const;
108
109 QPolygon
110 toPoints(const QwtScaleMap& xMap, const QwtScaleMap& yMap, const QwtSeriesData< QPointF >* series, int from, int to) const;
111
112 QPolygonF
113 toPointsF(const QwtScaleMap& xMap, const QwtScaleMap& yMap, const QwtSeriesData< QPointF >* series, int from, int to) const;
114
115 QImage toImage(const QwtScaleMap& xMap,
116 const QwtScaleMap& yMap,
117 const QwtSeriesData< QPointF >* series,
118 int from,
119 int to,
120 const QPen&,
121 bool antialiased,
122 uint numThreads) const;
123
124private:
125 Q_DISABLE_COPY(QwtPointMapper)
126
127 class PrivateData;
128 PrivateData* m_data;
129};
130
131Q_DECLARE_OPERATORS_FOR_FLAGS(QwtPointMapper::TransformationFlags)
132
133#endif
A helper class for translating a series of points.
Definition qwt_point_mapper.h:51
TransformationFlag
Flags affecting the transformation process.
Definition qwt_point_mapper.h:58
A scale map.
Definition qwt_scale_map.h:44
Abstract interface for iterating over samples.
Definition qwt_series_data.h:67