QWT API (English)
7.3.0
Qt Widget Library for Technical Applications - English API Documentation
Loading...
Searching...
No Matches
src
plot3d
qwt3d_scale.h
1
#ifndef QWT3D_SCALE_H
2
#define QWT3D_SCALE_H
3
4
#include <vector>
5
#include <qstring.h>
6
#include <QVector>
7
#include "qwt3d_types.h"
8
#include "qwt3d_autoptr.h"
9
10
11
21
class
QWT3D_EXPORT
Qwt3DScale
22
{
23
friend
class
Qwt3DAxis
;
24
friend
class
Qwt3DClonePtr
<
Qwt3DScale
>;
25
26
protected
:
27
QWT_DECLARE_PRIVATE(
Qwt3DScale
)
28
29
Qwt3DScale
();
30
virtual
~Qwt3DScale
();
31
virtual
QString ticLabel(
unsigned
int
idx)
const
;
32
33
virtual
void
setLimits(
double
start,
double
stop);
34
// Sets number of major intervals
35
virtual
void
setMajors(
int
val);
36
// Sets number of minor intervals per major interval
37
virtual
void
setMinors(
int
val);
38
virtual
void
setMajorLimits(
double
start,
double
stop);
39
40
// Returns major intervals
41
int
majors()
const
;
42
// Returns minor intervals
43
int
minors()
const
;
44
45
// Derived classes should return a new heap based object here
46
virtual
Qwt3DScale
* clone()
const
= 0;
47
// This function should setup the 2 vectors for major and minor positions
48
virtual
void
calculate() = 0;
49
virtual
int
autoscale(
double
& a,
double
& b,
double
start,
double
stop,
int
ivals);
50
51
// Returns const reference to major tic positions
52
const
std::vector< double >& majorTicks()
const
;
53
// Returns const reference to minor tic positions
54
const
std::vector< double >& minorTicks()
const
;
55
56
// Copies Qwt3DScale base state from another Qwt3DScale (used by derived clone())
57
void
copyFrom(
const
Qwt3DScale
& other);
58
59
private
:
60
void
destroy()
const
;
61
};
62
66
class
QWT3D_EXPORT
Qwt3DLinearScale
:
public
Qwt3DScale
67
{
68
friend
class
Qwt3DAxis
;
69
friend
class
Qwt3DClonePtr
<
Qwt3DScale
>;
70
71
protected
:
72
QWT_DECLARE_PRIVATE(
Qwt3DLinearScale
)
73
74
Qwt3DLinearScale
();
75
~Qwt3DLinearScale
()
override
;
76
int
autoscale
(
double
& a,
double
& b,
double
start,
double
stop,
int
ivals)
override
;
77
// Returns a new heap based object utilized from Qwt3DClonePtr
78
Qwt3DScale
* clone()
const override
;
79
void
calculate()
override
;
80
81
// Copies the linear autoscaler state (for derived clone() implementations)
82
void
copyLinearScaleState(
const
Qwt3DLinearScale
& other);
83
};
84
88
class
QWT3D_EXPORT
Qwt3DLogScale
:
public
Qwt3DScale
89
{
90
friend
class
Qwt3DAxis
;
91
friend
class
Qwt3DClonePtr
<
Qwt3DScale
>;
92
93
protected
:
94
QString ticLabel(
unsigned
int
idx)
const override
;
95
void
setMinors(
int
val)
override
;
96
// Standard ctor
97
Qwt3DLogScale
();
98
~Qwt3DLogScale
()
override
;
99
// Returns a new heap based object utilized from Qwt3DClonePtr
100
Qwt3DScale
* clone()
const override
;
101
void
calculate()
override
;
102
103
private
:
104
void
setupCounter(
double
& k,
int
& step);
105
};
106
126
class
QWT3D_EXPORT
Qwt3DTextScale
:
public
Qwt3DLinearScale
127
{
128
friend
class
Qwt3DAxis
;
129
friend
class
Qwt3DClonePtr
<
Qwt3DScale
>;
130
131
public
:
132
Qwt3DTextScale
();
133
135
void
setLabels(
const
QVector<QString>
& labels);
137
QVector<QString>
labels()
const
;
138
139
protected
:
140
QString ticLabel(
unsigned
int
idx)
const override
;
141
// Must override: Qwt3DAxis::setScale() clones the object via Qwt3DClonePtr
142
Qwt3DScale
* clone()
const override
;
143
144
private
:
145
QVector<QString>
m_labels;
146
};
147
148
149
#endif
// QWT3D_SCALE_H
QVector
Definition
qwt_clipper.h:41
Qwt3DAxis
Autoscalable axis with caption.
Definition
qwt3d_axis.h:19
Qwt3DClonePtr
Simple auto pointer providing deep copies for raw pointer.
Definition
qwt3d_autoptr.h:18
Qwt3DLinearScale
The standard (1:1) mapping class for axis numbering.
Definition
qwt3d_scale.h:67
Qwt3DLinearScale::autoscale
int autoscale(double &a, double &b, double start, double stop, int ivals) override
Autoscales the axis.
Qwt3DLogScale
Log10 scale.
Definition
qwt3d_scale.h:89
Qwt3DScale
Non-visual scale class encapsulating tic generation.
Definition
qwt3d_scale.h:22
Qwt3DTextScale
Linear scale whose major tic labels come from a user supplied string list.
Definition
qwt3d_scale.h:127
Generated by
1.9.8