27#ifndef QWT_SCALE_MAP_H
28#define QWT_SCALE_MAP_H
30#include "qwtcore_global.h"
31#include "qwt_transform.h"
67 void setPaintInterval(
double p1,
double p2);
69 void setScaleInterval(
double s1,
double s2);
72 double transform(
double s)
const;
74 double invTransform(
double p)
const;
77 constexpr double p1()
const noexcept;
79 constexpr double p2()
const noexcept;
82 constexpr double s1()
const noexcept;
84 constexpr double s2()
const noexcept;
107 constexpr bool isLinear()
const noexcept;
110 constexpr bool isInverting()
const noexcept;
113 constexpr double cnv()
const noexcept;
116 constexpr double ts1()
const noexcept;
123 double m_s1 { 0.0 }, m_s2 { 1.0 };
124 double m_p1 { 0.0 }, m_p2 { 1.0 };
126 double m_cnv { 1.0 };
127 double m_ts1 { 0.0 };
169 return qAbs(m_p2 - m_p1);
177 return qAbs(m_s2 - m_s1);
191 return m_p1 + (s - m_ts1) * m_cnv;
202 double s = m_ts1 + (p - m_p1) / m_cnv;
212 return ((m_p1 < m_p2) != (m_s1 < m_s2));
218 return m_transform ==
nullptr;
233#ifndef QT_NO_DEBUG_STREAM
234QWTCORE_EXPORT QDebug operator<<(QDebug,
const QwtScaleMap&);
A scale map
Definition qwt_scale_map.h:44
constexpr bool isLinear() const noexcept
Check if this scale has no nonlinear transformation
Definition qwt_scale_map.h:216
constexpr double p2() const noexcept
Return second border of paint interval
Definition qwt_scale_map.h:159
constexpr bool isInverting() const noexcept
Check if the mapping direction is inverted
Definition qwt_scale_map.h:210
double pDist() const
Return distance between paint interval boundaries
Definition qwt_scale_map.h:167
double transform(double s) const
Transform a scale value to paint device coordinate
Definition qwt_scale_map.h:186
constexpr double s2() const noexcept
Return second border of scale interval
Definition qwt_scale_map.h:143
constexpr double ts1() const noexcept
Transformed scale origin for linear fast-path
Definition qwt_scale_map.h:228
double sDist() const
Return distance between scale interval boundaries
Definition qwt_scale_map.h:175
constexpr double s1() const noexcept
Return first border of scale interval
Definition qwt_scale_map.h:135
double invTransform(double p) const
Transform a paint device coordinate to scale value
Definition qwt_scale_map.h:200
constexpr double p1() const noexcept
Return first border of paint interval
Definition qwt_scale_map.h:151
constexpr double cnv() const noexcept
Conversion factor for linear fast-path: result = p1() + (value - ts1()) * cnv()
Definition qwt_scale_map.h:222