QWT 7.0.1
Loading...
Searching...
No Matches
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 explicit QwtScaleDiv(double lowerBound = 0.0, double upperBound = 0.0);
75
76 explicit QwtScaleDiv(const QwtInterval&, QList< double >[ NTickTypes ]);
77
78 explicit QwtScaleDiv(double lowerBound, double upperBound, QList< double >[ NTickTypes ]);
79
80 explicit QwtScaleDiv(double lowerBound,
81 double upperBound,
82 const QList< double >& minorTicks,
83 const QList< double >& mediumTicks,
84 const QList< double >& majorTicks);
85
86 bool operator==(const QwtScaleDiv&) const;
87 bool operator!=(const QwtScaleDiv&) const;
88 bool fuzzyCompare(const QwtScaleDiv& other) const;
89
90 void setInterval(double lowerBound, double upperBound);
91 void setInterval(const QwtInterval&);
92 QwtInterval interval() const;
93
94 void setLowerBound(double);
95 double lowerBound() const;
96
97 void setUpperBound(double);
98 double upperBound() const;
99
100 double range() const;
101
102 bool contains(double value) const;
103
104 void setTicks(int tickType, const QList< double >&);
105 QList< double > ticks(int tickType) const;
106
107 bool isEmpty() const;
108 bool isIncreasing() const;
109
110 void invert();
111 QwtScaleDiv inverted() const;
112
113 QwtScaleDiv bounded(double lowerBound, double upperBound) const;
114
115private:
116 double m_lowerBound;
117 double m_upperBound;
118 QList< double > m_ticks[ NTickTypes ];
119};
120
121Q_DECLARE_TYPEINFO(QwtScaleDiv, Q_MOVABLE_TYPE);
122
123#ifndef QT_NO_DEBUG_STREAM
124QWT_EXPORT QDebug operator<<(QDebug, const QwtScaleDiv&);
125#endif
126
127#endif
A class representing an interval.
Definition qwt_interval.h:40
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