QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt3d_autoscaler.h
1#ifndef QWT3D_AUTOSCALER_H
2#define QWT3D_AUTOSCALER_H
3
4#include <vector>
5#include "qwt3d_global.h"
6#include "qwt3d_autoptr.h"
7
8namespace Qwt3D
9{
10
14class QWT3D_EXPORT AutoScaler
15{
16 friend class ClonePtr< AutoScaler >;
17
18protected:
19 virtual AutoScaler* clone() const = 0;
20 virtual int execute(double& a, double& b, double start, double stop, int ivals) = 0;
21 virtual ~AutoScaler()
22 {
23 }
24
25private:
26 void destroy() const
27 {
28 delete this;
29 }
30};
31
35class QWT3D_EXPORT LinearAutoScaler : public AutoScaler
36{
37 friend class LinearScale;
38
39protected:
40 QWT_DECLARE_PRIVATE(LinearAutoScaler)
41
43 explicit LinearAutoScaler(std::vector< double >& mantisses);
44 ~LinearAutoScaler() override;
45 AutoScaler* clone() const override;
46 int execute(double& a, double& b, double start, double stop, int ivals) override;
47
48 // Copies state from another LinearAutoScaler (used by LinearScale::clone)
49 void copyStateFrom(const LinearAutoScaler& other);
50
51private:
52 void init(double start, double stop, int ivals);
53 double anchorvalue(double start, double mantisse, int exponent);
54 int segments(int& l_intervals, int& r_intervals, double start, double stop, double anchor, double mantissa, int exponent);
55};
56
57} // ns
58
59#endif
Abstract base class for autoscaler
Definition qwt3d_autoscaler.h:15
Simple auto pointer providing deep copies for raw pointer
Definition qwt3d_autoptr.h:19
Automatic beautifying of linear scales
Definition qwt3d_autoscaler.h:36
The standard (1:1) mapping class for axis numbering
Definition qwt3d_scale.h:67