Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 350eb50c9ea7f887b47954b9fc238f01 > files > 113

libQGLViewer-doc-2.3.6-1.fc14.noarch.rpm

<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>libQGLViewer: KeyFrameInterpolator Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link rel="shortcut icon" href="../images/qglviewer.ico" type="image/x-icon" />
<link rel="icon" href="../images/qglviewer.icon.png" type="image/png" />
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.6.2 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="../index.html"><span>Main&nbsp;Page</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>

      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <img id="MSearchSelect" src="search/search.png"
             onmouseover="return searchBox.OnSearchSelectShow()"
             onmouseout="return searchBox.OnSearchSelectHide()"
             alt=""/>
        <input type="text" id="MSearchField" value="Search" accesskey="S"
             onfocus="searchBox.OnSearchFieldFocus(true)" 
             onblur="searchBox.OnSearchFieldFocus(false)" 
             onkeyup="searchBox.OnSearchFieldChange(event)"/>
        <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
        </div>
      </li>
    </ul>
  </div>
  </div>
</div>
<div class="contents">
<h1>KeyFrameInterpolator Class Reference</h1><!-- doxytag: class="qglviewer::KeyFrameInterpolator" -->
<p>A keyFrame Catmull-Rom <a class="el" href="classqglviewer_1_1Frame.html" title="The Frame class represents a coordinate system, defined by a position and an orientation...">Frame</a> interpolator.  
<a href="#_details">More...</a></p>

<p><a href="classqglviewer_1_1KeyFrameInterpolator-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Signals</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#ab55c2a4f1732b90057fae4b6037399de">interpolated</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#ab4010a17bf77b9940b120ee8ed9a0271">endReached</a> ()</td></tr>
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a2a78bc183af3ac92802cbe605e2a878e">KeyFrameInterpolator</a> (<a class="el" href="classqglviewer_1_1Frame.html">Frame</a> *fr=NULL)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a110b875f9265a30f7a520a3603362f95">~KeyFrameInterpolator</a> ()</td></tr>
<tr><td colspan="2"><h2>Associated Frame</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classqglviewer_1_1Frame.html">Frame</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5426b68b2b1bb6ad8dc0007914412b4f">frame</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a1e16bb31ee6240a9f0e3a6824f4bef0d">setFrame</a> (<a class="el" href="classqglviewer_1_1Frame.html">Frame</a> *const frame)</td></tr>
<tr><td colspan="2"><h2>Path parameters</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classqglviewer_1_1Frame.html">Frame</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a2437eecf340817ad1a3f86c822b111e8">keyFrame</a> (int index) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">float&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a976ec792d48ccd7e53b55bb91b49d473">keyFrameTime</a> (int index) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#aba3744250d9cd01ec848f81151a62273">numberOfKeyFrames</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">float&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a80c858ec25677a47d066e0900f4e1980">duration</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">float&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5335f8bedcb11c4e9cc06cbbab838477">firstTime</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">float&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a3e953e6c813baa461389c132c9509e30">lastTime</a> () const </td></tr>
<tr><td colspan="2"><h2>Interpolation parameters</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">float&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a58326b7948e78c1d2861ca659492207a">interpolationTime</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">float&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a7e468c84c27d896e341563c83e102aad">interpolationSpeed</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a21bf6165ea3a6be2fd854e9be5105b1e">interpolationPeriod</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a906c17cf6c1d51a54c7d3b9b4c9cbd45">loopInterpolation</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#ab860af88ea46ecedb2a648157bb68dc3">setInterpolationTime</a> (float time)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a3cc64e95e1b8dfda110bcf3d033ecf2d">setInterpolationSpeed</a> (float speed)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a9763e647346a8bee885517d9985173fd">setInterpolationPeriod</a> (int period)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a31a491ac2ac016298cbd1c66f07be6dd">setLoopInterpolation</a> (bool loop=true)</td></tr>
<tr><td colspan="2"><h2>Interpolation</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a8cc0fa56ba7b6da71226cc191cc18e70">interpolationIsStarted</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a3c0098b2307d04e904c1f64f505e5819">startInterpolation</a> (int period=-1)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a16f0910299ae07cede3396a14ec01f4b">stopInterpolation</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a0bfc602dc2fcaca40cc49195bba7ba74">resetInterpolation</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#acf744bd8ce09e5433f829f63ba310eef">toggleInterpolation</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#ad5393783e1768b6d688a8c49ddea56ae">interpolateAtTime</a> (float time)</td></tr>
<tr><td colspan="2"><h2>Path drawing</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#aca0ce46b39ad4093450019d77fd247f2">drawPath</a> (int mask=1, int nbFrames=6, float scale=1.0f)</td></tr>
<tr><td colspan="2"><h2>XML representation</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual QDomElement&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a48e0e2dd26cd96418c8b889ceabe80f6">domElement</a> (const QString &amp;name, QDomDocument &amp;document) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#acd13d2ddeca530cb9f26ead47f7d25d3">initFromDOMElement</a> (const QDomElement &amp;element)</td></tr>
<tr><td colspan="2"><h2>Path creation</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a44ac54529e675a2157067c9d205d9622">addKeyFrame</a> (const <a class="el" href="classqglviewer_1_1Frame.html">Frame</a> &amp;frame)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a379af0370e27c513c4d9091bff272b40">addKeyFrame</a> (const <a class="el" href="classqglviewer_1_1Frame.html">Frame</a> &amp;frame, float time)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a23d3166003e0355b718f34a3e6c92a1b">addKeyFrame</a> (const <a class="el" href="classqglviewer_1_1Frame.html">Frame</a> *const frame)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#aa821392c6e108d5c7814317b8c3cd47f">addKeyFrame</a> (const <a class="el" href="classqglviewer_1_1Frame.html">Frame</a> *const frame, float time)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#ae343912505ce83d62bea580a83c7bc34">deletePath</a> ()</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>A keyFrame Catmull-Rom <a class="el" href="classqglviewer_1_1Frame.html" title="The Frame class represents a coordinate system, defined by a position and an orientation...">Frame</a> interpolator. </p>
<p>A KeyFrameInterpolator holds keyFrames (that define a path) and a pointer to a <a class="el" href="classqglviewer_1_1Frame.html" title="The Frame class represents a coordinate system, defined by a position and an orientation...">Frame</a> of your application (which will be interpolated). When the user <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a3c0098b2307d04e904c1f64f505e5819">startInterpolation()</a>, the KeyFrameInterpolator regularly updates the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5426b68b2b1bb6ad8dc0007914412b4f">frame()</a> position and orientation along the path.</p>
<p>Here is a typical utilization example (see also the <a href="../examples/keyFrames.html">keyFrames example</a>): </p>
<div class="fragment"><pre class="fragment">  init()
  {
    <span class="comment">// The KeyFrameInterpolator kfi is given the Frame that it will drive over time.</span>
    kfi = <span class="keyword">new</span> <a class="code" href="classqglviewer_1_1KeyFrameInterpolator.html#a2a78bc183af3ac92802cbe605e2a878e">KeyFrameInterpolator</a>( <span class="keyword">new</span> Frame() );
    kfi-&gt;addKeyFrame( Frame( Vec(1,0,0), Quaternion() ) );
    kfi-&gt;addKeyFrame( <span class="keyword">new</span> Frame( Vec(2,1,0), Quaternion() ) );
    <span class="comment">// ...and so on for all the keyFrames.</span>

    <span class="comment">// Ask for a display update after each update of the KeyFrameInterpolator</span>
    connect(kfi, SIGNAL(<a class="code" href="classqglviewer_1_1KeyFrameInterpolator.html#ab55c2a4f1732b90057fae4b6037399de">interpolated</a>()), SLOT(updateGL()));

    kfi-&gt;startInterpolation();
  }

  draw()
  {
    glPushMatrix();
    glMultMatrixd( kfi-&gt;frame()-&gt;matrix() );
    <span class="comment">// Draw your object here. Its position and orientation are interpolated.</span>
    glPopMatrix();
  }
</pre></div><p>The keyFrames are defined by a <a class="el" href="classqglviewer_1_1Frame.html" title="The Frame class represents a coordinate system, defined by a position and an orientation...">Frame</a> and a time, expressed in seconds. The <a class="el" href="classqglviewer_1_1Frame.html" title="The Frame class represents a coordinate system, defined by a position and an orientation...">Frame</a> can be provided as a const reference or as a pointer to a <a class="el" href="classqglviewer_1_1Frame.html" title="The Frame class represents a coordinate system, defined by a position and an orientation...">Frame</a> (see the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a44ac54529e675a2157067c9d205d9622">addKeyFrame()</a> methods). In the latter case, the path will automatically be updated when the <a class="el" href="classqglviewer_1_1Frame.html" title="The Frame class represents a coordinate system, defined by a position and an orientation...">Frame</a> is modified (using the <a class="el" href="classqglviewer_1_1Frame.html#ab6722375e68e03d151762ebfc83c5459">Frame::modified()</a> signal).</p>
<p>The time has to be monotonously increasing over keyFrames. When <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a7e468c84c27d896e341563c83e102aad">interpolationSpeed()</a> equals 1.0 (default value), these times correspond to actual user's seconds during interpolation (provided that your main loop is fast enough). The interpolation is then real-time: the keyFrames will be reached at their <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a976ec792d48ccd7e53b55bb91b49d473">keyFrameTime()</a>.</p>
<h3>Interpolation details</h3>
<p>When the user <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a3c0098b2307d04e904c1f64f505e5819">startInterpolation()</a>, a timer is started which will update the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5426b68b2b1bb6ad8dc0007914412b4f">frame()</a>'s position and orientation every <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a21bf6165ea3a6be2fd854e9be5105b1e">interpolationPeriod()</a> milliseconds. This update increases the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a58326b7948e78c1d2861ca659492207a">interpolationTime()</a> by <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a21bf6165ea3a6be2fd854e9be5105b1e">interpolationPeriod()</a> * <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a7e468c84c27d896e341563c83e102aad">interpolationSpeed()</a> milliseconds.</p>
<p>Note that this mechanism ensures that the number of interpolation steps is constant and equal to the total path <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a80c858ec25677a47d066e0900f4e1980">duration()</a> divided by the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a21bf6165ea3a6be2fd854e9be5105b1e">interpolationPeriod()</a> * <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a7e468c84c27d896e341563c83e102aad">interpolationSpeed()</a>. This is especially useful for benchmarking or movie creation (constant number of snapshots).</p>
<p>During the interpolation, the KeyFrameInterpolator emits an <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#ab55c2a4f1732b90057fae4b6037399de">interpolated()</a> signal, which will usually be connected to the <a class="el" href="classQGLViewer.html#ae12b7378efbffabc24a133ca1deb19ae">QGLViewer::updateGL()</a> slot. The interpolation is stopped when <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a58326b7948e78c1d2861ca659492207a">interpolationTime()</a> is greater than the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a3e953e6c813baa461389c132c9509e30">lastTime()</a> (unless <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a906c17cf6c1d51a54c7d3b9b4c9cbd45">loopInterpolation()</a> is <code>true</code>) and the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#ab4010a17bf77b9940b120ee8ed9a0271">endReached()</a> signal is then emitted.</p>
<p>Note that a <a class="el" href="classqglviewer_1_1Camera.html" title="A perspective or orthographic camera.">Camera</a> has <a class="el" href="classqglviewer_1_1Camera.html#abfbef567a6bbb9163b31c6f46238e4de">Camera::keyFrameInterpolator()</a>, that can be used to drive the <a class="el" href="classqglviewer_1_1Camera.html" title="A perspective or orthographic camera.">Camera</a> along a path, or to restore a saved position (a path made of a single keyFrame). Press Alt+Fx to define a new keyFrame for path x. Pressing Fx plays/pauses path interpolation. See <a class="el" href="classQGLViewer.html#adfe21e109b45f8c79f2c360bf35fb835">QGLViewer::pathKey()</a> and the <a href="../keyboard.html">keyboard page</a> for details.</p>
<dl class="attention"><dt><b>Attention:</b></dt><dd>If a <a class="el" href="classqglviewer_1_1Constraint.html" title="An interface class for Frame constraints.">Constraint</a> is attached to the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5426b68b2b1bb6ad8dc0007914412b4f">frame()</a> (see <a class="el" href="classqglviewer_1_1Frame.html#a0974dfe336ed84a20adb8c6cdf8dedd9">Frame::constraint()</a>), it should be deactivated before <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a8cc0fa56ba7b6da71226cc191cc18e70">interpolationIsStarted()</a>, otherwise the interpolated motion (computed as if there was no constraint) will probably be erroneous.</dd></dl>
<h3>Retrieving interpolated values</h3>
<p>This code defines a KeyFrameInterpolator, and displays the positions that will be followed by the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5426b68b2b1bb6ad8dc0007914412b4f">frame()</a> along the path: </p>
<div class="fragment"><pre class="fragment">  <a class="code" href="classqglviewer_1_1KeyFrameInterpolator.html#a2a78bc183af3ac92802cbe605e2a878e">KeyFrameInterpolator</a> kfi( <span class="keyword">new</span> Frame() );
  <span class="comment">// calls to kfi.addKeyFrame() to define the path.</span>

  <span class="keyword">const</span> <span class="keywordtype">float</span> deltaTime = 0.04; <span class="comment">// output a position every deltaTime seconds</span>
  <span class="keywordflow">for</span> (<span class="keywordtype">float</span> time=kfi.firstTime(); time&lt;=kfi.lastTime(); time += deltaTime)
  {
    kfi.interpolateAtTime(time);
    cout &lt;&lt; <span class="stringliteral">&quot;t=&quot;</span> &lt;&lt; time &lt;&lt; <span class="stringliteral">&quot;\tpos=&quot;</span> &lt;&lt; kfi.frame()-&gt;position() &lt;&lt; endl;
  }
</pre></div><p> You may want to temporally disconnect the <code>kfi</code> <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#ab55c2a4f1732b90057fae4b6037399de">interpolated()</a> signal from the <a class="el" href="classQGLViewer.html#ae12b7378efbffabc24a133ca1deb19ae">QGLViewer::updateGL()</a> slot before calling this code. </p>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a2a78bc183af3ac92802cbe605e2a878e"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::KeyFrameInterpolator" ref="a2a78bc183af3ac92802cbe605e2a878e" args="(Frame *fr=NULL)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">KeyFrameInterpolator </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classqglviewer_1_1Frame.html">Frame</a> *&nbsp;</td>
          <td class="paramname"> <em>frame</em> = <code>NULL</code></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Creates a KeyFrameInterpolator, with <code>frame</code> as associated <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5426b68b2b1bb6ad8dc0007914412b4f">frame()</a>.</p>
<p>The <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5426b68b2b1bb6ad8dc0007914412b4f">frame()</a> can be set or changed using <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a1e16bb31ee6240a9f0e3a6824f4bef0d">setFrame()</a>.</p>
<p><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a58326b7948e78c1d2861ca659492207a">interpolationTime()</a>, <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a7e468c84c27d896e341563c83e102aad">interpolationSpeed()</a> and <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a21bf6165ea3a6be2fd854e9be5105b1e">interpolationPeriod()</a> are set to their default values. </p>

</div>
</div>
<a class="anchor" id="a110b875f9265a30f7a520a3603362f95"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::~KeyFrameInterpolator" ref="a110b875f9265a30f7a520a3603362f95" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">~KeyFrameInterpolator </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Virtual destructor. Clears the keyFrame path. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="aa821392c6e108d5c7814317b8c3cd47f"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::addKeyFrame" ref="aa821392c6e108d5c7814317b8c3cd47f" args="(const Frame *const frame, float time)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void addKeyFrame </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classqglviewer_1_1Frame.html">Frame</a> *const &nbsp;</td>
          <td class="paramname"> <em>frame</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&nbsp;</td>
          <td class="paramname"> <em>time</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [slot]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Appends a new keyFrame to the path, with its associated <code>time</code> (in seconds).</p>
<p>The keyFrame is given as a pointer to a <a class="el" href="classqglviewer_1_1Frame.html" title="The Frame class represents a coordinate system, defined by a position and an orientation...">Frame</a>, which will be connected to the KeyFrameInterpolator: when <code>frame</code> is modified, the KeyFrameInterpolator path is updated accordingly. This allows for dynamic paths, where keyFrame can be edited, even during the interpolation. See the <a href="../examples/keyFrames.html">keyFrames example</a> for an illustration.</p>
<p><code>NULL</code> <code>frame</code> pointers are silently ignored. The <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a976ec792d48ccd7e53b55bb91b49d473">keyFrameTime()</a> has to be monotonously increasing over keyFrames.</p>
<p>Use <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a379af0370e27c513c4d9091bff272b40">addKeyFrame(const Frame&amp;, float)</a> to add keyFrame by values. </p>

</div>
</div>
<a class="anchor" id="a23d3166003e0355b718f34a3e6c92a1b"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::addKeyFrame" ref="a23d3166003e0355b718f34a3e6c92a1b" args="(const Frame *const frame)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void addKeyFrame </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classqglviewer_1_1Frame.html">Frame</a> *const &nbsp;</td>
          <td class="paramname"> <em>frame</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [slot]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Appends a new keyFrame to the path.</p>
<p>Same as <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#aa821392c6e108d5c7814317b8c3cd47f">addKeyFrame(const Frame* frame, float)</a>, except that the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a976ec792d48ccd7e53b55bb91b49d473">keyFrameTime()</a> is set to the previous <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a976ec792d48ccd7e53b55bb91b49d473">keyFrameTime()</a> plus one second (or 0.0 if there is no previous keyFrame). </p>

</div>
</div>
<a class="anchor" id="a379af0370e27c513c4d9091bff272b40"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::addKeyFrame" ref="a379af0370e27c513c4d9091bff272b40" args="(const Frame &amp;frame, float time)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void addKeyFrame </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classqglviewer_1_1Frame.html">Frame</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>frame</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&nbsp;</td>
          <td class="paramname"> <em>time</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [slot]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Appends a new keyFrame to the path, with its associated <code>time</code> (in seconds).</p>
<p>The path will use the current <code>frame</code> state. If you want the path to change when <code>frame</code> is modified, you need to pass a <em>pointer</em> to the <a class="el" href="classqglviewer_1_1Frame.html" title="The Frame class represents a coordinate system, defined by a position and an orientation...">Frame</a> instead (see addKeyFrame(const Frame*, float)).</p>
<p>The <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a976ec792d48ccd7e53b55bb91b49d473">keyFrameTime()</a> have to be monotonously increasing over keyFrames. </p>

</div>
</div>
<a class="anchor" id="a44ac54529e675a2157067c9d205d9622"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::addKeyFrame" ref="a44ac54529e675a2157067c9d205d9622" args="(const Frame &amp;frame)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void addKeyFrame </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classqglviewer_1_1Frame.html">Frame</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>frame</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [slot]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Appends a new keyFrame to the path.</p>
<p>Same as <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a379af0370e27c513c4d9091bff272b40">addKeyFrame(const Frame&amp; frame, float)</a>, except that the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a976ec792d48ccd7e53b55bb91b49d473">keyFrameTime()</a> is automatically set to previous <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a976ec792d48ccd7e53b55bb91b49d473">keyFrameTime()</a> plus one second (or 0.0 if there is no previous keyFrame). </p>

</div>
</div>
<a class="anchor" id="ae343912505ce83d62bea580a83c7bc34"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::deletePath" ref="ae343912505ce83d62bea580a83c7bc34" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void deletePath </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [slot]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Removes all keyFrames from the path. The <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#aba3744250d9cd01ec848f81151a62273">numberOfKeyFrames()</a> is set to 0. </p>

</div>
</div>
<a class="anchor" id="a48e0e2dd26cd96418c8b889ceabe80f6"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::domElement" ref="a48e0e2dd26cd96418c8b889ceabe80f6" args="(const QString &amp;name, QDomDocument &amp;document) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QDomElement domElement </td>
          <td>(</td>
          <td class="paramtype">const QString &amp;&nbsp;</td>
          <td class="paramname"> <em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">QDomDocument &amp;&nbsp;</td>
          <td class="paramname"> <em>document</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns an XML <code>QDomElement</code> that represents the KeyFrameInterpolator.</p>
<p>The resulting QDomElement holds the KeyFrameInterpolator parameters as well as the path keyFrames (if the keyFrame is defined by a pointer to a <a class="el" href="classqglviewer_1_1Frame.html" title="The Frame class represents a coordinate system, defined by a position and an orientation...">Frame</a>, use its current value).</p>
<p><code>name</code> is the name of the QDomElement tag. <code>doc</code> is the <code>QDomDocument</code> factory used to create QDomElement.</p>
<p>Use <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#acd13d2ddeca530cb9f26ead47f7d25d3">initFromDOMElement()</a> to restore the <a class="el" href="classqglviewer_1_1ManipulatedFrame.html" title="A ManipulatedFrame is a Frame that can be rotated and translated using the mouse...">ManipulatedFrame</a> state from the resulting QDomElement.</p>
<p>See <a class="el" href="classqglviewer_1_1Vec.html#a48e0e2dd26cd96418c8b889ceabe80f6">Vec::domElement()</a> for a complete example. See also <a class="el" href="classqglviewer_1_1Quaternion.html#a48e0e2dd26cd96418c8b889ceabe80f6">Quaternion::domElement()</a>, <a class="el" href="classqglviewer_1_1Camera.html#a48e0e2dd26cd96418c8b889ceabe80f6">Camera::domElement()</a>...</p>
<p>Note that the <a class="el" href="classqglviewer_1_1Camera.html#abfbef567a6bbb9163b31c6f46238e4de">Camera::keyFrameInterpolator()</a> are automatically saved by <a class="el" href="classQGLViewer.html#aaec9168a5f41b3b7fa4211523535ceaa">QGLViewer::saveStateToFile()</a> when a <a class="el" href="classQGLViewer.html" title="A versatile 3D OpenGL viewer based on QGLWidget.">QGLViewer</a> is closed. </p>

</div>
</div>
<a class="anchor" id="aca0ce46b39ad4093450019d77fd247f2"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::drawPath" ref="aca0ce46b39ad4093450019d77fd247f2" args="(int mask=1, int nbFrames=6, float scale=1.0f)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void drawPath </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>mask</em> = <code>1</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>nbFrames</em> = <code>6</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&nbsp;</td>
          <td class="paramname"> <em>scale</em> = <code>1.0f</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Draws the path used to interpolate the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5426b68b2b1bb6ad8dc0007914412b4f">frame()</a>.</p>
<p><code>mask</code> controls what is drawn: if (mask &amp; 1) (default), the position path is drawn. If (mask &amp; 2), a camera representation is regularly drawn and if (mask &amp; 4), an oriented axis is regularly drawn. Examples:</p>
<div class="fragment"><pre class="fragment">  <a class="code" href="classqglviewer_1_1KeyFrameInterpolator.html#aca0ce46b39ad4093450019d77fd247f2">drawPath</a>();  <span class="comment">// Simply draws the interpolation path</span>
  <a class="code" href="classqglviewer_1_1KeyFrameInterpolator.html#aca0ce46b39ad4093450019d77fd247f2">drawPath</a>(3); <span class="comment">// Draws path and cameras</span>
  <a class="code" href="classqglviewer_1_1KeyFrameInterpolator.html#aca0ce46b39ad4093450019d77fd247f2">drawPath</a>(5); <span class="comment">// Draws path and axis</span>
</pre></div><p>In the case where camera or axis is drawn, <code>nbFrames</code> controls the number of objects (axis or camera) drawn between two successive keyFrames. When <code>nbFrames=1</code>, only the path KeyFrames are drawn. <code>nbFrames=2</code> also draws the intermediate orientation, etc. The maximum value is 30. <code>nbFrames</code> should divide 30 so that an object is drawn for each KeyFrame. Default value is 6.</p>
<p><code>scale</code> (default=1.0) controls the scaling of the camera and axis drawing. A value of <a class="el" href="classQGLViewer.html#a58c17044cc4a601c6b446bf5e83513f9">QGLViewer::sceneRadius()</a> should give good results.</p>
<p>See the <a href="../examples/keyFrames.html">keyFrames example</a> for an illustration.</p>
<p>The color of the path is the current <code>glColor()</code>.</p>
<dl class="attention"><dt><b>Attention:</b></dt><dd>The OpenGL state is modified by this method: GL_LIGHTING is disabled and line width set to 2. Use this code to preserve your current OpenGL state: <div class="fragment"><pre class="fragment">  glPushAttrib(GL_ALL_ATTRIB_BITS);
  drawPathModifyGLState(mask, nbFrames, scale);
  glPopAttrib();
</pre></div> </dd></dl>

</div>
</div>
<a class="anchor" id="a80c858ec25677a47d066e0900f4e1980"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::duration" ref="a80c858ec25677a47d066e0900f4e1980" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float duration </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the duration of the KeyFrameInterpolator path, expressed in seconds.</p>
<p>Simply corresponds to <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a3e953e6c813baa461389c132c9509e30">lastTime()</a> - <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5335f8bedcb11c4e9cc06cbbab838477">firstTime()</a>. Returns 0.0 if the path has less than 2 keyFrames. See also <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a976ec792d48ccd7e53b55bb91b49d473">keyFrameTime()</a>. </p>

</div>
</div>
<a class="anchor" id="ab4010a17bf77b9940b120ee8ed9a0271"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::endReached" ref="ab4010a17bf77b9940b120ee8ed9a0271" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void endReached </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [signal]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This signal is emitted when the interpolation reaches the first (when <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a7e468c84c27d896e341563c83e102aad">interpolationSpeed()</a> is negative) or the last keyFrame.</p>
<p>When <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a906c17cf6c1d51a54c7d3b9b4c9cbd45">loopInterpolation()</a> is <code>true</code>, <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a58326b7948e78c1d2861ca659492207a">interpolationTime()</a> is reset and the interpolation continues. It otherwise stops. </p>

</div>
</div>
<a class="anchor" id="a5335f8bedcb11c4e9cc06cbbab838477"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::firstTime" ref="a5335f8bedcb11c4e9cc06cbbab838477" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float firstTime </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the time corresponding to the first keyFrame, expressed in seconds.</p>
<p>Returns 0.0 if the path is empty. See also <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a3e953e6c813baa461389c132c9509e30">lastTime()</a>, <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a80c858ec25677a47d066e0900f4e1980">duration()</a> and <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a976ec792d48ccd7e53b55bb91b49d473">keyFrameTime()</a>. </p>

</div>
</div>
<a class="anchor" id="a5426b68b2b1bb6ad8dc0007914412b4f"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::frame" ref="a5426b68b2b1bb6ad8dc0007914412b4f" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classqglviewer_1_1Frame.html">Frame</a>* frame </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the associated <a class="el" href="classqglviewer_1_1Frame.html" title="The Frame class represents a coordinate system, defined by a position and an orientation...">Frame</a> and that is interpolated by the KeyFrameInterpolator.</p>
<p>When <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a8cc0fa56ba7b6da71226cc191cc18e70">interpolationIsStarted()</a>, this Frame's position and orientation will regularly be updated by a timer, so that they follow the KeyFrameInterpolator path.</p>
<p>Set using <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a1e16bb31ee6240a9f0e3a6824f4bef0d">setFrame()</a> or with the KeyFrameInterpolator constructor. </p>

</div>
</div>
<a class="anchor" id="acd13d2ddeca530cb9f26ead47f7d25d3"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::initFromDOMElement" ref="acd13d2ddeca530cb9f26ead47f7d25d3" args="(const QDomElement &amp;element)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void initFromDOMElement </td>
          <td>(</td>
          <td class="paramtype">const QDomElement &amp;&nbsp;</td>
          <td class="paramname"> <em>element</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Restores the KeyFrameInterpolator state from a <code>QDomElement</code> created by <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a48e0e2dd26cd96418c8b889ceabe80f6">domElement()</a>.</p>
<p>Note that the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5426b68b2b1bb6ad8dc0007914412b4f">frame()</a> pointer is not included in the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a48e0e2dd26cd96418c8b889ceabe80f6">domElement()</a>: you need to <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a1e16bb31ee6240a9f0e3a6824f4bef0d">setFrame()</a> after this method to attach a <a class="el" href="classqglviewer_1_1Frame.html" title="The Frame class represents a coordinate system, defined by a position and an orientation...">Frame</a> to the KeyFrameInterpolator.</p>
<p>See <a class="el" href="classqglviewer_1_1Vec.html#acd13d2ddeca530cb9f26ead47f7d25d3">Vec::initFromDOMElement()</a> for a complete code example.</p>
<p>See also <a class="el" href="classqglviewer_1_1Camera.html#acd13d2ddeca530cb9f26ead47f7d25d3">Camera::initFromDOMElement()</a> and <a class="el" href="classqglviewer_1_1Frame.html#acd13d2ddeca530cb9f26ead47f7d25d3">Frame::initFromDOMElement()</a>. </p>

</div>
</div>
<a class="anchor" id="ad5393783e1768b6d688a8c49ddea56ae"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::interpolateAtTime" ref="ad5393783e1768b6d688a8c49ddea56ae" args="(float time)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void interpolateAtTime </td>
          <td>(</td>
          <td class="paramtype">float&nbsp;</td>
          <td class="paramname"> <em>time</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual, slot]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Interpolate <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5426b68b2b1bb6ad8dc0007914412b4f">frame()</a> at time <code>time</code> (expressed in seconds). <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a58326b7948e78c1d2861ca659492207a">interpolationTime()</a> is set to <code>time</code> and <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5426b68b2b1bb6ad8dc0007914412b4f">frame()</a> is set accordingly.</p>
<p>If you simply want to change <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a58326b7948e78c1d2861ca659492207a">interpolationTime()</a> but not the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5426b68b2b1bb6ad8dc0007914412b4f">frame()</a> state, use <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#ab860af88ea46ecedb2a648157bb68dc3">setInterpolationTime()</a> instead.</p>
<p>Emits the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#ab55c2a4f1732b90057fae4b6037399de">interpolated()</a> signal and makes the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5426b68b2b1bb6ad8dc0007914412b4f">frame()</a> emit the <a class="el" href="classqglviewer_1_1Frame.html#ab55c2a4f1732b90057fae4b6037399de">Frame::interpolated()</a> signal. </p>

</div>
</div>
<a class="anchor" id="ab55c2a4f1732b90057fae4b6037399de"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::interpolated" ref="ab55c2a4f1732b90057fae4b6037399de" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void interpolated </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [signal]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This signal is emitted whenever the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5426b68b2b1bb6ad8dc0007914412b4f">frame()</a> state is interpolated.</p>
<p>The emission of this signal triggers the synchronous emission of the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5426b68b2b1bb6ad8dc0007914412b4f">frame()</a> <a class="el" href="classqglviewer_1_1Frame.html#ab55c2a4f1732b90057fae4b6037399de">Frame::interpolated()</a> signal, which may also be useful.</p>
<p>This signal should especially be connected to your <a class="el" href="classQGLViewer.html#ae12b7378efbffabc24a133ca1deb19ae">QGLViewer::updateGL()</a> slot, so that the display is updated after every update of the KeyFrameInterpolator <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5426b68b2b1bb6ad8dc0007914412b4f">frame()</a>: </p>
<div class="fragment"><pre class="fragment">    connect(myKeyFrameInterpolator, SIGNAL(<a class="code" href="classqglviewer_1_1KeyFrameInterpolator.html#ab55c2a4f1732b90057fae4b6037399de">interpolated</a>()), SLOT(updateGL()));
</pre></div><p> Use the <a class="el" href="classQGLViewer.html#a32d7a506084c50fd97a24f94d9ca4864">QGLViewer::QGLViewerPool()</a> to connect the signal to all the viewers.</p>
<p>Note that the <a class="el" href="classQGLViewer.html#a27a9e97573822d296b48e1c408b74042">QGLViewer::camera()</a> <a class="el" href="classqglviewer_1_1Camera.html#abfbef567a6bbb9163b31c6f46238e4de">Camera::keyFrameInterpolator()</a> created using <a class="el" href="classQGLViewer.html#adfe21e109b45f8c79f2c360bf35fb835">QGLViewer::pathKey()</a> have their <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#ab55c2a4f1732b90057fae4b6037399de">interpolated()</a> signals automatically connected to the <a class="el" href="classQGLViewer.html#ae12b7378efbffabc24a133ca1deb19ae">QGLViewer::updateGL()</a> slot. </p>

</div>
</div>
<a class="anchor" id="a8cc0fa56ba7b6da71226cc191cc18e70"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::interpolationIsStarted" ref="a8cc0fa56ba7b6da71226cc191cc18e70" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool interpolationIsStarted </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns <code>true</code> when the interpolation is being performed. Use <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a3c0098b2307d04e904c1f64f505e5819">startInterpolation()</a>, <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a16f0910299ae07cede3396a14ec01f4b">stopInterpolation()</a> or <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#acf744bd8ce09e5433f829f63ba310eef">toggleInterpolation()</a> to modify this state. </p>

</div>
</div>
<a class="anchor" id="a21bf6165ea3a6be2fd854e9be5105b1e"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::interpolationPeriod" ref="a21bf6165ea3a6be2fd854e9be5105b1e" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int interpolationPeriod </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the current interpolation period, expressed in milliseconds.</p>
<p>The update of the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5426b68b2b1bb6ad8dc0007914412b4f">frame()</a> state will be done by a timer at this period when <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a8cc0fa56ba7b6da71226cc191cc18e70">interpolationIsStarted()</a>.</p>
<p>This period (multiplied by <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a7e468c84c27d896e341563c83e102aad">interpolationSpeed()</a>) is added to the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a58326b7948e78c1d2861ca659492207a">interpolationTime()</a> at each update, and the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5426b68b2b1bb6ad8dc0007914412b4f">frame()</a> state is modified accordingly (see <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#ad5393783e1768b6d688a8c49ddea56ae">interpolateAtTime()</a>). Default value is 40 milliseconds. </p>

</div>
</div>
<a class="anchor" id="a7e468c84c27d896e341563c83e102aad"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::interpolationSpeed" ref="a7e468c84c27d896e341563c83e102aad" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float interpolationSpeed </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the current interpolation speed.</p>
<p>Default value is 1.0, which means <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a976ec792d48ccd7e53b55bb91b49d473">keyFrameTime()</a> will be matched during the interpolation (provided that your main loop is fast enough).</p>
<p>A negative value will result in a reverse interpolation of the keyFrames. See also <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a21bf6165ea3a6be2fd854e9be5105b1e">interpolationPeriod()</a>. </p>

</div>
</div>
<a class="anchor" id="a58326b7948e78c1d2861ca659492207a"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::interpolationTime" ref="a58326b7948e78c1d2861ca659492207a" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float interpolationTime </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the current interpolation time (in seconds) along the KeyFrameInterpolator path.</p>
<p>This time is regularly updated when <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a8cc0fa56ba7b6da71226cc191cc18e70">interpolationIsStarted()</a>. Can be set directly with <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#ab860af88ea46ecedb2a648157bb68dc3">setInterpolationTime()</a> or <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#ad5393783e1768b6d688a8c49ddea56ae">interpolateAtTime()</a>. </p>

</div>
</div>
<a class="anchor" id="a2437eecf340817ad1a3f86c822b111e8"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::keyFrame" ref="a2437eecf340817ad1a3f86c822b111e8" args="(int index) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classqglviewer_1_1Frame.html">Frame</a> keyFrame </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>index</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the <a class="el" href="classqglviewer_1_1Frame.html" title="The Frame class represents a coordinate system, defined by a position and an orientation...">Frame</a> associated with the keyFrame at index <code>index</code>.</p>
<p>See also <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a976ec792d48ccd7e53b55bb91b49d473">keyFrameTime()</a>. <code>index</code> has to be in the range 0..<a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#aba3744250d9cd01ec848f81151a62273">numberOfKeyFrames()</a>-1.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>If this keyFrame was defined using a pointer to a <a class="el" href="classqglviewer_1_1Frame.html" title="The Frame class represents a coordinate system, defined by a position and an orientation...">Frame</a> (see addKeyFrame(const Frame* const)), the <em>current</em> pointed <a class="el" href="classqglviewer_1_1Frame.html" title="The Frame class represents a coordinate system, defined by a position and an orientation...">Frame</a> state is returned. </dd></dl>

</div>
</div>
<a class="anchor" id="a976ec792d48ccd7e53b55bb91b49d473"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::keyFrameTime" ref="a976ec792d48ccd7e53b55bb91b49d473" args="(int index) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float keyFrameTime </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>index</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the time corresponding to the <code>index</code> keyFrame.</p>
<p>See also <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a2437eecf340817ad1a3f86c822b111e8">keyFrame()</a>. <code>index</code> has to be in the range 0..<a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#aba3744250d9cd01ec848f81151a62273">numberOfKeyFrames()</a>-1. </p>

</div>
</div>
<a class="anchor" id="a3e953e6c813baa461389c132c9509e30"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::lastTime" ref="a3e953e6c813baa461389c132c9509e30" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float lastTime </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the time corresponding to the last keyFrame, expressed in seconds.</p>
<p>Returns 0.0 if the path is empty. See also <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5335f8bedcb11c4e9cc06cbbab838477">firstTime()</a>, <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a80c858ec25677a47d066e0900f4e1980">duration()</a> and <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a976ec792d48ccd7e53b55bb91b49d473">keyFrameTime()</a>. </p>

</div>
</div>
<a class="anchor" id="a906c17cf6c1d51a54c7d3b9b4c9cbd45"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::loopInterpolation" ref="a906c17cf6c1d51a54c7d3b9b4c9cbd45" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool loopInterpolation </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns <code>true</code> when the interpolation is played in an infinite loop.</p>
<p>When <code>false</code> (default), the interpolation stops when <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a58326b7948e78c1d2861ca659492207a">interpolationTime()</a> reaches <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5335f8bedcb11c4e9cc06cbbab838477">firstTime()</a> (with negative <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a7e468c84c27d896e341563c83e102aad">interpolationSpeed()</a>) or <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a3e953e6c813baa461389c132c9509e30">lastTime()</a>.</p>
<p><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a58326b7948e78c1d2861ca659492207a">interpolationTime()</a> is otherwise reset to <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5335f8bedcb11c4e9cc06cbbab838477">firstTime()</a> (+ <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a58326b7948e78c1d2861ca659492207a">interpolationTime()</a> - <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a3e953e6c813baa461389c132c9509e30">lastTime()</a>) (and inversely for negative <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a7e468c84c27d896e341563c83e102aad">interpolationSpeed()</a>) and interpolation continues.</p>
<p>In both cases, the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#ab4010a17bf77b9940b120ee8ed9a0271">endReached()</a> signal is emitted. </p>

</div>
</div>
<a class="anchor" id="aba3744250d9cd01ec848f81151a62273"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::numberOfKeyFrames" ref="aba3744250d9cd01ec848f81151a62273" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int numberOfKeyFrames </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the number of keyFrames used by the interpolation. Use <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a44ac54529e675a2157067c9d205d9622">addKeyFrame()</a> to add new keyFrames. </p>

</div>
</div>
<a class="anchor" id="a0bfc602dc2fcaca40cc49195bba7ba74"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::resetInterpolation" ref="a0bfc602dc2fcaca40cc49195bba7ba74" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void resetInterpolation </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [slot]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Stops the interpolation and resets <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a58326b7948e78c1d2861ca659492207a">interpolationTime()</a> to the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5335f8bedcb11c4e9cc06cbbab838477">firstTime()</a>.</p>
<p>If desired, call <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#ad5393783e1768b6d688a8c49ddea56ae">interpolateAtTime()</a> after this method to actually move the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5426b68b2b1bb6ad8dc0007914412b4f">frame()</a> to <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5335f8bedcb11c4e9cc06cbbab838477">firstTime()</a>. </p>

</div>
</div>
<a class="anchor" id="a1e16bb31ee6240a9f0e3a6824f4bef0d"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::setFrame" ref="a1e16bb31ee6240a9f0e3a6824f4bef0d" args="(Frame *const frame)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void setFrame </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classqglviewer_1_1Frame.html">Frame</a> *const &nbsp;</td>
          <td class="paramname"> <em>frame</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [slot]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Sets the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5426b68b2b1bb6ad8dc0007914412b4f">frame()</a> associated to the KeyFrameInterpolator. </p>

</div>
</div>
<a class="anchor" id="a9763e647346a8bee885517d9985173fd"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::setInterpolationPeriod" ref="a9763e647346a8bee885517d9985173fd" args="(int period)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void setInterpolationPeriod </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>period</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [slot]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Sets the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a21bf6165ea3a6be2fd854e9be5105b1e">interpolationPeriod()</a>. </p>

</div>
</div>
<a class="anchor" id="a3cc64e95e1b8dfda110bcf3d033ecf2d"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::setInterpolationSpeed" ref="a3cc64e95e1b8dfda110bcf3d033ecf2d" args="(float speed)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void setInterpolationSpeed </td>
          <td>(</td>
          <td class="paramtype">float&nbsp;</td>
          <td class="paramname"> <em>speed</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [slot]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Sets the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a7e468c84c27d896e341563c83e102aad">interpolationSpeed()</a>. Negative or null values are allowed. </p>

</div>
</div>
<a class="anchor" id="ab860af88ea46ecedb2a648157bb68dc3"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::setInterpolationTime" ref="ab860af88ea46ecedb2a648157bb68dc3" args="(float time)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void setInterpolationTime </td>
          <td>(</td>
          <td class="paramtype">float&nbsp;</td>
          <td class="paramname"> <em>time</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [slot]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Sets the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a58326b7948e78c1d2861ca659492207a">interpolationTime()</a>.</p>
<dl class="attention"><dt><b>Attention:</b></dt><dd>The <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5426b68b2b1bb6ad8dc0007914412b4f">frame()</a> state is not affected by this method. Use this function to define the starting time of a future interpolation (see <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a3c0098b2307d04e904c1f64f505e5819">startInterpolation()</a>). Use <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#ad5393783e1768b6d688a8c49ddea56ae">interpolateAtTime()</a> to actually interpolate at a given time. </dd></dl>

</div>
</div>
<a class="anchor" id="a31a491ac2ac016298cbd1c66f07be6dd"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::setLoopInterpolation" ref="a31a491ac2ac016298cbd1c66f07be6dd" args="(bool loop=true)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void setLoopInterpolation </td>
          <td>(</td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>loop</em> = <code>true</code></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [slot]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Sets the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a906c17cf6c1d51a54c7d3b9b4c9cbd45">loopInterpolation()</a> value. </p>

</div>
</div>
<a class="anchor" id="a3c0098b2307d04e904c1f64f505e5819"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::startInterpolation" ref="a3c0098b2307d04e904c1f64f505e5819" args="(int period=&#45;1)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void startInterpolation </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>period</em> = <code>-1</code></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [slot]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Starts the interpolation process.</p>
<p>A timer is started with an <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a21bf6165ea3a6be2fd854e9be5105b1e">interpolationPeriod()</a> period that updates the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5426b68b2b1bb6ad8dc0007914412b4f">frame()</a>'s position and orientation. <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a8cc0fa56ba7b6da71226cc191cc18e70">interpolationIsStarted()</a> will return <code>true</code> until <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a16f0910299ae07cede3396a14ec01f4b">stopInterpolation()</a> or <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#acf744bd8ce09e5433f829f63ba310eef">toggleInterpolation()</a> is called.</p>
<p>If <code>period</code> is positive, it is set as the new <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a21bf6165ea3a6be2fd854e9be5105b1e">interpolationPeriod()</a>. The previous <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a21bf6165ea3a6be2fd854e9be5105b1e">interpolationPeriod()</a> is used otherwise (default).</p>
<p>If <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a58326b7948e78c1d2861ca659492207a">interpolationTime()</a> is larger than <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a3e953e6c813baa461389c132c9509e30">lastTime()</a>, <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a58326b7948e78c1d2861ca659492207a">interpolationTime()</a> is reset to <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a5335f8bedcb11c4e9cc06cbbab838477">firstTime()</a> before interpolation starts (and inversely for negative <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a7e468c84c27d896e341563c83e102aad">interpolationSpeed()</a>).</p>
<p>Use <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#ab860af88ea46ecedb2a648157bb68dc3">setInterpolationTime()</a> before calling this method to change the starting <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a58326b7948e78c1d2861ca659492207a">interpolationTime()</a>.</p>
<p>See the <a href="../examples/keyFrames.html">keyFrames example</a> for an illustration.</p>
<p>You may also be interested in <a class="el" href="classQGLViewer.html#a64465ac69c7fe9f4f8519a57501c76c2">QGLViewer::animate()</a> and <a class="el" href="classQGLViewer.html#ad5344a5f702678f309fafa0c699b2cf3">QGLViewer::startAnimation()</a>.</p>
<dl class="attention"><dt><b>Attention:</b></dt><dd>The keyFrames must be defined (see <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a44ac54529e675a2157067c9d205d9622">addKeyFrame()</a>) <em>before</em> you <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a3c0098b2307d04e904c1f64f505e5819">startInterpolation()</a>, or else the interpolation will naturally immediately stop. </dd></dl>

</div>
</div>
<a class="anchor" id="a16f0910299ae07cede3396a14ec01f4b"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::stopInterpolation" ref="a16f0910299ae07cede3396a14ec01f4b" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void stopInterpolation </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [slot]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Stops an interpolation started with <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a3c0098b2307d04e904c1f64f505e5819">startInterpolation()</a>. See <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a8cc0fa56ba7b6da71226cc191cc18e70">interpolationIsStarted()</a> and <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#acf744bd8ce09e5433f829f63ba310eef">toggleInterpolation()</a>. </p>

</div>
</div>
<a class="anchor" id="acf744bd8ce09e5433f829f63ba310eef"></a><!-- doxytag: member="qglviewer::KeyFrameInterpolator::toggleInterpolation" ref="acf744bd8ce09e5433f829f63ba310eef" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void toggleInterpolation </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [slot]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Calls <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a3c0098b2307d04e904c1f64f505e5819">startInterpolation()</a> or <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a16f0910299ae07cede3396a14ec01f4b">stopInterpolation()</a>, depending on <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a8cc0fa56ba7b6da71226cc191cc18e70">interpolationIsStarted()</a>. </p>

</div>
</div>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&nbsp;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&nbsp;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&nbsp;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&nbsp;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&nbsp;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&nbsp;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&nbsp;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&nbsp;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&nbsp;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&nbsp;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr size="1"/><address style="text-align: right;"><small>libQGLViewer 2.3.6 documentation generated by
<a href="http://www.doxygen.org/index.html">
doxygen</a> 1.6.2 </small></address>
</body>
</html>