00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef _CEGUIAnimation_h_
00031 #define _CEGUIAnimation_h_
00032
00033 #include "CEGUIString.h"
00034 #include <vector>
00035 #include <map>
00036
00037 #if defined(_MSC_VER)
00038 # pragma warning(push)
00039 # pragma warning(disable : 4251)
00040 #endif
00041
00042
00043 namespace CEGUI
00044 {
00045
00065 class CEGUIEXPORT Animation
00066 {
00067 public:
00069 enum ReplayMode
00070 {
00072 RM_Once,
00074 RM_Loop,
00078 RM_Bounce
00079 };
00080
00084 Animation(const String& name);
00085
00087 ~Animation(void);
00088
00093 const String& getName() const;
00094
00099 void setReplayMode(ReplayMode mode);
00100
00105 ReplayMode getReplayMode() const;
00106
00111 void setDuration(float duration);
00112
00117 float getDuration() const;
00118
00127 void setAutoStart(bool autoStart);
00128
00136 bool getAutoStart() const;
00137
00145 Affector* createAffector(void);
00146
00154 Affector* createAffector(const String& targetProperty,
00155 const String& interpolator);
00156
00161 void destroyAffector(Affector* affector);
00162
00167 Affector* getAffectorAtIdx(size_t index) const;
00168
00173 size_t getNumAffectors(void) const;
00174
00200 void defineAutoSubscription(const String& eventName, const String& action);
00201
00209 void undefineAutoSubscription(const String& eventName,
00210 const String& action);
00211
00219 void undefineAllAutoSubscriptions();
00220
00229 void autoSubscribe(AnimationInstance* instance);
00230
00239 void autoUnsubscribe(AnimationInstance* instance);
00240
00250 void savePropertyValues(AnimationInstance* instance);
00251
00260 void apply(AnimationInstance* instance);
00261
00262 private:
00264 String d_name;
00265
00267 ReplayMode d_replayMode;
00269 float d_duration;
00273 bool d_autoStart;
00274
00275 typedef std::vector<Affector*> AffectorList;
00277 AffectorList d_affectors;
00278
00279 typedef std::multimap<String, String> SubscriptionMap;
00284 SubscriptionMap d_autoSubscriptions;
00285 };
00286
00287 }
00288
00289 #if defined(_MSC_VER)
00290 # pragma warning(pop)
00291 #endif
00292
00293 #endif // end of guard _CEGUIAnimation_h_
00294