QWT API (English) 7.3.0
Qt Widget Library for Technical Applications - English API Documentation
Loading...
Searching...
No Matches
qwt3d_scale.h
1#ifndef QWT3D_SCALE_H
2#define QWT3D_SCALE_H
3
4#include <vector>
5#include <qstring.h>
6#include "qwt3d_types.h"
7#include "qwt3d_autoptr.h"
8
9
10
20class QWT3D_EXPORT Qwt3DScale
21{
22 friend class Qwt3DAxis;
23 friend class Qwt3DClonePtr< Qwt3DScale >;
24
25protected:
26 QWT_DECLARE_PRIVATE(Qwt3DScale)
27
28 Qwt3DScale();
29 virtual ~Qwt3DScale();
30 virtual QString ticLabel(unsigned int idx) const;
31
32 virtual void setLimits(double start, double stop);
33 // Sets number of major intervals
34 virtual void setMajors(int val);
35 // Sets number of minor intervals per major interval
36 virtual void setMinors(int val);
37 virtual void setMajorLimits(double start, double stop);
38
39 // Returns major intervals
40 int majors() const;
41 // Returns minor intervals
42 int minors() const;
43
44 // Derived classes should return a new heap based object here
45 virtual Qwt3DScale* clone() const = 0;
46 // This function should setup the 2 vectors for major and minor positions
47 virtual void calculate() = 0;
48 virtual int autoscale(double& a, double& b, double start, double stop, int ivals);
49
50 // Returns const reference to major tic positions
51 const std::vector< double >& majorTicks() const;
52 // Returns const reference to minor tic positions
53 const std::vector< double >& minorTicks() const;
54
55 // Copies Qwt3DScale base state from another Qwt3DScale (used by derived clone())
56 void copyFrom(const Qwt3DScale& other);
57
58private:
59 void destroy() const;
60};
61
65class QWT3D_EXPORT Qwt3DLinearScale : public Qwt3DScale
66{
67 friend class Qwt3DAxis;
68 friend class Qwt3DClonePtr< Qwt3DScale >;
69
70protected:
71 QWT_DECLARE_PRIVATE(Qwt3DLinearScale)
72
74 ~Qwt3DLinearScale() override;
75 int autoscale(double& a, double& b, double start, double stop, int ivals) override;
76 // Returns a new heap based object utilized from Qwt3DClonePtr
77 Qwt3DScale* clone() const override;
78 void calculate() override;
79};
80
84class QWT3D_EXPORT Qwt3DLogScale : public Qwt3DScale
85{
86 friend class Qwt3DAxis;
87 friend class Qwt3DClonePtr< Qwt3DScale >;
88
89protected:
90 QString ticLabel(unsigned int idx) const override;
91 void setMinors(int val) override;
92 // Standard ctor
94 ~Qwt3DLogScale() override;
95 // Returns a new heap based object utilized from Qwt3DClonePtr
96 Qwt3DScale* clone() const override;
97 void calculate() override;
98
99private:
100 void setupCounter(double& k, int& step);
101};
102
103
104#endif // QWT3D_SCALE_H
Autoscalable axis with caption.
Definition qwt3d_axis.h:19
Simple auto pointer providing deep copies for raw pointer.
Definition qwt3d_autoptr.h:18
The standard (1:1) mapping class for axis numbering.
Definition qwt3d_scale.h:66
int autoscale(double &a, double &b, double start, double stop, int ivals) override
Autoscales the axis.
Log10 scale.
Definition qwt3d_scale.h:85
Non-visual scale class encapsulating tic generation.
Definition qwt3d_scale.h:21