Loading...
Searching...
No Matches
qwt_transform.cpp
/******************************************************************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#include "qwt_transform.h"
#include "qwt_math.h"
const double QwtLogTransform::LogMin = 1.0e-150;
const double QwtLogTransform::LogMax = 1.0e150;
QwtTransform::QwtTransform()
{
}
QwtTransform::~QwtTransform()
{
}
double QwtTransform::bounded( double value ) const
{
return value;
}
QwtNullTransform::QwtNullTransform():
QwtTransform()
{
}
QwtNullTransform::~QwtNullTransform()
{
}
double QwtNullTransform::transform( double value ) const
{
return value;
}
double QwtNullTransform::invTransform( double value ) const
{
return value;
}
QwtTransform* QwtNullTransform::copy() const
{
return new QwtNullTransform();
}
QwtLogTransform::QwtLogTransform():
QwtTransform()
{
}
QwtLogTransform::~QwtLogTransform()
{
}
double QwtLogTransform::transform( double value ) const
{
return std::log( value );
}
double QwtLogTransform::invTransform( double value ) const
{
return std::exp( value );
}
double QwtLogTransform::bounded( double value ) const
{
return qBound( LogMin, value, LogMax );
}
QwtTransform* QwtLogTransform::copy() const
{
return new QwtLogTransform();
}
QwtPowerTransform::QwtPowerTransform( double exponent ):
QwtTransform(),
m_exponent( exponent )
{
}
QwtPowerTransform::~QwtPowerTransform()
{
}
double QwtPowerTransform::transform( double value ) const
{
if ( value < 0.0 )
return -std::pow( -value, 1.0 / m_exponent );
else
return std::pow( value, 1.0 / m_exponent );
}
double QwtPowerTransform::invTransform( double value ) const
{
if ( value < 0.0 )
return -std::pow( -value, m_exponent );
else
return std::pow( value, m_exponent );
}
QwtTransform* QwtPowerTransform::copy() const
{
return new QwtPowerTransform( m_exponent );
}
QwtLogTransform::LogMax
static const double LogMax
Largest allowed value for logarithmic scales: 1.0e150.
Definition qwt_transform.h:114
QwtLogTransform::LogMin
static const double LogMin
Smallest allowed value for logarithmic scales: 1.0e-150.
Definition qwt_transform.h:113
QwtLogTransform::~QwtLogTransform
virtual ~QwtLogTransform()
Destructor.
Definition qwt_transform.cpp:80
QwtLogTransform::invTransform
virtual double invTransform(double value) const override
Definition qwt_transform.cpp:97
QwtLogTransform::copy
virtual QwtTransform * copy() const override
Definition qwt_transform.cpp:112
QwtLogTransform::transform
virtual double transform(double value) const override
Definition qwt_transform.cpp:88
QwtLogTransform::QwtLogTransform
QwtLogTransform()
Constructor.
Definition qwt_transform.cpp:74
QwtLogTransform::bounded
virtual double bounded(double value) const override
Definition qwt_transform.cpp:106
QwtNullTransform::QwtNullTransform
QwtNullTransform()
Constructor.
Definition qwt_transform.cpp:39
QwtNullTransform::invTransform
virtual double invTransform(double value) const override
Definition qwt_transform.cpp:62
QwtNullTransform::~QwtNullTransform
virtual ~QwtNullTransform()
Destructor.
Definition qwt_transform.cpp:45
QwtNullTransform::transform
virtual double transform(double value) const override
Definition qwt_transform.cpp:53
QwtNullTransform::copy
virtual QwtTransform * copy() const override
Definition qwt_transform.cpp:68
QwtPowerTransform::invTransform
virtual double invTransform(double value) const override
Definition qwt_transform.cpp:149
QwtPowerTransform::~QwtPowerTransform
virtual ~QwtPowerTransform()
Destructor.
Definition qwt_transform.cpp:128
QwtPowerTransform::copy
virtual QwtTransform * copy() const override
Definition qwt_transform.cpp:158
QwtPowerTransform::transform
virtual double transform(double value) const override
Definition qwt_transform.cpp:136
QwtPowerTransform::QwtPowerTransform
QwtPowerTransform(double exponent)
Definition qwt_transform.cpp:121
QwtTransform
A transformation between coordinate systems.
Definition qwt_transform.h:36
QwtTransform::QwtTransform
QwtTransform()
Constructor.
Definition qwt_transform.cpp:20
QwtTransform::~QwtTransform
virtual ~QwtTransform()
Destructor.
Definition qwt_transform.cpp:25
QwtTransform::bounded
virtual double bounded(double value) const
Definition qwt_transform.cpp:33