⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qwtautoscale.3

📁 软件无线电的平台
💻 3
字号:
.TH "QwtAutoScale" 3 "4 Nov 2003" "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';}.PP.PP\fBWarning:\fP.RS 4For logarithmic scales, the step size as well as the margins are measured in *decades*. .RE.PP.PP.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. .SS "QwtAutoScale::~\fBQwtAutoScale\fP ()".PPDtor. .SH "Member Function Documentation".PP .SS "void QwtAutoScale::adjust (double vmin, double vmax, int reset = 0)".PPAdjust the scale to include a specified interval. This 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.PP.SS "void QwtAutoScale::adjust (const QwtArray< double > & x, int reset = 0)".PPAdjust the scale to include a given array of input values. This 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.PP.SS "void QwtAutoScale::adjust (double * x, int num, int reset = 0)".PPAdjust the scale to include a given array of input values. This 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.PP.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.PP.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.PP.SS "void QwtAutoScale::build ()".PPRe-build the scale. .SS "void QwtAutoScale::buildLinScale ()\fC [protected]\fP".PPBuild a linear scale. .SS "void QwtAutoScale::buildLogScale ()\fC [protected]\fP".PPbuild a logarithmic scale .SS "void QwtAutoScale::changeOptions (int opt, bool tf)".PPSet or reset specified scale options. \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.PP.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.PP.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.PP.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.PP.SS "int QwtAutoScale::maxMinor () const".PP\fBReturns:\fP.RS 4the maximum number of minor scale ticks .RE.PP\fBSee also:\fP.RS 4\fBQwtAutoScale::setMaxMinor()\fP .RE.PP.SS "bool QwtAutoScale::option (int opt) const".PPReturns TRUE if the specified option is set. \fBParameters:\fP.RS 4\fIopt\fP Option .RE.PP\fBSee also:\fP.RS 4\fBQwtAutoScale::setOptions()\fP .RE.PP.SS "int QwtAutoScale::options () const".PP\fBReturns:\fP.RS 4options .RE.PP\fBSee also:\fP.RS 4\fBQwtAutoScale::setOptions()\fP, \fBQwtAutoScale::option()\fP .RE.PP.SS "double QwtAutoScale::reference () const".PP\fBReturns:\fP.RS 4the reference value .RE.PP\fBSee also:\fP.RS 4\fBQwtAutoScale::setOptions()\fP, \fBQwtAutoScale::option()\fP .RE.PP.SS "void QwtAutoScale::reset ()".PPSet the interval boundaries to zero and clear the scale division. This member function resets an AutoScale object to its initial state. It is needed to clean up the scale before or after subsequent \fBadjust()\fP calls. The boundaries of the scale are set to zero and the scale division is cleared..PP\fBWarning:\fP.RS 4A reset doesn't affect the margins. .RE.PP.SS "const  \fBQwtScaleDiv\fP & QwtAutoScale::scaleDiv () const".PPThe scale division consists of two boundary values, an array of major tickmarks and an array of minor tickmarks. .PP\fBReturns:\fP.RS 4a const reference to the scale division .RE.PP\fBSee also:\fP.RS 4\fBQwtScaleDiv\fP .RE.PP.SS "void QwtAutoScale::setAutoRebuild (bool tf)".PPIf true, rebuild scale automatically with call to 'adjust' .PP\fBSee also:\fP.RS 4\fBQwtAutoScale::autoRebuild\fP .RE.PP.SS "void QwtAutoScale::setAutoScale ()".PPEnable auto-scaling. This function is used to switch back to auto-scaling mode if the scale has been frozen temporarily (see \fBsetScale()\fP)..PPWhen auto-scaling is reactivated, the scale will be rebuild, which means that .IP "\(bu" 2if adjust or setMaxIntv have been called in between, the scale will be adjusted to the new conditions. .IP "\(bu" 2if none of these functions and no reset has been called, the old state will be restored. .IP "\(bu" 2if only reset has been called in between, nothing will happen..PP\fBSee also:\fP.RS 4\fBQwtAutoScale::setScale()\fP .RE.PP.SS "void QwtAutoScale::setMargins (double mlo, double mhi)".PPSpecify margins at the scale's endpoints. \fBParameters:\fP.RS 4\fImlo\fP minimum distance between the scale's lower boundary and the smallest enclosed value .br\fImhi\fP minimum distance between the scale's upper boundary and the greatest enclosed value.RE.PPMargins can be used to leave a minimum amount of space between the enclosed intervals and the boundaries of the scale..PP\fBWarning:\fP.RS 4.IP "\(bu" 2With logarithmic scales, the margins are measured in decades. .IP "\(bu" 2The margins will not be changed by any other member function. You should remember this when you call \fBreset()\fP or change from a linear to a logarithmic scale. .PP.RE.PP.SS "void QwtAutoScale::setMaxMajor (int mx)".PPSpecify the maximum number of major intervals. \fBParameters:\fP.RS 4\fImx\fP maximum number of subintervals.RE.PPThe auto-scaler places the major ticks at reasonable points, such that the number of major tick intervals does not exceed the specified maximum number. .SS "void QwtAutoScale::setMaxMinor (int mx)".PPSpecify the maximum number of minor subdivisions within major scale intervals. \fBParameters:\fP.RS 4\fImx\fP maximum number of minor ticks .RE.PP.SS "void QwtAutoScale::setOptions (int opt)".PPReset scale options and set specified options. \fBParameters:\fP.RS 4\fIopt\fP Combined set of options.RE.PPThe behaviour of the auto-scaling algorithm can be changed with the following options: .IP "\fBQwtAutoScale::None \fP" 1cSwitch all options off. .IP "\fBQwtAutoscale::IncludeRef \fP" 1cBuild a scale which includes the reference value. .IP "\fBQwtAutoScale::Symmetric \fP" 1cBuild a scale which is symmetric to the reference value. .IP "\fBQwtAutoScale::Logarithmic \fP" 1cBuild a logarithmic scale. .IP "\fBQwtAutoScale::Floating \fP" 1cThe endpoints of the scale are supposed to be equal the outmost included values plus the specified margins (see \fBsetMargins()\fP). If this option is not* set, the endpoints of the scale will be integer multiples of the step size. .IP "\fBQwtAutoScale::Inverted \fP" 1cTurn the scale upside down. .PP.PP\fBWarning:\fP.RS 4.IP "\(bu" 2If the type of scale division is changed from logarithmic to linear or vice versa, the margins will not be transformed. Note that the margins count in decades if the scale is logarithmic. .IP "\(bu" 2If a linear scale contains negative values, switching to a logarithmic scale will cut them off and set the lower scale boundary to its lowest possible value of 1.0E-100. This effect is reversible if you switch back to a linear scale. .IP "\(bu" 2The options have no effect while auto-scaling is turned off (see \fBsetScale()\fP).PPExample:.PP.nf#include '../include/qwt_autoscl.h>void main() {    QwtAutoScale as;    // build linear scale with default settings    as.adjust(17.45, 87344.0);    //...    // change to logarithmic scale with floating ends    as.setOptions(QwtAutoScale::Floating | QwtAutoscale::Logarithmic);    //...    // change to linear, zero-symmetric scale    as.setOptions(QwtAutoScale::ZeroSymmetric);    //...}.PP.RE.PP\fBSee also:\fP.RS 4\fBQwtAutoScale::changeOptions()\fP for a description of the possible \fBoptions\fP. .RE.PP.SS "void QwtAutoScale::setRange (double x1, double x2)\fC [protected]\fP".PP\fB\fP.RS 4.RE.PP.SS "void QwtAutoScale::setReference (double r)".PPSpecify a reference point. \fBParameters:\fP.RS 4\fIr\fP new reference value.RE.PPThe reference point is needed if the auto-scaler options IncludeRef or Symmetric are active. Its default value is 0 for linear scales and 1 for logarithmic scales..PP\fBWarning:\fP.RS 4The reference value for logarithmic scales is limited to ( LOG_MIN / 2 <= reference <= LOG_MAX /2 ). If the specified value is less than LOG_MIN (defined in \fBqwt_math.h\fP), it will be set to 1.0 for logarithmic scales. .RE.PP.SS "void QwtAutoScale::setScale (double xmin, double xmax, double step = 0.0)".PPSpecify a user-defined scale and switch off auto-scaling. \fBParameters:\fP.RS 4\fIxmin\fP user-defined lower boundary .br\fIxmax\fP user-defined upper boundary .br\fIstep\fP user-defined fixed major step size.RE.PPA fixed scale may be used for different purposes, e.g. zooming. If the step argument is left out or less or equal to zero, the auto-scaler will calculate the major step size size according to the maxMajor setting..PPThe fixed-scale mode can switched off using \fBsetAutoScale()\fP, which restores the previous values..PP\fBWarning:\fP.RS 4.IP "\(bu" 2if xmin > xmax, xmax will be the lower boundary. .IP "\(bu" 2if xmin == xmax, the auto-scaler sets the boundaries to (-0.5, 0.5). .IP "\(bu" 2Options and margins have no effect while auto-scaling is switched off..PP.RE.PP\fBSee also:\fP.RS 4\fBQwtAutoScale::setMaxMajor()\fP, \fBQwtAutoScale::setAutoScale()\fP .RE.PP.SH "Author".PP Generated automatically by Doxygen for Qwt User's Guide from the source code.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -