QWT 7.0.1
Loading...
Searching...
No Matches
qwt_transform.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_TRANSFORM_H
28#define QWT_TRANSFORM_H
29
30#include "qwt_global.h"
31
52class QWT_EXPORT QwtTransform
53{
54 public:
56 virtual ~QwtTransform();
57
62 virtual double bounded( double value ) const;
63
72 virtual double transform( double value ) const = 0;
73
82 virtual double invTransform( double value ) const = 0;
83
85 virtual QwtTransform* copy() const = 0;
86
87 private:
88 Q_DISABLE_COPY(QwtTransform)
89};
90
97class QWT_EXPORT QwtNullTransform : public QwtTransform
98{
99 public:
101 virtual ~QwtNullTransform();
102
103 virtual double transform( double value ) const QWT_OVERRIDE;
104 virtual double invTransform( double value ) const QWT_OVERRIDE;
105
106 virtual QwtTransform* copy() const QWT_OVERRIDE;
107};
117class QWT_EXPORT QwtLogTransform : public QwtTransform
118{
119 public:
121 virtual ~QwtLogTransform();
122
123 virtual double transform( double value ) const QWT_OVERRIDE;
124 virtual double invTransform( double value ) const QWT_OVERRIDE;
125
126 virtual double bounded( double value ) const QWT_OVERRIDE;
127
128 virtual QwtTransform* copy() const QWT_OVERRIDE;
129
130 static const double LogMin;
131 static const double LogMax;
132};
133
142class QWT_EXPORT QwtPowerTransform : public QwtTransform
143{
144 public:
145 explicit QwtPowerTransform( double exponent );
146 virtual ~QwtPowerTransform();
147
148 virtual double transform( double value ) const QWT_OVERRIDE;
149 virtual double invTransform( double value ) const QWT_OVERRIDE;
150
151 virtual QwtTransform* copy() const QWT_OVERRIDE;
152
153 private:
154 const double m_exponent;
155};
156
157#endif
Logarithmic transformation.
Definition qwt_transform.h:118
static const double LogMax
Largest allowed value for logarithmic scales: 1.0e150.
Definition qwt_transform.h:131
static const double LogMin
Smallest allowed value for logarithmic scales: 1.0e-150.
Definition qwt_transform.h:130
Null transformation.
Definition qwt_transform.h:98
A transformation using pow()
Definition qwt_transform.h:143
A transformation between coordinate systems.
Definition qwt_transform.h:53
virtual QwtTransform * copy() const =0
Virtualized copy operation.
virtual double transform(double value) const =0
Transformation function.
virtual double invTransform(double value) const =0
Inverse transformation function.