QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt_scale_div.h
1/******************************************************************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the Qwt License, Version 1.0
8 *
9 * Modified by ChenZongYan in 2024 <czy.t@163.com>
10 * Summary of major modifications (see ChangeLog.md for full history):
11 * 1. CMake build system & C++11 throughout.
12 * 2. Core panner/ zoomer refactored:
13 * - QwtPanner → QwtCachePanner (pixmap-cache version)
14 * - New real-time QwtPlotPanner derived from QwtPicker.
15 * 3. Zoomer supports multi-axis.
16 * 4. Parasite-plot framework:
17 * - QwtFigure, QwtPlotParasiteLayout, QwtPlotTransparentCanvas,
18 * - QwtPlotScaleEventDispatcher, built-in pan/zoom on axis.
19 * 5. New picker: QwtPlotSeriesDataPicker (works with date axis).
20 * 6. Raster & color-map extensions:
21 * - QwtGridRasterData (2-D table + interpolation)
22 * - QwtLinearColorMap::stopColors(), stopPos() API rename.
23 * 7. Bar-chart: expose pen/brush control.
24 * 8. Amalgamated build: single QwtPlot.h / QwtPlot.cpp pair in src-amalgamate.
25 *****************************************************************************/
26
27#ifndef QWT_SCALE_DIV_H
28#define QWT_SCALE_DIV_H
29
30#include "qwt_global.h"
31#include <qlist.h>
32
33class QwtInterval;
34
52class QWT_EXPORT QwtScaleDiv
53{
54public:
57 {
59 NoTick = -1,
60
63
66
69
71 NTickTypes
72 };
73
74 // Constructor with lower and upper bounds
75 explicit QwtScaleDiv(double lowerBound = 0.0, double upperBound = 0.0);
76
77 // Constructor with interval and ticks array
78 explicit QwtScaleDiv(const QwtInterval&, QList< double >[ NTickTypes ]);
79
80 // Constructor with bounds and ticks array
81 explicit QwtScaleDiv(double lowerBound, double upperBound, QList< double >[ NTickTypes ]);
82
83 // Constructor with bounds and separate tick lists
84 explicit QwtScaleDiv(double lowerBound,
85 double upperBound,
86 const QList< double >& minorTicks,
87 const QList< double >& mediumTicks,
88 const QList< double >& majorTicks);
89
90 // Equality operator
91 bool operator==(const QwtScaleDiv&) const;
92 // Inequality operator
93 bool operator!=(const QwtScaleDiv&) const;
94 // Fuzzy comparison
95 bool fuzzyCompare(const QwtScaleDiv& other) const;
96
97 // Set the interval
98 void setInterval(double lowerBound, double upperBound);
99 // Set the interval from QwtInterval
100 void setInterval(const QwtInterval&);
101 // Get the interval
102 QwtInterval interval() const;
103
104 // Set the lower bound
105 void setLowerBound(double);
106 // Get the lower bound
107 double lowerBound() const;
108
109 // Set the upper bound
110 void setUpperBound(double);
111 // Get the upper bound
112 double upperBound() const;
113
114 // Get the range (upper - lower)
115 double range() const;
116
117 // Check if value is within bounds
118 bool contains(double value) const;
119
120 // Set ticks for a specific tick type
121 void setTicks(int tickType, const QList< double >&);
122 // Get ticks for a specific tick type
123 QList< double > ticks(int tickType) const;
124
125 // Check if scale division is empty
126 bool isEmpty() const;
127 // Check if scale is increasing
128 bool isIncreasing() const;
129
130 // Invert the scale division
131 void invert();
132 // Get inverted scale division
133 QwtScaleDiv inverted() const;
134
135 // Get bounded scale division
136 QwtScaleDiv bounded(double lowerBound, double upperBound) const;
137
138private:
139 double m_lowerBound;
140 double m_upperBound;
141 QList< double > m_ticks[ NTickTypes ];
142};
143
144Q_DECLARE_TYPEINFO(QwtScaleDiv, Q_MOVABLE_TYPE);
145
146#ifndef QT_NO_DEBUG_STREAM
147QWT_EXPORT QDebug operator<<(QDebug, const QwtScaleDiv&);
148#endif
149
150#endif
表示区间的类
Definition qwt_interval.h:45
A class representing a scale division/表示刻度划分的类
Definition qwt_scale_div.h:53
TickType
Scale tick types
Definition qwt_scale_div.h:57
@ MediumTick
Medium ticks
Definition qwt_scale_div.h:65
@ MinorTick
Minor ticks
Definition qwt_scale_div.h:62
@ MajorTick
Major ticks
Definition qwt_scale_div.h:68