📄 qwtdimap.3
字号:
.TH "QwtDiMap" 3 "4 Nov 2003" "Qwt User's Guide" \" -*- nroff -*-.ad l.nh.SH NAMEQwtDiMap \- .SH SYNOPSIS.br.PPInherited by \fBQwtScaleDraw\fP..PP.SH "Detailed Description".PP Map a double interval into an integer interval. The QwtDiMap class maps an interval of type double into an interval of type int. It consists of two intervals D = [d1, d2] (double) and I = [i1, i2] (int), which are specified with the \fBQwtDiMap::setDblRange\fP and \fBQwtDiMap::setIntRange\fP members. The point d1 is mapped to the point i1, and d2 is mapped to i2. Any point inside or outside D can be mapped to a point inside or outside I using \fBQwtDiMap::transform\fP or \fBQwtDiMap::limTransform\fP or vice versa using \fBQwtPlot::invTransform\fP. D can be scaled linearly or logarithmically, as specified with \fBQwtDiMap::setDblRange\fP..PP\fBUsage\fP .PP.nf#include <qwt_dimap.h>QwtDiMap map;int ival;double dval;map.setDblRange(0.0, 3.1415); // Assign an interval of type double with // linear mappingmap.setIntRange(0,100); // Assign an integer intervalival = map.transform(1.0); // obtain integer value corresponding to 1.0dval = map.invTransform(77); // obtain double value corresponding to 77.PP.PP.SS "Public Member Functions".in +1c.ti -1c.RI "\fBQwtDiMap\fP ()".br.ti -1c.RI "\fBQwtDiMap\fP (int i1, int i2, double d1, double d2, bool lg=FALSE)".br.ti -1c.RI "\fB~QwtDiMap\fP ()".br.ti -1c.RI "bool \fBcontains\fP (double x) const ".br.ti -1c.RI "bool \fBcontains\fP (int x) const ".br.ti -1c.RI "void \fBsetIntRange\fP (int i1, int i2)".br.ti -1c.RI "void \fBsetDblRange\fP (double d1, double d2, bool lg=FALSE)".br.ti -1c.RI "int \fBtransform\fP (double x) const ".br.ti -1c.RI "double \fBinvTransform\fP (int i) const ".br.ti -1c.RI "int \fBlimTransform\fP (double x) const ".br.ti -1c.RI "double \fBxTransform\fP (double x) const ".br.ti -1c.RI "double \fBd1\fP () const ".br.ti -1c.RI "double \fBd2\fP () const ".br.ti -1c.RI "int \fBi1\fP () const ".br.ti -1c.RI "int \fBi2\fP () const ".br.ti -1c.RI "bool \fBlogarithmic\fP () const ".br.in -1c.SS "Public Attributes".in +1c.ti -1c.RI "QT_STATIC_CONST double \fBLogMin\fP = 1.0e-150".br.ti -1c.RI "QT_STATIC_CONST double \fBLogMax\fP = 1.0e150".br.in -1c.SH "Constructor & Destructor Documentation".PP .SS "QwtDiMap::QwtDiMap ()".PPConstructor. The double and integer intervals are both set to [0,1]. .SS "QwtDiMap::QwtDiMap (int i1, int i2, double d1, double d2, bool logarithmic = FALSE)".PPConstructor. Constructs a QwtDiMap instance with initial integer and double intervals.PP\fBParameters:\fP.RS 4\fIi1\fP first border of integer interval .br\fIi2\fP second border of integer interval .br\fId1\fP first border of double interval .br\fId2\fP second border of double interval .br\fIlogarithmic\fP logarithmic mapping, TRUE or FALSE. .RE.PP.SS "QwtDiMap::~\fBQwtDiMap\fP ()".PPDestructor. .SH "Member Function Documentation".PP .SS "bool QwtDiMap::contains (int x) const".PP\fBReturns:\fP.RS 4TRUE if a value x lies inside or at the border of the map's integer range .RE.PP\fBParameters:\fP.RS 4\fIx\fP value .RE.PP.SS "bool QwtDiMap::contains (double x) const".PP\fBReturns:\fP.RS 4TRUE if a value x lies inside or at the border of the map's double range. .RE.PP\fBParameters:\fP.RS 4\fIx\fP value .RE.PP.SS "double QwtDiMap::d1 () const".PP\fBReturns:\fP.RS 4the first border of the double interval .RE.PP.SS "double QwtDiMap::d2 () const".PP\fBReturns:\fP.RS 4the second border of the double interval .RE.PP.SS "int QwtDiMap::i1 () const".PP\fBReturns:\fP.RS 4the second border of the integer interval .RE.PP.SS "int QwtDiMap::i2 () const".PP\fBReturns:\fP.RS 4the second border of the integer interval .RE.PP.SS "double QwtDiMap::invTransform (int y) const".PPTransform an integer value into a double value. \fBParameters:\fP.RS 4\fIy\fP integer value to be transformed .RE.PP\fBReturns:\fP.RS 4.IP "\fBlinear mapping:\fP" 1cd1 + (d2 - d1) / (i2 - i1) * (y - i1) .IP "\fBlogarithmic mapping:\fP" 1cd1 + (d2 - d1) / log(i2 / i1) * log(y / i1) .PP.RE.PP.SS "int QwtDiMap::limTransform (double x) const".PPTransform and limit. The function is similar to \fBQwtDiMap::transform\fP, but limits the input value to the nearest border of the map's double interval if it lies outside that interval..PP\fBParameters:\fP.RS 4\fIx\fP value to be transformed .RE.PP\fBReturns:\fP.RS 4transformed value .RE.PP.SS "bool QwtDiMap::logarithmic () const".PP\fBReturns:\fP.RS 4TRUE if the double interval is scaled logarithmically .RE.PP.SS "void QwtDiMap::setDblRange (double d1, double d2, bool lg = FALSE)".PPSpecify the borders of the double interval. \fBParameters:\fP.RS 4\fId1\fP first border .br\fId2\fP second border .br\fIlg\fP logarithmic (TRUE) or linear (FALSE) scaling .RE.PP.SS "void QwtDiMap::setIntRange (int i1, int i2)".PPSpecify the borders of the integer interval. \fBParameters:\fP.RS 4\fIi1\fP first border .br\fIi2\fP second border .RE.PP.SS "int QwtDiMap::transform (double x) const".PPTransform a point in double interval into an point in the integer interval. \fBParameters:\fP.RS 4\fIx\fP value .RE.PP\fBReturns:\fP.RS 4.IP "\fBlinear mapping:\fP" 1crint(i1 + (i2 - i1) / (d2 - d1) * (x - d1)) .IP "\fBlogarithmic mapping:\fP" 1crint(i1 + (i2 - i1) / log(d2 / d1) * log(x / d1)) .PP.RE.PP\fBWarning:\fP.RS 4The specified point is allowed to lie outside the intervals. If you want to limit the returned value, use \fBQwtDiMap::limTransform\fP. .RE.PP.SS "double QwtDiMap::xTransform (double x) const".PPExact transformation. This function is similar to \fBQwtDiMap::transform\fP, but makes the integer interval appear to be double. .PP\fBParameters:\fP.RS 4\fIx\fP value to be transformed .RE.PP\fBReturns:\fP.RS 4.IP "\fBlinear mapping:\fP" 1ci1 + (i2 - i1) / (d2 - d1) * (x - d1) .IP "\fBlogarithmic mapping:\fP" 1ci1 + (i2 - i1) / log(d2 / d1) * log(x / d1) .PP.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 + -