36 : frame_(NULL), period_(40), interpolationTime_(0.0), interpolationSpeed_(1.0), interpolationStarted_(false),
37 closedPath_(false), loopInterpolation_(false), pathIsValid_(false), valuesAreValid_(true), currentFrameValid_(false)
41 for (
int i=0; i<4; ++i)
50 for (
int i=0; i<4; ++i)
183 qWarning(
"Error in KeyFrameInterpolator::addKeyFrame: time is not monotone");
206 qWarning(
"Error in KeyFrameInterpolator::addKeyFrame: time is not monotone");
260 glDisable(GL_LIGHTING);
262 const qreal halfHeight = scale * 0.07;
263 const qreal halfWidth = halfHeight * 1.3;
264 const qreal dist = halfHeight / tan(qreal(
M_PI)/8.0);
266 const qreal arrowHeight = 1.5 * halfHeight;
267 const qreal baseHeight = 1.2 * halfHeight;
268 const qreal arrowHalfWidth = 0.5 * halfWidth;
269 const qreal baseHalfWidth = 0.3 * halfWidth;
272 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
273 glBegin(GL_LINE_STRIP);
274 glVertex3d(-halfWidth, halfHeight,-dist);
275 glVertex3d(-halfWidth,-halfHeight,-dist);
276 glVertex3d( 0.0, 0.0, 0.0);
277 glVertex3d( halfWidth,-halfHeight,-dist);
278 glVertex3d(-halfWidth,-halfHeight,-dist);
280 glBegin(GL_LINE_STRIP);
281 glVertex3d( halfWidth,-halfHeight,-dist);
282 glVertex3d( halfWidth, halfHeight,-dist);
283 glVertex3d( 0.0, 0.0, 0.0);
284 glVertex3d(-halfWidth, halfHeight,-dist);
285 glVertex3d( halfWidth, halfHeight,-dist);
289 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
292 glVertex3d(-baseHalfWidth, halfHeight,-dist);
293 glVertex3d( baseHalfWidth, halfHeight,-dist);
294 glVertex3d( baseHalfWidth, baseHeight,-dist);
295 glVertex3d(-baseHalfWidth, baseHeight,-dist);
299 glBegin(GL_TRIANGLES);
300 glVertex3d( 0.0, arrowHeight,-dist);
301 glVertex3d(-arrowHalfWidth, baseHeight, -dist);
302 glVertex3d( arrowHalfWidth, baseHeight, -dist);
339 const int nbSteps = 30;
366 Vec v1 = 3.0 * diff - 2.0 * kf_[1]->
tgP() - kf_[2]->
tgP();
367 Vec v2 = -2.0 * diff + kf_[1]->
tgP() + kf_[2]->
tgP();
370 for (
int step=0; step<nbSteps; ++step)
372 qreal alpha = step /
static_cast<qreal
>(nbSteps);
393 glDisable(GL_LIGHTING);
398 glBegin(GL_LINE_STRIP);
406 if (nbFrames > nbSteps)
410 if ((count++) >= goal)
412 goal += nbSteps /
static_cast<qreal
>(nbFrames);
414 glMultMatrixd(fr.
matrix());
619 QDomElement de = document.createElement(name);
624 QDomElement kfNode = fr.
domElement(
"KeyFrame", document);
625 kfNode.setAttribute(
"index", QString::number(count));
626 kfNode.setAttribute(
"time", QString::number(kf->
time()));
627 de.appendChild(kfNode);
630 de.setAttribute(
"nbKF", QString::number(
keyFrame_.count()));
651 QDomElement child=element.firstChild().toElement();
652 while (!child.isNull())
654 if (child.tagName() ==
"KeyFrame")
662 child = child.nextSibling().toElement();
684 : time_(t), frame_(NULL)