23 #ifndef QGLVIEWER_KEY_FRAME_INTERPOLATOR_H 24 #define QGLVIEWER_KEY_FRAME_INTERPOLATOR_H 162 void addKeyFrame(
const Frame& frame);
163 void addKeyFrame(
const Frame& frame, qreal time);
165 void addKeyFrame(
const Frame*
const frame);
166 void addKeyFrame(
const Frame*
const frame, qreal time);
183 void setFrame(
Frame*
const frame);
189 Frame keyFrame(
int index)
const;
190 qreal keyFrameTime(
int index)
const;
193 qreal duration()
const;
194 qreal firstTime()
const;
195 qreal lastTime()
const;
268 void startInterpolation(
int period = -1);
269 void stopInterpolation();
270 void resetInterpolation();
272 void toggleInterpolation() {
if (interpolationIsStarted()) stopInterpolation();
else startInterpolation(); }
273 virtual void interpolateAtTime(qreal time);
279 virtual void drawPath(
int mask=1,
int nbFrames=6, qreal scale=1.0);
285 virtual QDomElement domElement(
const QString& name, QDomDocument& document)
const;
286 virtual void initFromDOMElement(
const QDomElement& element);
290 virtual void update();
291 virtual void invalidateValues() { valuesAreValid_ =
false; pathIsValid_ =
false; splineCacheIsValid_ =
false; }
299 void updateCurrentKeyFrameForTime(qreal time);
300 void updateModifiedFrameValues();
301 void updateSplineCache();
315 qreal
time()
const {
return time_; }
317 void updateValuesFromPointer();
318 void flipOrientationIfNeeded(
const Quaternion& prev);
319 void computeTangent(
const KeyFrame*
const prev,
const KeyFrame*
const next);
330 QMutableListIterator<KeyFrame*>* currentFrame_[4];
357 #endif // QGLVIEWER_KEY_FRAME_INTERPOLATOR_H A keyFrame Catmull-Rom Frame interpolator.
int interpolationPeriod() const
qreal interpolationTime() const
void setClosedPath(bool closed=true)
bool interpolationStarted_
const Frame * frame() const
virtual void invalidateValues()
void toggleInterpolation()
The Vec class represents 3D positions and 3D vectors.
bool interpolationIsStarted() const
qreal interpolationSpeed_
const Frame *const frame_
void setLoopInterpolation(bool loop=true)
bool loopInterpolation() const
Quaternion orientation() const
The Quaternion class represents 3D rotations and orientations.
void setInterpolationTime(qreal time)
void setInterpolationSpeed(qreal speed)
The Frame class represents a coordinate system, defined by a position and an orientation.
QList< KeyFrame * > keyFrame_
qreal interpolationSpeed() const
int numberOfKeyFrames() const
void setInterpolationPeriod(int period)