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 _CEGUIAnimationManager_h_
00031 #define _CEGUIAnimationManager_h_
00032
00033 #include "CEGUISingleton.h"
00034 #include "CEGUIString.h"
00035 #include <map>
00036 #include <vector>
00037
00038 #if defined(_MSC_VER)
00039 # pragma warning(push)
00040 # pragma warning(disable : 4251)
00041 #endif
00042
00043
00044 namespace CEGUI
00045 {
00046
00047 class CEGUIEXPORT AnimationManager : public Singleton <AnimationManager>
00048 {
00049 public:
00050
00051
00052
00062 AnimationManager(void);
00063
00064
00072 ~AnimationManager(void);
00073
00085 void addInterpolator(Interpolator* interpolator);
00086
00091 void removeInterpolator(Interpolator* interpolator);
00092
00097 Interpolator* getInterpolator(const String& name) const;
00098
00106 Animation* createAnimation(const String& name);
00107
00112 void destroyAnimation(Animation* animation);
00113
00118 void destroyAnimation(const String& name);
00119
00124 Animation* getAnimation(const String& name) const;
00125
00130 Animation* getAnimationAtIdx(size_t index) const;
00131
00136 size_t getNumAnimations() const;
00137
00145 AnimationInstance* instantiateAnimation(Animation* animation);
00146
00154 AnimationInstance* instantiateAnimation(const String& name);
00155
00160 void destroyAnimationInstance(AnimationInstance* instance);
00161
00166 void destroyAllInstancesOfAnimation(Animation* animation);
00167
00172 AnimationInstance* getAnimationInstanceAtIdx(size_t index) const;
00173
00179 size_t getNumAnimationInstances() const;
00180
00187 void stepInstances(float delta);
00188
00201 void loadAnimationsFromXML(const String& filename,
00202 const String& resourceGroup = "");
00203
00212 static void setDefaultResourceGroup(const String& resourceGroup)
00213 {
00214 s_defaultResourceGroup = resourceGroup;
00215 }
00216
00226 static const String& getDefaultResourceGroup()
00227 {
00228 return s_defaultResourceGroup;
00229 }
00230
00231 private:
00232 typedef std::map<String, Interpolator*> InterpolatorMap;
00234 InterpolatorMap d_interpolators;
00235 typedef std::vector<Interpolator*> BasicInterpolatorList;
00237 BasicInterpolatorList d_basicInterpolators;
00238
00239 typedef std::map<String, Animation*> AnimationMap;
00241 AnimationMap d_animations;
00242
00243 typedef std::multimap<Animation*, AnimationInstance*> AnimationInstanceMap;
00245 AnimationInstanceMap d_animationInstances;
00247 static const String s_xmlSchemaName;
00249 static String s_defaultResourceGroup;
00250 };
00251
00252 }
00253
00254 #if defined(_MSC_VER)
00255 # pragma warning(pop)
00256 #endif
00257
00258 #endif // end of guard _CEGUIAnimationManager_h_
00259