📄 qwtautoscale.3
字号:
.TH "QwtAutoScale" 3 "16 Nov 2004" "Version 4.2.0" "Qwt User's Guide" \" -*- nroff -*-.ad l.nh.SH NAMEQwtAutoScale \- .SH SYNOPSIS.br.PP.SH "Detailed Description".PP The Qwt Auto-Scaler. This class can be used to generate a scale which may span multiple ranges of values. A scale consists of a lower boundary, an upper boundary, a vector of major scale ticks and a vector of minor scale ticks which divide it into subintervals. A quick look at the example below will give you an idea of how the auto-scaler works..PPThe auto-scaler produces 'reasonable' major and minor step sizes. For linear scales, the major step size will fit into the pattern $\left\{ 1,2,5\right\} \cdot 10^{n}$, where n is an integer. In logarithmic mode (\fBsetOptions()\fP) the step size is measured in *decades* and the major step size will be adjusted to fit the pattern $\left\{ 1,2,3,5\right\} \cdot 10^{n}$, where n is a natural number including zero..PPThe step size can be manipulated indirectly using \fBsetMaxMajor()\fP. The layout of the scale can be varied with \fBsetOptions()\fP..PPThe auto-scaling algorithm can be partly or completely disabled (even temporarily) if a user-defined scale is desired. This can be done with the \fBsetScale()\fP function. It can be switched off again with \fBsetAutoScale()\fP..PPThe two \fBadjust()\fP members are used to extend the scale if necessary in order to include another range or array of values. The resulting scale division can be obtained with \fBscaleDiv()\fP. \fBreset()\fP resets the scale to zero..PP\fBExample\fP.RS 4.RE.PP.PP.nf#include <qwt_autoscl.h>#include <iostream.h>double x1[100];double x2[200];double range_min, range_max;QwtAutoScale as;// ... determine x1 and x1, range_min and range_max here ...as.reset(); // clear itas.adjust(range_min, range_max); // include a rangeas.adjust(x1,100); // include an arrayas.adjust(x2,200); // include another arrayfor (i=0;i<as.scaleDiv().majCnt(); i++){ cout << 'Scale tick ' << i << ' at ' << as.scaleDiv().majMark(i) << '\n';}.fi.PP.PP\fBWarning:\fP.RS 4For logarithmic scales, the step size as well as the margins are measured in *decades*. .RE.PP.PPDefinition at line 78 of file qwt_autoscl.h..SS "Public Types".in +1c.ti -1c.RI "enum { \fBNone\fP = 0, \fBIncludeRef\fP = 1, \fBSymmetric\fP = 2, \fBFloating\fP = 4, \fBLogarithmic\fP = 8, \fBInverted\fP = 16 }".br.in -1c.SS "Public Member Functions".in +1c.ti -1c.RI "\fBQwtAutoScale\fP ()".br.ti -1c.RI "\fB~QwtAutoScale\fP ()".br.ti -1c.RI "void \fBsetAutoScale\fP ()".br.ti -1c.RI "bool \fBautoScale\fP () const".br.ti -1c.RI "void \fBsetAutoRebuild\fP (bool)".br.ti -1c.RI "bool \fBautoRebuild\fP () const".br.ti -1c.RI "void \fBchangeOptions\fP (int opt, bool tf)".br.ti -1c.RI "void \fBsetOptions\fP (int opt)".br.ti -1c.RI "bool \fBoption\fP (int opt) const".br.ti -1c.RI "int \fBoptions\fP () const".br.ti -1c.RI "void \fBsetMaxMajor\fP (int n)".br.ti -1c.RI "int \fBmaxMajor\fP () const".br.ti -1c.RI "void \fBsetMaxMinor\fP (int n)".br.ti -1c.RI "int \fBmaxMinor\fP () const".br.ti -1c.RI "void \fBsetReference\fP (double r)".br.ti -1c.RI "double \fBreference\fP () const".br.ti -1c.RI "void \fBsetMargins\fP (double m1, double m2)".br.ti -1c.RI "double \fBloMargin\fP () const".br.ti -1c.RI "double \fBhiMargin\fP () const".br.ti -1c.RI "void \fBsetScale\fP (double xmin, double xmax, double step=0.0)".br.ti -1c.RI "const \fBQwtScaleDiv\fP & \fBscaleDiv\fP () const".br.ti -1c.RI "void \fBadjust\fP (double *arr, int n, int reset=0)".br.ti -1c.RI "void \fBadjust\fP (const QwtArray< double > &x, int reset=0)".br.ti -1c.RI "void \fBadjust\fP (double x1, double x2, int reset=0)".br.ti -1c.RI "void \fBbuild\fP ()".br.ti -1c.RI "void \fBreset\fP ()".br.in -1c.SS "Protected Member Functions".in +1c.ti -1c.RI "void \fBbuildLinScale\fP ()".br.ti -1c.RI "void \fBbuildLogScale\fP ()".br.ti -1c.RI "void \fBsetRange\fP (double x1, double x2)".br.in -1c.SH "Constructor & Destructor Documentation".PP .SS "QwtAutoScale::QwtAutoScale ()".PPCtor. .PPDefinition at line 17 of file qwt_autoscl.cpp..SS "QwtAutoScale::~\fBQwtAutoScale\fP ()".PPDtor. .PPDefinition at line 37 of file qwt_autoscl.cpp..SH "Member Function Documentation".PP .SS "void QwtAutoScale::adjust (double vmin, double vmax, int reset = \fC0\fP)".PPAdjust the scale to include a specified interval. .PPThis member function extends the boundaries of the scale and re-calculates the step size if necessary in order to include a specified interval. If the reset parameter has nonzero value, the previous state will be cleared..PP\fBParameters:\fP.RS 4\fIvmin\fP lower border of the specified interval .br\fIvmax\fP upper border of the specified interval .br\fIreset\fP if nonzero, reset the scale. Defaults to 0. .RE.PPDefinition at line 150 of file qwt_autoscl.cpp..PPReferences build()..SS "void QwtAutoScale::adjust (const QwtArray< double > & x, int reset = \fC0\fP)".PPAdjust the scale to include a given array of input values. .PPThis member function extends the boundaries of the scale and re-calculates the step size if necessary in order to include all values in the array. If the reset parameter has nonzero value, the previous state will be cleared..PP\fBParameters:\fP.RS 4\fIx\fP QwtArray<double> of input values .br\fIreset\fP If != 0 reset the scale's contents .RE.PPDefinition at line 131 of file qwt_autoscl.cpp..PPReferences adjust()..SS "void QwtAutoScale::adjust (double * x, int num, int reset = \fC0\fP)".PPAdjust the scale to include a given array of input values. .PPThis member function extends the boundaries of the scale and re-calculates the step size if necessary in order to include all values in the array. If the reset parameter has nonzero value, the previous state will be cleared..PP\fBParameters:\fP.RS 4\fIx\fP Array of input values .br\fInum\fP Array size .br\fIreset\fP If != 0 reset the scale's contents .RE.PPDefinition at line 100 of file qwt_autoscl.cpp..PPReferences build()..PPReferenced by adjust(), and QwtPlot::updateAxes()..SS "bool QwtAutoScale::autoRebuild () const".PP\fBReturns:\fP.RS 4If true, rebuild scale automatically with call to 'adjust' .RE.PP\fBSee also:\fP.RS 4\fBQwtAutoScale::setAutoRebuild()\fP .RE.PPDefinition at line 739 of file qwt_autoscl.cpp..SS "bool QwtAutoScale::autoScale () const".PP\fBReturns:\fP.RS 4\fCTRUE\fP if auto-scaling is active .RE.PP\fBSee also:\fP.RS 4\fBQwtAutoScale::setAutoScale()\fP .RE.PPDefinition at line 45 of file qwt_autoscl.cpp..PPReferenced by QwtPlot::axisAutoScale(), and QwtPlot::updateAxes()..SS "void QwtAutoScale::build ()".PPRe-build the scale. .PPDefinition at line 176 of file qwt_autoscl.cpp..PPReferences buildLinScale(), buildLogScale(), and QwtScaleDiv::rebuild()..PPReferenced by adjust(), changeOptions(), setAutoScale(), setMargins(), setMaxMajor(), setMaxMinor(), setOptions(), setReference(), and setScale()..SS "void QwtAutoScale::buildLinScale ()\fC [protected]\fP".PPBuild a linear scale. .PPDefinition at line 213 of file qwt_autoscl.cpp..PPReferences QwtScaleDiv::rebuild(), and setRange()..PPReferenced by build()..SS "void QwtAutoScale::buildLogScale ()\fC [protected]\fP".PPbuild a logarithmic scale .PPDefinition at line 300 of file qwt_autoscl.cpp..PPReferences QwtScaleDiv::rebuild(), and setRange()..PPReferenced by build()..SS "void QwtAutoScale::changeOptions (int opt, bool tf)".PPSet or reset specified scale options. .PP\fBParameters:\fP.RS 4\fIopt\fP or-combined scale options .br\fItf\fP If \fCTRUE\fP, set the specified options. If \fCFALSE\fP, reset these options. .RE.PP\fBSee also:\fP.RS 4\fBQwtAutoScale::setOptions()\fP .RE.PPDefinition at line 391 of file qwt_autoscl.cpp..PPReferences build()..PPReferenced by QwtPlot::changeAxisOptions()..SS "double QwtAutoScale::hiMargin () const".PP\fBReturns:\fP.RS 4the margin at the upper end of the scale .RE.PP\fBSee also:\fP.RS 4\fBQwtAutoScale::setMargins()\fP .RE.PPDefinition at line 63 of file qwt_autoscl.cpp..SS "double QwtAutoScale::loMargin () const".PP\fBReturns:\fP.RS 4the margin at the lower end of the scale .RE.PP\fBSee also:\fP.RS 4\fBQwtAutoScale::setMargins()\fP .RE.PPDefinition at line 54 of file qwt_autoscl.cpp..PPReferenced by QwtPlot::axisMargins()..SS "int QwtAutoScale::maxMajor () const".PP\fBReturns:\fP.RS 4the maximum number of major tickmarks .RE.PP\fBSee also:\fP.RS 4\fBQwtAutoScale::setMaxMajor()\fP .RE.PPDefinition at line 72 of file qwt_autoscl.cpp..PPReferenced by QwtPlot::axisMaxMajor()..SS "int QwtAutoScale::maxMinor () const".PP\fBReturns:\fP.RS 4the maximum number of minor scale ticks
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -