<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>libQGLViewer: KeyFrameInterpolator class Reference</title> <link href="qglviewer.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.3.3 --> <div class="qindex"><a class="qindex" href="../index.html">Main Page</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="annotated.html">Compound List</a> | <a class="qindex" href="functions.html">All functions</a> | <a class="qindex" doxygen="_cgi:http://www-imagis.imag.fr/cgi-bin/DOXYGEN/search.cgi" href="http://www-imagis.imag.fr/cgi-bin/DOXYGEN/search.cgi">Search</a></div> <h1>KeyFrameInterpolator Class Reference</h1>A key frame interpolator. <a href="#_details">More...</a> <p> <a href="classqglviewer_1_1KeyFrameInterpolator-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0> <tr><td></td></tr> <tr><td colspan=2><br><h2>Key Frames</h2></td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_0">setFrame</a> (<a class="el" href="classqglviewer_1_1Frame.html">Frame</a> *fr)</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="classqglviewer_1_1Frame.html">Frame</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_1">frame</a> () const</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_2">addKeyFrame</a> (const <a class="el" href="classqglviewer_1_1Frame.html">Frame</a> &fr)</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_3">addKeyFrame</a> (const <a class="el" href="classqglviewer_1_1Frame.html">Frame</a> &fr, const float time)</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_4">addKeyFrame</a> (const <a class="el" href="classqglviewer_1_1Frame.html">Frame</a> *fr)</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_5">addKeyFrame</a> (const <a class="el" href="classqglviewer_1_1Frame.html">Frame</a> *fr, const float time)</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_6">deletePath</a> ()</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_7">numberOfKeyFrames</a> () const</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="classqglviewer_1_1Frame.html">Frame</a> </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_8">keyFrame</a> (const int i) const</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="classqglviewer_1_1Vec.html">Vec</a> </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_9">keyFramePosition</a> (const int i) const</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="classqglviewer_1_1Quaternion.html">Quaternion</a> </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_10">keyFrameOrientation</a> (const int i) const</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>float </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_11">keyFrameTime</a> (const int i) const</td></tr> <tr><td colspan=2><br><h2>Interpolation parameters</h2></td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>float </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_0">interpolationTime</a> () const</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_1">setInterpolationTime</a> (const float time)</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>float </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_2">interpolationSpeed</a> () const</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_3">setInterpolationSpeed</a> (const float speed)</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_4">interpolationPeriod</a> () const</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_5">setInterpolationPeriod</a> (const int msecs)</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_6">loopInterpolation</a> () const</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_7">setLoopInterpolation</a> (const bool loop=true)</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_8">closedPath</a> () const</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_9">setClosedPath</a> (const bool closed=true)</td></tr> <tr><td colspan=2><br><h2>Interpolation</h2></td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_0">interpolateAtTime</a> (const float time)</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_1">startInterpolation</a> (const int msecs=-1)</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_2">stopInterpolation</a> ()</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_3">resetInterpolation</a> ()</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_4">interpolationIsStarted</a> () const</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_5">toggleInterpolation</a> ()</td></tr> <tr><td colspan=2><br><h2>Path drawing</h2></td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z57_0">drawPath</a> (const int mask=1, int nbFrames=6, const float scale=1.0f)</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z57_1">drawPathModifyGLState</a> (const int mask, int nbFrames, const float scale)</td></tr> <tr><td colspan=2><br><h2>XML representation</h2></td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>virtual QDomElement </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z59_0">domElement</a> (const QString &name, QDomDocument &doc) const</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z59_1">initFromDOMElement</a> (const QDomElement &de)</td></tr> <tr><td colspan=2><br><h2>Public Slots</h2></td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#i0">update</a> ()</td></tr> <tr><td colspan=2><br><h2>Signals</h2></td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#l0">interpolated</a> ()</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#l1">finished</a> ()</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="classqglviewer_1_1KeyFrameInterpolator.html#a0">KeyFrameInterpolator</a> (<a class="el" href="classqglviewer_1_1Frame.html">Frame</a> *fr=NULL)</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>virtual </td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a1">~KeyFrameInterpolator</a> ()</td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> A key frame interpolator. <p> <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html">KeyFrameInterpolator</a> implements a classical interpolation of key Frames, using a smooth Catmull-Rom interpolation. See the <a href="../examples/keyFrames.html">keyFrames</a> example for an illustration of the class.<p> Use <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_2">addKeyFrame()</a> to define the keyframes and then call <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_1">startInterpolation()</a>. The <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_1">frame()</a> associated with the interpolator (using the constructor or with <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_0">setFrame()</a>) will then be updated over time. <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_1">frame()</a> should be a pointer to one of the <a class="el" href="classqglviewer_1_1Frame.html">Frame</a> of your application, the one that you want the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html">KeyFrameInterpolator</a> to drive: <div class="fragment"><pre> <span class="comment">// The KeyFrameInterpolator must be given the Frame that it will drive over time. </span> <a class="code" href="classqglviewer_1_1KeyFrameInterpolator.html#a0">KeyFrameInterpolator</a> kfi( <span class="keyword">new</span> Frame() ); init() { kfi.addKeyFrame( Frame( Vec(1,0,2), Quaternion() ) ); kfi.addKeyFrame( <span class="keyword">new</span> Frame( Vec(2,1,0), Quaternion() ) ); <span class="comment">// ...and so on for all the Key Frames.</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#l0">interpolated</a>()), SLOT(updateGL())); kfi.startInterpolation(); } draw() { kfi.drawPath(); glPushMatrix(); <span class="comment">// Recover kfi associated frame with kfi.frame(), and use its matrix </span> glMultMatrixd( kfi.frame()->matrix() ); <span class="comment">// Draw your object here. Its position and orientation will be interpolated.</span> glPopMatrix(); } </pre></div><p> The interpolation can loop (<a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_7">setLoopInterpolation()</a>) and the keyFrame path can be closed (<a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_9">setClosedPath()</a>) (not yet implemented). The current interpolation time (<a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_0">interpolationTime()</a>) and speed (<a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_2">interpolationSpeed()</a>) can also be tuned.<p> The keyFrames are defined by a <a class="el" href="classqglviewer_1_1Frame.html">Frame</a> and a time, expressed in seconds. If the keyFrame is defined using a <em>pointer</em> to a <a class="el" href="classqglviewer_1_1Frame.html">Frame</a>, the keyFrame path will automatically be updated if the <a class="el" href="classqglviewer_1_1Frame.html">Frame</a> is modified (see the <a class="el" href="classqglviewer_1_1Frame.html#l0">Frame::modified()</a> signal).<p> The time has to be monotonously increasing over keyFrames. When <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_2">interpolationSpeed()</a> equals 1.0, these times correspond to actual user' seconds during the interpolation (provided that your <a class="el" href="classQGLViewer.html#b6">QGLViewer::draw()</a> function is fast enough).<p> Note that a <a class="el" href="classqglviewer_1_1Camera.html">Camera</a> has 12 attached <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html">KeyFrameInterpolator</a> binded to the F1-F12 keys. Press Alt+F<em>x</em> to define a new keyFrame for path <em>x</em>. Pressing F<em>x</em> plays/pause path interpolation. See the <a href="../shortcuts.html">shortcuts page</a> for details.<p> When interpolated, the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html">KeyFrameInterpolator</a> emits an <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#l0">interpolated()</a> signal, which should be connected to the viewer's updateGL() slot. See the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#l0">interpolated()</a> documentation for details. <p> <hr><h2>Constructor & Destructor Documentation</h2> <a name="a0" doxytag="qglviewer::KeyFrameInterpolator::KeyFrameInterpolator"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html">KeyFrameInterpolator</a> </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="classqglviewer_1_1Frame.html">Frame</a> * </td> <td class="mdname1" valign="top" nowrap> <em>fr</em> = NULL </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> Creates a <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html">KeyFrameInterpolator</a>, which will drive the <code>fr</code> frame. See <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_0">setFrame()</a> for details on the associated frame <code>fr</code>.<p> Use <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_2">addKeyFrame()</a> to define the key frames. Default <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_0">interpolationTime()</a> is 0.0, and <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_2">interpolationSpeed()</a> is 1.0.<p> See the <a href="../examples/keyFrames.html">keyFrames</a> example for an illustration. </td> </tr> </table> <a name="a1" doxytag="qglviewer::KeyFrameInterpolator::~KeyFrameInterpolator"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> ~<a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html">KeyFrameInterpolator</a> </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Virtual destructor. Releases allocated memory. </td> </tr> </table> <hr><h2>Member Function Documentation</h2> <a name="z51_5" doxytag="qglviewer::KeyFrameInterpolator::addKeyFrame"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void addKeyFrame </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classqglviewer_1_1Frame.html">Frame</a> * </td> <td class="mdname" nowrap> <em>fr</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const float </td> <td class="mdname" nowrap> <em>time</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Same as the reference version of <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_2">addKeyFrame()</a>, but with a pointer to a frame. <code>NULL</code> pointers are silently ignored. </td> </tr> </table> <a name="z51_4" doxytag="qglviewer::KeyFrameInterpolator::addKeyFrame"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void addKeyFrame </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classqglviewer_1_1Frame.html">Frame</a> * </td> <td class="mdname1" valign="top" nowrap> <em>fr</em> </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> Same as the reference version of <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_2">addKeyFrame()</a>, but with a pointer to a frame. <code>NULL</code> pointers are silently ignored.<p> See the <a href="../examples/keyFrames.html">keyFrames</a> example for an illustration. </td> </tr> </table> <a name="z51_3" doxytag="qglviewer::KeyFrameInterpolator::addKeyFrame"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void addKeyFrame </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classqglviewer_1_1Frame.html">Frame</a> & </td> <td class="mdname" nowrap> <em>fr</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const float </td> <td class="mdname" nowrap> <em>time</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Defines a new keyFrame, and the associated time (in seconds) that will be used to rhythm the interpolation. The <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_11">keyFrameTime()</a> have to be monotonously increasing over keyFrames. </td> </tr> </table> <a name="z51_2" doxytag="qglviewer::KeyFrameInterpolator::addKeyFrame"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void addKeyFrame </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classqglviewer_1_1Frame.html">Frame</a> & </td> <td class="mdname1" valign="top" nowrap> <em>fr</em> </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> Defines a new keyFrame. Same as <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_2">addKeyFrame()</a> with a <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_11">keyFrameTime()</a> specification, except that the time is automatically set as previous <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_11">keyFrameTime()</a> + 1 second.<p> See the <a href="../examples/keyFrames.html">keyFrames</a> example for an illustration. </td> </tr> </table> <a name="z53_8" doxytag="qglviewer::KeyFrameInterpolator::closedPath"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> bool closedPath </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> const<code> [inline]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Whether or not (default) the path defined by the keyFrames is a closed loop. When <code>true</code>, the last and the first KeyFrame are linked by a new spline segment. <p> <dl compact><dt><b><a class="el" href=".html#">:</a></b></dt><dd></dd></dl> Use <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_7">setLoopInterpolation()</a> to create a continuous animation over the entire path. <dl compact><dt><b>Attention:</b></dt><dd>The closed path feature is not yet implemented. </dd></dl> </td> </tr> </table> <a name="z51_6" doxytag="qglviewer::KeyFrameInterpolator::deletePath"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void deletePath </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> Remove all keyFrames from the path. The <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_7">numberOfKeyFrames()</a> is set to 0. </td> </tr> </table> <a name="z59_0" doxytag="qglviewer::KeyFrameInterpolator::domElement"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> QDomElement domElement </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const QString & </td> <td class="mdname" nowrap> <em>name</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>QDomDocument & </td> <td class="mdname" nowrap> <em>doc</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"> const<code> [virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Creates an XML QDomElement that represents the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html">KeyFrameInterpolator</a>. <code>name</code> is the name of the QDomElement tag. You need to provide the QDomDocument <code>doc</code> that will hold the resulting element.<p> Use <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z59_1">initFromDOMElement()</a> to restore the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html">KeyFrameInterpolator</a> state from the resulting domElement.<p> See also <a class="el" href="classqglviewer_1_1Camera.html#z23_0">Camera::domElement()</a>, <a class="el" href="classqglviewer_1_1Frame.html#z49_0">Frame::domElement()</a>...<p> If you want to save the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html">KeyFrameInterpolator</a> <code>kfi</code> in a file, use <div class="fragment"><pre> QDomDocument doc( <span class="stringliteral">"myKFI"</span> ); doc.appendChild( kfi.domElement(<span class="stringliteral">"KFI"</span>, doc) ); ofstream file( <span class="stringliteral">"myKFI.xml"</span> ); file << doc.toString(); </pre></div>Note that the <a class="el" href="classqglviewer_1_1Camera.html#z11_1">Camera::keyFrameInterpolator()</a> are automatically saved by <a class="el" href="classQGLViewer.html#z109_0">QGLViewer::saveToFile()</a> when a <a class="el" href="classQGLViewer.html">QGLViewer</a> is closed (default shortcut key is Escape).<p> Use the following code to retrieve the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html">KeyFrameInterpolator</a> <code>kfi</code> from the saved file: <div class="fragment"><pre> <span class="comment">// Load DOM from file</span> QDomDocument doc; QFile f(<span class="stringliteral">"myKFI.xml"</span>); f.open(IO_ReadOnly); doc.setContent(&f); f.close(); <span class="comment">// Parse the DOM tree</span> QDomElement main=doc.documentElement(); kfi.initFromDOMElement(main); </pre></div><p> <dl compact><dt><b>Attention:</b></dt><dd>For KeyFrames defined by pointers, only the <em>values</em> of the pointed <a class="el" href="classqglviewer_1_1Frame.html">Frame</a> are saved. See <a class="el" href="classqglviewer_1_1Frame.html#z49_0">Frame::domElement()</a>. <p> Only the KeyFrames are saved, you still need to define the attached <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_1">frame()</a> with <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_0">setFrame()</a>. </dd></dl> </td> </tr> </table> <a name="z57_0" doxytag="qglviewer::KeyFrameInterpolator::drawPath"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void drawPath </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const int </td> <td class="mdname" nowrap> <em>mask</em> = 1, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>nbFrames</em> = 6, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const float </td> <td class="mdname" nowrap> <em>scale</em> = 1.0f</td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Draws the path that will be used to interpolate the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_1">frame()</a>.<p> <code>mask</code> controls what is drawn on the path : if (mask & 1) (default), the position path is drawn. If (mask & 2), a camera representation is regularly drawn and if (mask & 4), an oriented axis is regularly drawn.<p> <div class="fragment"><pre> <a class="code" href="classqglviewer_1_1KeyFrameInterpolator.html#z57_0">drawPath</a>(); <span class="comment">// Simply draws the interpolation path</span> <a class="code" href="classqglviewer_1_1KeyFrameInterpolator.html#z57_0">drawPath</a>(3); <span class="comment">// Draws path and cameras</span> <a class="code" href="classqglviewer_1_1KeyFrameInterpolator.html#z57_0">drawPath</a>(7); <span class="comment">// Draws path, cameras and axis</span> <a class="code" href="classqglviewer_1_1KeyFrameInterpolator.html#z57_0">drawPath</a>(5); <span class="comment">// Draws path and axis</span> </pre></div><p> When 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 Key Frames 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 Key <a class="el" href="classqglviewer_1_1Frame.html">Frame</a>. Default value is 6.<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#z87_1">QGLViewer::sceneRadius()</a> should give good results.<p> The color of the path is the one of the current <code>glColor()</code>.<p> See the <a href="../examples/keyFrames.html">keyFrames</a> example for an illustration.<p> This function actually call <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z57_1">drawPathModifyGLState()</a>, but saves and restores the GL state before and after. </td> </tr> </table> <a name="z57_1" doxytag="qglviewer::KeyFrameInterpolator::drawPathModifyGLState"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void drawPathModifyGLState </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const int </td> <td class="mdname" nowrap> <em>mask</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>nbFrames</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const float </td> <td class="mdname" nowrap> <em>scale</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Same as <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z57_0">drawPath()</a>, but the GL state is modified : GL_LIGHTING is disabled and line width set to 2. This function should only be used for efficiency reasons (as is done by <a class="el" href="classQGLViewer.html#b8">QGLViewer::postDraw()</a>). Prefer calling <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z57_0">drawPath()</a>, which preserves the GL state, for debugging purpose. </td> </tr> </table> <a name="l1" doxytag="qglviewer::KeyFrameInterpolator::finished"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void finished </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [signal]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> This signal is emitted when the interpolation reaches the last <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_11">keyFrameTime()</a>. Use <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_1">startInterpolation()</a> to start the interpolation and you will be warned with this signal when the interpolation is finished.<p> <dl compact><dt><b>Note:</b></dt><dd>A call to <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_2">stopInterpolation()</a> will not emit this signal. If <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_6">loopInterpolation()</a> is activated, the signal is emitted each time the interpolation loops back to first keyFrame.<p> If the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_2">interpolationSpeed()</a> is negative, <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#l1">finished()</a> is emitted when <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_0">interpolationTime()</a> reaches the first <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_11">keyFrameTime()</a>. </dd></dl> </td> </tr> </table> <a name="z51_1" doxytag="qglviewer::KeyFrameInterpolator::frame"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="classqglviewer_1_1Frame.html">Frame</a>* frame </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> const<code> [inline]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> The frame that is associated and modified by the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html">KeyFrameInterpolator</a>. Set using <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_0">setFrame()</a> or with the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#a0">KeyFrameInterpolator()</a> constructor. </td> </tr> </table> <a name="z59_1" doxytag="qglviewer::KeyFrameInterpolator::initFromDOMElement"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void initFromDOMElement </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const QDomElement & </td> <td class="mdname1" valign="top" nowrap> <em>de</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Restore the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html">KeyFrameInterpolator</a> state from a QDomElement created by <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z59_0">domElement()</a>. See also <a class="el" href="classqglviewer_1_1Camera.html#z23_1">Camera::initFromDOMElement()</a>, <a class="el" href="classqglviewer_1_1Frame.html#z49_1">Frame::initFromDOMElement()</a>.<p> <dl compact><dt><b>Attention:</b></dt><dd>For KeyFrames defined by pointers, only the <em>values</em> of the pointed <a class="el" href="classqglviewer_1_1Frame.html">Frame</a> are saved. <p> Only the KeyFrames are saved, you still need to define the attached <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_1">frame()</a> with <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_0">setFrame()</a>. </dd></dl> </td> </tr> </table> <a name="z55_0" doxytag="qglviewer::KeyFrameInterpolator::interpolateAtTime"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void interpolateAtTime </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const float </td> <td class="mdname1" valign="top" nowrap> <em>time</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Interpolate <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_1">frame()</a> for time <code>time</code>. <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_0">interpolationTime()</a> is set to <code>time</code> and <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_1">frame()</a> is set accordingly.<p> If you simply want to change <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_0">interpolationTime()</a> but not the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_1">frame()</a>, use <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_1">setInterpolationTime()</a> instead.<p> Emits the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#l0">interpolated()</a> signal. </td> </tr> </table> <a name="l0" doxytag="qglviewer::KeyFrameInterpolator::interpolated"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void interpolated </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [signal]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> This signal is emitted whenever the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_1">frame()</a> state is interpolated. Connect this signal to any object that should be notified.<p> This signal should especially be connected to your viewer updateGL() slot, so that the display is updated after every update of the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html">KeyFrameInterpolator</a> <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_1">frame()</a>. Use code like this : <div class="fragment"><pre> connect(myKeyFrameInterpolator, SIGNAL(<a class="code" href="classqglviewer_1_1KeyFrameInterpolator.html#l0">interpolated</a>()), SLOT(updateGL())); </pre></div><p> Note that every <a class="el" href="classQGLViewer.html#z89_0">QGLViewer::camera()</a> holds several <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html">KeyFrameInterpolator</a> and that their <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#l0">interpolated()</a> signals are automatically connected to the viewer's updateGL() slot.<p> When several viewers display the same scene, it may be interesting to update <em>all</em> the viewers when a <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html">KeyFrameInterpolator</a> (and probably hence an object) is interpolated. Simply use this code to achieve this behavior: <div class="fragment"><pre> <a class="code" href="classQGLViewer.html#z111_2">QGLViewer::connectSignalToAllViewers</a>(myKeyFrameInterpolator, SIGNAL(<a class="code" href="classqglviewer_1_1KeyFrameInterpolator.html#l0">interpolated</a>())); </pre></div><p> See also the <a class="el" href="classqglviewer_1_1ManipulatedFrame.html#l0">ManipulatedFrame::manipulated()</a> and spinningFrame::spinned() signals documentations. </td> </tr> </table> <a name="z55_4" doxytag="qglviewer::KeyFrameInterpolator::interpolationIsStarted"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> bool interpolationIsStarted </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> const<code> [inline]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Returns <code>true</code> when the interpolation is being processed (after a call to <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_1">startInterpolation()</a>). Set to <code>false</code> by <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_2">stopInterpolation()</a>. See also <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_5">toggleInterpolation()</a>. </td> </tr> </table> <a name="z53_4" doxytag="qglviewer::KeyFrameInterpolator::interpolationPeriod"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int interpolationPeriod </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> const<code> [inline]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Returns the current interpolation period, expressed in milliseconds. This period will be added to the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_0">interpolationTime()</a> at each <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#i0">update()</a>, when <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_4">interpolationIsStarted()</a> is <code>true</code>. </td> </tr> </table> <a name="z53_2" doxytag="qglviewer::KeyFrameInterpolator::interpolationSpeed"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> float interpolationSpeed </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> const<code> [inline]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Returns the current interpolation speed. Default value is 1.0, which means that the times associated with the keyFrames (see <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_11">keyFrameTime()</a> and <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_2">addKeyFrame()</a>), expressed in seconds, will be respected during the interpolation (see <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_1">startInterpolation()</a>), provided that your display is fast enough.<p> A negative value will result in a reverse interpolation of the keyFrames. </td> </tr> </table> <a name="z53_0" doxytag="qglviewer::KeyFrameInterpolator::interpolationTime"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> float interpolationTime </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> const<code> [inline]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Current interpolation time, updated when <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_4">interpolationIsStarted()</a> is true. Can be set directly with <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_1">setInterpolationTime()</a> or <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_0">interpolateAtTime()</a>. </td> </tr> </table> <a name="z51_8" doxytag="qglviewer::KeyFrameInterpolator::keyFrame"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="classqglviewer_1_1Frame.html">Frame</a> keyFrame </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const int </td> <td class="mdname1" valign="top" nowrap> <em>i</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> const</td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> </td> </tr> </table> <a name="z51_10" doxytag="qglviewer::KeyFrameInterpolator::keyFrameOrientation"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="classqglviewer_1_1Quaternion.html">Quaternion</a> keyFrameOrientation </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const int </td> <td class="mdname1" valign="top" nowrap> <em>i</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> const</td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Returns the keyFrame orientation of keyFrame number <code>i</code>. No index verification is performed. See also <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_9">keyFramePosition()</a>, <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_11">keyFrameTime()</a> and <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_7">numberOfKeyFrames()</a>. </td> </tr> </table> <a name="z51_9" doxytag="qglviewer::KeyFrameInterpolator::keyFramePosition"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="classqglviewer_1_1Vec.html">Vec</a> keyFramePosition </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const int </td> <td class="mdname1" valign="top" nowrap> <em>i</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> const</td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Returns the keyFrame position of keyFrame number <code>i</code>. No index verification is performed. See also <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_10">keyFrameOrientation()</a>, <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_11">keyFrameTime()</a> and <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_7">numberOfKeyFrames()</a>. </td> </tr> </table> <a name="z51_11" doxytag="qglviewer::KeyFrameInterpolator::keyFrameTime"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> float keyFrameTime </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const int </td> <td class="mdname1" valign="top" nowrap> <em>i</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> const</td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Returns the time associated with the keyframe number <code>i</code>. See also <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_9">keyFramePosition()</a>, <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_10">keyFrameOrientation()</a> and <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_2">addKeyFrame()</a>. </td> </tr> </table> <a name="z53_6" doxytag="qglviewer::KeyFrameInterpolator::loopInterpolation"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> bool loopInterpolation </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> const<code> [inline]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Whether or not (default) the interpolation will be played in (infinite) loop when <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_1">startInterpolation()</a> is called (until <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_2">stopInterpolation()</a> is called). When <code>false</code>, the interpolation will stop when <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_0">interpolationTime()</a> reaches the last keyFrames associated time (see <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_11">keyFrameTime()</a>).<p> Use <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_9">setClosedPath()</a> to create a closed path with the keyFrames. </td> </tr> </table> <a name="z51_7" doxytag="qglviewer::KeyFrameInterpolator::numberOfKeyFrames"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int numberOfKeyFrames </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> const<code> [inline]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Number of keyFrames used in the interpolation. Use <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_2">addKeyFrame()</a> to add new keyFrames. </td> </tr> </table> <a name="z55_3" doxytag="qglviewer::KeyFrameInterpolator::resetInterpolation"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void resetInterpolation </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> <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_0">interpolationTime()</a> is reset to the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_11">keyFrameTime()</a> associated with the first keyFrame and interpolation is stopped (not much more than <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_2">stopInterpolation()</a> and <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_1">setInterpolationTime()</a>). </td> </tr> </table> <a name="z53_9" doxytag="qglviewer::KeyFrameInterpolator::setClosedPath"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void setClosedPath </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const bool </td> <td class="mdname1" valign="top" nowrap> <em>closed</em> = true </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [inline]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Set the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_8">closedPath()</a> value. <dl compact><dt><b>Attention:</b></dt><dd>The closed path feature is not yet implemented. </dd></dl> </td> </tr> </table> <a name="z51_0" doxytag="qglviewer::KeyFrameInterpolator::setFrame"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void setFrame </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="classqglviewer_1_1Frame.html">Frame</a> * </td> <td class="mdname1" valign="top" nowrap> <em>fr</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [inline]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Set the frame that will be associated with the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html">KeyFrameInterpolator</a>. Current frame is in <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_1">frame()</a>.<p> The <a class="el" href="classqglviewer_1_1Frame.html">Frame</a> you associate with a <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html">KeyFrameInterpolator</a> is usually one of your application <a class="el" href="classqglviewer_1_1Frame.html">Frame</a>, that you would like to interpolate. You will then <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_0">setFrame()</a> to a pointer to your <a class="el" href="classqglviewer_1_1Frame.html">Frame</a>. </td> </tr> </table> <a name="z53_5" doxytag="qglviewer::KeyFrameInterpolator::setInterpolationPeriod"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void setInterpolationPeriod </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const int </td> <td class="mdname1" valign="top" nowrap> <em>msecs</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [inline]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Set the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_4">interpolationPeriod()</a>. </td> </tr> </table> <a name="z53_3" doxytag="qglviewer::KeyFrameInterpolator::setInterpolationSpeed"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void setInterpolationSpeed </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const float </td> <td class="mdname1" valign="top" nowrap> <em>speed</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [inline]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Set the interpolation speed. Negative values are possible. See <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_2">interpolationSpeed()</a>. </td> </tr> </table> <a name="z53_1" doxytag="qglviewer::KeyFrameInterpolator::setInterpolationTime"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void setInterpolationTime </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const float </td> <td class="mdname1" valign="top" nowrap> <em>time</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [inline]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Set the current interpolation time. See also <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_0">interpolationTime()</a>.<p> <dl compact><dt><b>Attention:</b></dt><dd>The <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_1">frame()</a> 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#z55_1">startInterpolation()</a>). Use <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_0">interpolateAtTime()</a> to actually interpolate at a given time. </dd></dl> </td> </tr> </table> <a name="z53_7" doxytag="qglviewer::KeyFrameInterpolator::setLoopInterpolation"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void setLoopInterpolation </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const bool </td> <td class="mdname1" valign="top" nowrap> <em>loop</em> = true </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [inline]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Set the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_6">loopInterpolation()</a> value. </td> </tr> </table> <a name="z55_1" doxytag="qglviewer::KeyFrameInterpolator::startInterpolation"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void startInterpolation </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const int </td> <td class="mdname1" valign="top" nowrap> <em>msecs</em> = -1 </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> Starts the interpolation process. A timer will be started with a period defined by <code>msecs</code>. The timer calls <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#i0">update()</a> to update the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_1">frame()</a> position and orientation. Use <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_2">stopInterpolation()</a> to stop interpolation, and <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_1">setInterpolationTime()</a> to change the <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_0">interpolationTime()</a>. <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_4">interpolationIsStarted()</a> will be <code>true</code> until <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_2">stopInterpolation()</a> is called.<p> If <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_0">interpolationTime()</a> is greater than the last <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_11">keyFrameTime()</a>, it is reset to the first <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_11">keyFrameTime()</a> and interpolation starts from there (natural behavior).<p> If <code>msecs</code> is negative (default with no parameter), the current <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_4">interpolationPeriod()</a> will be used (default is 25Hz, see <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_5">setInterpolationPeriod()</a>), otherwise <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_4">interpolationPeriod()</a> will be set to <code>msecs</code>.<p> You may also be interested in <a class="el" href="classQGLViewer.html#z99_6">QGLViewer::animate()</a> and <a class="el" href="classQGLViewer.html#z99_3">QGLViewer::startAnimation()</a>.<p> See the <a href="../examples/keyFrames.html">keyFrames</a> example for an illustration.<p> <dl compact><dt><b>Attention:</b></dt><dd>The keyFrames must be defined <em>before</em> you <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_1">startInterpolation()</a>, or else the interpolation will naturally immediately stop. </dd></dl> </td> </tr> </table> <a name="z55_2" doxytag="qglviewer::KeyFrameInterpolator::stopInterpolation"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void stopInterpolation </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> Stops an interpolation started with <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_1">startInterpolation()</a>. </td> </tr> </table> <a name="z55_5" doxytag="qglviewer::KeyFrameInterpolator::toggleInterpolation"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void toggleInterpolation </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [inline]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Calls <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_1">startInterpolation()</a> or <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_2">stopInterpolation()</a>, depending on <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_4">interpolationIsStarted()</a>. </td> </tr> </table> <a name="i0" doxytag="qglviewer::KeyFrameInterpolator::update"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void update </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [virtual, slot]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Interpolates <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_1">frame()</a> for the next <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_0">interpolationTime()</a> (defined by <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_4">interpolationPeriod()</a>). This internal function is called by a timer when <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_1">startInterpolation()</a> is called. It is publicly provided for your debugging purpose only. <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z55_2">stopInterpolation()</a> is called when <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_0">interpolationTime()</a> reaches the first or last <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z51_11">keyFrameTime()</a>, unless <a class="el" href="classqglviewer_1_1KeyFrameInterpolator.html#z53_6">loopInterpolation()</a> is <code>true</code>. </td> </tr> </table> <hr size="1"><address style="align: right;"><small>Generated on Wed Feb 11 17:22:07 2004 for libQGLViewer by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border=0 > </a>1.3.3 </small></address> </body> </html>