📄 qwtscalediv.3
字号:
.TH "QwtScaleDiv" 3 "16 Nov 2004" "Version 4.2.0" "Qwt User's Guide" \" -*- nroff -*-.ad l.nh.SH NAMEQwtScaleDiv \- .SH SYNOPSIS.br.PP.SH "Detailed Description".PP A class for building scale divisions. The QwtScaleDiv class can build linear and logarithmic scale divisions for specified intervals. It uses an adjustable algorithm to generate the major and minor step widths automatically. A scale division has a minimum value, a maximum value, a vector of major marks, and a vector of minor marks..PP\fBWarning:\fP.RS 4QwtScaleDiv uses implicit sharing for the mark vectors. .RE.PP\fBExample\fP.RS 4To build a logarithmic scale division from 0.01 to 1000 and print out the major and minor marks. .PP.nf#include "../include/qwt_scldiv.h>#include <iostream.h>main(){ int i,k; QwtScaleDiv sd; sd.rebuild(0.01, 100, 10, 10, TRUE, 0.0); k=0; for (i=0;i<sd.majCnt();i++) { while(k < sd.minCnt()) { if (sd.minMark(k) < sd.majMark(i)) { cout << " - " << sd.minMark(i) << "\n"; k++; } else break; } cout << "-- " << sd.majMark(i) << "\n"; } while(k < sd.minCnt()) { cout << " - " << sd.minMark(i) << "\n"; k++; }}.fi.PP.RE.PP.PPDefinition at line 69 of file qwt_scldiv.h..SS "Public Member Functions".in +1c.ti -1c.RI "\fBQwtScaleDiv\fP ()".br.ti -1c.RI "int \fBoperator==\fP (const \fBQwtScaleDiv\fP &s) const".br.ti -1c.RI "int \fBoperator!=\fP (const \fBQwtScaleDiv\fP &s) const".br.ti -1c.RI "double \fBlBound\fP () const".br.ti -1c.RI "double \fBhBound\fP () const".br.ti -1c.RI "uint \fBminCnt\fP () const".br.ti -1c.RI "uint \fBmajCnt\fP () const".br.ti -1c.RI "bool \fBlogScale\fP () const".br.ti -1c.RI "double \fBmajMark\fP (int i) const".br.ti -1c.RI "double \fBminMark\fP (int i) const".br.ti -1c.RI "double \fBmajStep\fP () const".br.ti -1c.RI "void \fBreset\fP ()".br.ti -1c.RI "bool \fBrebuild\fP (double lBound, double hBound, int maxMaj, int maxMin, bool log, double step=0.0, bool ascend=TRUE)".br.in -1c.SH "Constructor & Destructor Documentation".PP .SS "QwtScaleDiv::QwtScaleDiv ()".PPConstruct a QwtScaleDiv instance. .PPDefinition at line 42 of file qwt_scldiv.cpp..SH "Member Function Documentation".PP .SS "double QwtScaleDiv::hBound () const".PP\fBReturns:\fP.RS 4right bound .RE.PP\fBSee also:\fP.RS 4\fBQwtScaleDiv::rebuild\fP .RE.PPDefinition at line 86 of file qwt_scldiv.h..PPReferenced by QwtPlot::canvasMap(), QwtPlot::print(), QwtPlotPicker::scaleRect(), QwtScaleDraw::setScale(), QwtScaleIf::setScaleMaxMajor(), and QwtScaleIf::setScaleMaxMinor()..SS "double QwtScaleDiv::lBound () const".PP\fBReturns:\fP.RS 4left bound .RE.PP\fBSee also:\fP.RS 4\fBQwtScaleDiv::rebuild\fP .RE.PPDefinition at line 81 of file qwt_scldiv.h..PPReferenced by QwtPlot::canvasMap(), QwtPlot::print(), QwtPlotPicker::scaleRect(), QwtScaleDraw::setScale(), QwtScaleIf::setScaleMaxMajor(), and QwtScaleIf::setScaleMaxMinor()..SS "bool QwtScaleDiv::logScale () const".PP\fBReturns:\fP.RS 4TRUE id ths scale div is logarithmic .RE.PP\fBSee also:\fP.RS 4\fBQwtScaleDiv::rebuild\fP .RE.PPDefinition at line 102 of file qwt_scldiv.h..PPReferenced by QwtPlot::canvasMap(), QwtScaleDraw::draw(), QwtScaleDraw::labelPlacement(), QwtScaleDraw::maxLabelHeight(), QwtScaleDraw::maxLabelWidth(), QwtPlot::print(), QwtScaleDraw::setScale(), QwtScaleIf::setScaleMaxMajor(), and QwtScaleIf::setScaleMaxMinor()..SS "uint QwtScaleDiv::majCnt () const".PP\fBReturns:\fP.RS 4major mark count .RE.PP\fBSee also:\fP.RS 4\fBQwtScaleDiv::rebuild\fP .RE.PPDefinition at line 96 of file qwt_scldiv.h..PPReferenced by QwtScaleDraw::draw(), QwtGrid::draw(), QwtScaleDraw::maxLabelHeight(), QwtScaleDraw::maxLabelWidth(), QwtScaleDraw::minBorderDist(), QwtScaleDraw::minHeight(), QwtScaleDraw::minLabelDist(), QwtScaleDraw::minWidth(), QwtScaleIf::setScale(), and QwtPlot::sizeHint()..SS "double QwtScaleDiv::majMark (int i) const".PPReturn major mark at position i. .PPDefinition at line 105 of file qwt_scldiv.h..PPReferenced by QwtScaleDraw::draw(), QwtGrid::draw(), QwtScaleDraw::maxLabelHeight(), QwtScaleDraw::maxLabelWidth(), QwtScaleDraw::minBorderDist(), and QwtScaleDraw::minLabelDist()..SS "double QwtScaleDiv::majStep () const".PP\fBReturns:\fP.RS 4major step size .RE.PP\fBSee also:\fP.RS 4\fBQwtScaleDiv::rebuild\fP .RE.PPDefinition at line 113 of file qwt_scldiv.h..PPReferenced by QwtScaleDraw::draw(), QwtScaleDraw::labelPlacement(), QwtScaleDraw::maxLabelHeight(), and QwtScaleDraw::maxLabelWidth()..SS "uint QwtScaleDiv::minCnt () const".PP\fBReturns:\fP.RS 4minor mark count .RE.PP\fBSee also:\fP.RS 4\fBQwtScaleDiv::rebuild\fP .RE.PPDefinition at line 91 of file qwt_scldiv.h..PPReferenced by QwtScaleDraw::draw(), QwtGrid::draw(), QwtScaleDraw::minHeight(), QwtScaleDraw::minWidth(), and QwtScaleIf::setScale()..SS "double QwtScaleDiv::minMark (int i) const".PPReturn minor mark at position i. .PPDefinition at line 107 of file qwt_scldiv.h..PPReferenced by QwtScaleDraw::draw(), and QwtGrid::draw()..SS "int QwtScaleDiv::operator!= (const \fBQwtScaleDiv\fP & s) const".PPInequality. .PP\fBReturns:\fP.RS 4TRUE if this instance is not equal to s .RE.PPDefinition at line 439 of file qwt_scldiv.cpp..SS "int QwtScaleDiv::operator== (const \fBQwtScaleDiv\fP & s) const".PPEquality operator. .PP\fBReturns:\fP.RS 4TRUE if this instance is equal to s .RE.PPDefinition at line 425 of file qwt_scldiv.cpp..PPReferences d_hBound, d_lBound, d_log, d_majMarks, d_majStep, and d_minMarks..SS "bool QwtScaleDiv::rebuild (double x1, double x2, int maxMajSteps, int maxMinSteps, bool log, double step = \fC0.0\fP, bool ascend = \fCTRUE\fP)".PPBuild a scale width major and minor divisions If no fixed step width is specified or if it is set to 0, the major step width will be calculated automatically according to the the value of maxMajSteps. The maxMajSteps parameter has no effect if a fixed step size is specified. The minor step width is always calculated automatically. .PPIf the step width is to be calculated automatically, the algorithm tries to find reasonable values fitting into the scheme {1,2,5}*10^n with an integer number n for linear scales..PPFor logarithmic scales, there are three different cases .PD 0.IP "1." 4If the major step width is one decade, the minor marks will fit into one of the schemes {1,2,...9}, {2,4,6,8}, {2,5} or {5}, depending on the maxMinSteps parameter. .IP "2." 4If the major step size spans more than one decade, the minor step size will be {1,2,5}*10^n decades with a natural number n. .IP "3." 4If the whole range is less than one decade, a linear scale division will be built. .PP.PP\fBParameters:\fP.RS 4\fIx1\fP first boundary value .br\fIx2\fP second boundary value .br\fImaxMajSteps\fP max. number of major step intervals .br\fImaxMinSteps\fP max. number of minor step intervals .br\fIlog\fP logarithmic division (TRUE/FALSE) .br\fIstep\fP fixed major step width. Defaults to 0.0. .br\fIascend\fP if TRUE, sort in ascending order from min(x1, x2) to max(x1, x2). If FALSE, sort in the direction from x1 to x2. Defaults to TRUE. .RE.PP\fBReturns:\fP.RS 4True if the arrays have been allocated successfully. .RE.PP\fBWarning:\fP.RS 4For logarithmic scales, the step width is measured in decades. .RE.PPDefinition at line 86 of file qwt_scldiv.cpp..PPReferenced by QwtAutoScale::build(), QwtAutoScale::buildLinScale(), QwtAutoScale::buildLogScale(), and QwtScaleDraw::setScale()..SS "void QwtScaleDiv::reset ()".PPDetach the shared data and set everything to zero. .PPDefinition at line 445 of file qwt_scldiv.cpp..PPReferenced by QwtAutoScale::reset()..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 + -