Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

TimeTrack.h

00001 /*************************************************************************** 00002 * This file is part of OpenCAL: Open Computer Animation Library * 00003 * I created OpenCAL as my master's thesis Computer Science (multimedia) * 00004 * at the tUL university in Diepenbeek, Belgium * 00005 * * 00006 * Copyright (C) 2003-2004 by Jeroen Dierckx * 00007 * jeroen.dierckx@student.luc.ac.be * 00008 * * 00009 ***************************************************************************/ 00010 00011 #ifndef OPENCAL_TIMETRACK_H 00012 #define OPENCAL_TIMETRACK_H 00013 00014 // Includes 00015 #include <OpenCAL/global.h> 00016 00017 00018 namespace OpenCAL 00019 { 00020 // Forward declarations 00021 class KeyFrameSystem; 00022 00029 class OPENCAL_API TimeTrack 00030 { 00031 protected: 00032 // Member variables 00033 KeyFrameSystem *m_keyFrameSystem; 00034 float m_currentTime, m_length; 00035 bool m_loop, m_stopped; 00036 00037 public: 00038 // Constructors and destructor 00039 TimeTrack(KeyFrameSystem *keyFrameSystem); 00040 virtual ~TimeTrack(); 00041 00042 // Get functions 00043 KeyFrameSystem *getKeyFrameSystem() { return m_keyFrameSystem; } 00044 float getCurrentTime() const { return m_currentTime; } 00045 float getLength() const { return m_length; } 00046 bool isLooping() const { return m_loop; } 00047 bool isStopped() const { return m_stopped; } 00048 00049 // Set functions 00050 void setLoop(bool loop) { m_loop = loop; } 00051 00052 // Time stepping functions 00053 void step(float deltaSeconds); 00054 void rewind(); 00055 void setTime(float time); 00056 00057 // Other functions 00058 void pause() { m_stopped = true; } 00059 void unpause() { m_stopped = false; } 00060 00061 virtual void apply() = 0; 00062 00063 protected: 00064 // Protected functions 00065 float applySpeed() const; 00066 }; 00067 } 00068 00069 #endif // OPENCAL_TIMETRACK_H

Generated on Sun Aug 15 19:19:23 2004 for OpenCAL: Open Computer Animation Library by doxygen 1.3.8