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

📄 class_qwt_spline.html

📁 QWT5.01用于Qt开发的二维图形库程序
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!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&apos;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&nbsp;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&nbsp;Pages</span></a></li>  </ul></div><div class="tabs">  <ul>    <li><a href="classes.html"><span>Alphabetical&nbsp;List</span></a></li>    <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>    <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>    <li><a href="functions.html"><span>Class&nbsp;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 &lt;qwt_spline.h&gt;</span>QPolygonF interpolate(<span class="keyword">const</span> QPolygonF&amp; <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 &lt; 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 &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_spline.html#2bd2bda128f82acd596348eb8d64231c">SplineType</a> { <br>&nbsp;&nbsp;<b>Natural</b>, <br>&nbsp;&nbsp;<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">&nbsp;</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 &amp;)" -->&nbsp;</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> &amp;)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</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 &amp;)" --><a class="el" href="class_qwt_spline.html">QwtSpline</a> &amp;&nbsp;</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> &amp;)</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&nbsp;</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>&nbsp;</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&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_spline.html#6ed13410b1d5f6b33ba0e3c2b07932cf">setPoints</a> (const QPolygonF &amp;points)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">QPolygonF&nbsp;</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&nbsp;</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&nbsp;</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&nbsp;</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&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_spline.html#1cdf09e841dd6a721eb788914273c484">buildNaturalSpline</a> (const QPolygonF &amp;)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_spline.html#8184717f8c018e69fabd1e33ac68ef19">buildPeriodicSpline</a> (const QPolygonF &amp;)</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 *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_spline.html#784545391f14c014684f391c6d92fd27">d_data</a></td></tr></table><hr><h2>Constructor &amp; 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">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </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">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </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 &amp;)" --><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">(&nbsp;</td>          <td class="md" nowrap valign="top">const QPolygonF &amp;&nbsp;</td>          <td class="mdname1" valign="top" nowrap> <em>points</em>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap><code> [protected]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing="5" cellpadding="0" border="0">  <tr>    <td>      &nbsp;    </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 &amp;)" --><p><table class="mdTable" cellpadding="2" cellspacing="0">

⌨️ 快捷键说明

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