📄 class_qwt_spline.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>Qwt User's Guide: QwtSpline Class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"><link href="tabs.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.4.6 --><div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li id="current"><a href="classes.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> </ul></div><div class="tabs"> <ul> <li><a href="classes.html"><span>Alphabetical List</span></a></li> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul></div><h1>QwtSpline Class Reference</h1><!-- doxytag: class="QwtSpline" --><a href="class_qwt_spline-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>A class for spline interpolation. <p>The <a class="el" href="class_qwt_spline.html">QwtSpline</a> class is used for cubical spline interpolation. Two types of splines, natural and periodic, are supported.<p><dl compact><dt><b>Usage:</b></dt><dd><ol><li>First call <a class="el" href="class_qwt_spline.html#6ed13410b1d5f6b33ba0e3c2b07932cf">setPoints()</a> to determine the spline coefficients for a tabulated function y(x). </li><li>After the coefficients have been set up, the interpolated function value for an argument x can be determined by calling <a class="el" href="class_qwt_spline.html#1f67187eefe2959f0c902532edf64d41">QwtSpline::value()</a>. </li></ol></dd></dl><dl compact><dt><b>Example:</b></dt><dd><div class="fragment"><pre class="fragment"><span class="preprocessor">#include <qwt_spline.h></span>QPolygonF interpolate(<span class="keyword">const</span> QPolygonF& <a class="code" href="class_qwt_spline.html#14694e61052933921eda629062554d22">points</a>, <span class="keywordtype">int</span> numValues){ <a class="code" href="class_qwt_spline.html">QwtSpline</a> spline; <span class="keywordflow">if</span> ( !spline.<a class="code" href="class_qwt_spline.html#6ed13410b1d5f6b33ba0e3c2b07932cf">setPoints</a>(points) ) <span class="keywordflow">return</span> points; QPolygonF interpolatedPoints(numValues); <span class="keyword">const</span> <span class="keywordtype">double</span> delta = (points[numPoints - 1].x() - points[0].x()) / (points.size() - 1); <span class="keywordflow">for</span>(i = 0; i < points.size(); i++) / interpolate { <span class="keyword">const</span> <span class="keywordtype">double</span> x = points[0].x() + i * delta; interpolatedPoints[i].setX(x); interpolatedPoints[i].setY(spline.<a class="code" href="class_qwt_spline.html#1f67187eefe2959f0c902532edf64d41">value</a>(x)); } <span class="keywordflow">return</span> interpolatedPoints;}</pre></div> </dd></dl><p><p>Definition at line <a class="el" href="qwt__spline_8h-source.html#l00077">77</a> of file <a class="el" href="qwt__spline_8h-source.html">qwt_spline.h</a>.<table border="0" cellpadding="0" cellspacing="0"><tr><td></td></tr><tr><td colspan="2"><br><h2>Public Types</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_spline.html#2bd2bda128f82acd596348eb8d64231c">SplineType</a> { <br> <b>Natural</b>, <br> <b>Periodic</b><br> }</td></tr><tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_spline.html#5d1e0ba35c637a88c66d9e4cbaf36e93">QwtSpline</a> ()</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2e42391f76d0b3091bf7754239f3ff0d"></a><!-- doxytag: member="QwtSpline::QwtSpline" ref="2e42391f76d0b3091bf7754239f3ff0d" args="(const QwtSpline &)" --> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_spline.html#2e42391f76d0b3091bf7754239f3ff0d">QwtSpline</a> (const <a class="el" href="class_qwt_spline.html">QwtSpline</a> &)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_spline.html#90805882826469c94fdc871f18261bb6">~QwtSpline</a> ()</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8a597c34477dd4b5298db2d445b4e596"></a><!-- doxytag: member="QwtSpline::operator=" ref="8a597c34477dd4b5298db2d445b4e596" args="(const QwtSpline &)" --><a class="el" href="class_qwt_spline.html">QwtSpline</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_spline.html#8a597c34477dd4b5298db2d445b4e596">operator=</a> (const <a class="el" href="class_qwt_spline.html">QwtSpline</a> &)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="222953661f01658a16042d587196aff8"></a><!-- doxytag: member="QwtSpline::setSplineType" ref="222953661f01658a16042d587196aff8" args="(SplineType)" -->void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_spline.html#222953661f01658a16042d587196aff8">setSplineType</a> (<a class="el" href="class_qwt_spline.html#2bd2bda128f82acd596348eb8d64231c">SplineType</a>)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="36442cbb781422e5b97ae242265dd4b4"></a><!-- doxytag: member="QwtSpline::splineType" ref="36442cbb781422e5b97ae242265dd4b4" args="() const " --><a class="el" href="class_qwt_spline.html#2bd2bda128f82acd596348eb8d64231c">SplineType</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_spline.html#36442cbb781422e5b97ae242265dd4b4">splineType</a> () const </td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_spline.html#6ed13410b1d5f6b33ba0e3c2b07932cf">setPoints</a> (const QPolygonF &points)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">QPolygonF </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_spline.html#14694e61052933921eda629062554d22">points</a> () const </td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_spline.html#fc52fd49e7f00d57a0336059fae299c0">reset</a> ()</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_spline.html#8eb42cf7f0f81bb7b7b885466f8ebbbf">isValid</a> () const </td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_spline.html#1f67187eefe2959f0c902532edf64d41">value</a> (double x) const </td></tr><tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_spline.html#1cdf09e841dd6a721eb788914273c484">buildNaturalSpline</a> (const QPolygonF &)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_spline.html#8184717f8c018e69fabd1e33ac68ef19">buildPeriodicSpline</a> (const QPolygonF &)</td></tr><tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="784545391f14c014684f391c6d92fd27"></a><!-- doxytag: member="QwtSpline::d_data" ref="784545391f14c014684f391c6d92fd27" args="" -->PrivateData * </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_spline.html#784545391f14c014684f391c6d92fd27">d_data</a></td></tr></table><hr><h2>Constructor & Destructor Documentation</h2><a class="anchor" name="5d1e0ba35c637a88c66d9e4cbaf36e93"></a><!-- doxytag: member="QwtSpline::QwtSpline" ref="5d1e0ba35c637a88c66d9e4cbaf36e93" args="()" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">QwtSpline::QwtSpline </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Constructor. <p><p>Definition at line <a class="el" href="qwt__spline_8cpp-source.html#l00073">73</a> of file <a class="el" href="qwt__spline_8cpp-source.html">qwt_spline.cpp</a>.<p>References <a class="el" href="qwt__spline_8h-source.html#l00121">d_data</a>. </td> </tr></table><a class="anchor" name="90805882826469c94fdc871f18261bb6"></a><!-- doxytag: member="QwtSpline::~QwtSpline" ref="90805882826469c94fdc871f18261bb6" args="()" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">QwtSpline::~QwtSpline </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Destructor. <p><p>Definition at line <a class="el" href="qwt__spline_8cpp-source.html#l00090">90</a> of file <a class="el" href="qwt__spline_8cpp-source.html">qwt_spline.cpp</a>.<p>References <a class="el" href="qwt__spline_8h-source.html#l00121">d_data</a>. </td> </tr></table><hr><h2>Member Function Documentation</h2><a class="anchor" name="1cdf09e841dd6a721eb788914273c484"></a><!-- doxytag: member="QwtSpline::buildNaturalSpline" ref="1cdf09e841dd6a721eb788914273c484" args="(const QPolygonF &)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">bool QwtSpline::buildNaturalSpline </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const QPolygonF & </td> <td class="mdname1" valign="top" nowrap> <em>points</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [protected]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Determines the coefficients for a natural spline. <p><dl compact><dt><b>Returns:</b></dt><dd>true if successful </dd></dl><p>Definition at line <a class="el" href="qwt__spline_8cpp-source.html#l00209">209</a> of file <a class="el" href="qwt__spline_8cpp-source.html">qwt_spline.cpp</a>. </td> </tr></table><a class="anchor" name="8184717f8c018e69fabd1e33ac68ef19"></a><!-- doxytag: member="QwtSpline::buildPeriodicSpline" ref="8184717f8c018e69fabd1e33ac68ef19" args="(const QPolygonF &)" --><p><table class="mdTable" cellpadding="2" cellspacing="0">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -