qwt_transform.cpp
Go to the documentation of this file.
1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
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 
10 #include "qwt_transform.h"
11 #include "qwt_math.h"
12 
13 #if QT_VERSION < 0x040601
14 #define qExp(x) ::exp(x)
15 #endif
16 
18 const double QwtLogTransform::LogMin = 1.0e-150;
19 
21 const double QwtLogTransform::LogMax = 1.0e150;
22 
25 {
26 }
27 
30 {
31 }
32 
37 double QwtTransform::bounded( double value ) const
38 {
39  return value;
40 }
41 
44  QwtTransform()
45 {
46 }
47 
50 {
51 }
52 
57 double QwtNullTransform::transform( double value ) const
58 {
59  return value;
60 }
61 
66 double QwtNullTransform::invTransform( double value ) const
67 {
68  return value;
69 }
70 
73 {
74  return new QwtNullTransform();
75 }
76 
79  QwtTransform()
80 {
81 }
82 
85 {
86 }
87 
92 double QwtLogTransform::transform( double value ) const
93 {
94  return ::log( value );
95 }
96 
101 double QwtLogTransform::invTransform( double value ) const
102 {
103  return qExp( value );
104 }
105 
110 double QwtLogTransform::bounded( double value ) const
111 {
112  return qBound( LogMin, value, LogMax );
113 }
114 
117 {
118  return new QwtLogTransform();
119 }
120 
126  QwtTransform(),
127  d_exponent( exponent )
128 {
129 }
130 
133 {
134 }
135 
140 double QwtPowerTransform::transform( double value ) const
141 {
142  if ( value < 0.0 )
143  return -qPow( -value, 1.0 / d_exponent );
144  else
145  return qPow( value, 1.0 / d_exponent );
146 
147 }
148 
153 double QwtPowerTransform::invTransform( double value ) const
154 {
155  if ( value < 0.0 )
156  return -qPow( -value, d_exponent );
157  else
158  return qPow( value, d_exponent );
159 }
160 
163 {
164  return new QwtPowerTransform( d_exponent );
165 }
QwtPowerTransform(double exponent)
virtual double invTransform(double value) const
QwtLogTransform()
Constructor.
virtual ~QwtPowerTransform()
Destructor.
virtual ~QwtNullTransform()
Destructor.
virtual double transform(double value) const
virtual double bounded(double value) const
virtual QwtTransform * copy() const
virtual double invTransform(double value) const
A transformation between coordinate systems.
Definition: qwt_transform.h:35
static const double LogMax
Largest allowed value for logarithmic scales: 1.0e150.
static const double LogMin
Smallest allowed value for logarithmic scales: 1.0e-150.
virtual double invTransform(double value) const
QwtNullTransform()
Constructor.
virtual ~QwtTransform()
Destructor.
virtual QwtTransform * copy() const
virtual QwtTransform * copy() const
virtual ~QwtLogTransform()
Destructor.
QwtTransform()
Constructor.
virtual double transform(double value) const
virtual double transform(double value) const
const double d_exponent
#define qExp(x)
virtual double bounded(double value) const


plotjuggler
Author(s): Davide Faconti
autogenerated on Sat Jul 6 2019 03:44:18