23 #ifndef QGLVIEWER_KEY_FRAME_INTERPOLATOR_H 24 #define QGLVIEWER_KEY_FRAME_INTERPOLATOR_H 26 #if QT_VERSION > 0x040000 167 void addKeyFrame(
const Frame& frame);
168 void addKeyFrame(
const Frame& frame,
float time);
170 void addKeyFrame(
const Frame*
const frame);
171 void addKeyFrame(
const Frame*
const frame,
float time);
188 void setFrame(
Frame*
const frame);
194 Frame keyFrame(
int index)
const;
195 float keyFrameTime(
int index)
const;
198 float duration()
const;
199 float firstTime()
const;
200 float lastTime()
const;
273 void startInterpolation(
int period = -1);
274 void stopInterpolation();
275 void resetInterpolation();
277 void toggleInterpolation() {
if (interpolationIsStarted()) stopInterpolation();
else startInterpolation(); };
278 virtual void interpolateAtTime(
float time);
284 virtual void drawPath(
int mask=1,
int nbFrames=6,
float scale=1.0f);
290 virtual QDomElement domElement(
const QString& name, QDomDocument& document)
const;
291 virtual void initFromDOMElement(
const QDomElement& element);
295 virtual void update();
296 virtual void invalidateValues() { valuesAreValid_ =
false; pathIsValid_ =
false; splineCacheIsValid_ =
false; };
304 void updateCurrentKeyFrameForTime(
float time);
305 void updateModifiedFrameValues();
306 void updateSplineCache();
320 float time()
const {
return time_; }
322 void updateValuesFromPointer();
323 void flipOrientationIfNeeded(
const Quaternion& prev);
324 void computeTangent(
const KeyFrame*
const prev,
const KeyFrame*
const next);
334 #if QT_VERSION >= 0x040000 335 mutable QList<KeyFrame*> keyFrame_;
336 QMutableListIterator<KeyFrame*>* currentFrame_[4];
341 QPtrListIterator<KeyFrame>* currentFrame_[4];
342 # if QT_VERSION >= 0x030000 344 QValueVector<Frame> path_;
374 #endif // QGLVIEWER_KEY_FRAME_INTERPOLATOR_H float interpolationTime() const
A keyFrame Catmull-Rom Frame interpolator.
int interpolationPeriod() const
float interpolationSpeed_
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.
void setInterpolationTime(float time)
bool interpolationIsStarted() const
const Frame *const frame_
void setLoopInterpolation(bool loop=true)
bool loopInterpolation() const
Quaternion orientation() const
The Quaternion class represents 3D rotations and orientations.
The Frame class represents a coordinate system, defined by a position and an orientation.
void setInterpolationSpeed(float speed)
float interpolationSpeed() const
QPtrList< KeyFrame > keyFrame_
int numberOfKeyFrames() const
void setInterpolationPeriod(int period)