QWT 7.0.1
Loading...
Searching...
No Matches
qwt_date_scale_engine.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_DATE_SCALE_ENGINE_H
28#define QWT_DATE_SCALE_ENGINE_H
29
30#include "qwt_global.h"
31#include "qwt_date.h"
32#include "qwt_scale_engine.h"
33
60{
61 public:
62 explicit QwtDateScaleEngine( Qt::TimeSpec = Qt::LocalTime );
63 virtual ~QwtDateScaleEngine();
64
65 void setTimeSpec( Qt::TimeSpec );
66 Qt::TimeSpec timeSpec() const;
67
68 void setUtcOffset( int seconds );
69 int utcOffset() const;
70
71 void setWeek0Type( QwtDate::Week0Type );
72 QwtDate::Week0Type week0Type() const;
73
74 void setMaxWeeks( int );
75 int maxWeeks() const;
76
77 virtual void autoScale(
78 int maxNumSteps, double& x1, double& x2,
79 double& stepSize ) const QWT_OVERRIDE;
80
82 double x1, double x2,
83 int maxMajorSteps, int maxMinorSteps,
84 double stepSize = 0.0 ) const QWT_OVERRIDE;
85
86 virtual QwtDate::IntervalType intervalType(
87 const QDateTime&, const QDateTime&, int maxSteps ) const;
88
89 QDateTime toDateTime( double ) const;
90
91 protected:
92 virtual QDateTime alignDate( const QDateTime&, double stepSize,
93 QwtDate::IntervalType, bool up ) const;
94
95 private:
96 QwtScaleDiv buildScaleDiv( const QDateTime&, const QDateTime&,
97 int maxMajorSteps, int maxMinorSteps,
99
100 private:
101 class PrivateData;
102 PrivateData* m_data;
103};
104
105#endif
A scale engine for date/time values.
Definition qwt_date_scale_engine.h:60
Week0Type
How to identify the first week of year differs between countries.
Definition qwt_date.h:67
IntervalType
Classification of an time interval.
Definition qwt_date.h:93
A scale engine for linear scales.
Definition qwt_scale_engine.h:175
virtual void autoScale(int maxNumSteps, double &x1, double &x2, double &stepSize) const QWT_OVERRIDE
Align and divide an interval.
Definition qwt_scale_engine.cpp:526
virtual QwtScaleDiv divideScale(double x1, double x2, int maxMajorSteps, int maxMinorSteps, double stepSize=0.0) const QWT_OVERRIDE
Calculate a scale division for an interval.
Definition qwt_scale_engine.cpp:569
A class representing a scale division/表示刻度划分的类
Definition qwt_scale_div.h:53