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 _CEGUIAffector_h_
00031 #define _CEGUIAffector_h_
00032
00033 #include "CEGUIString.h"
00034 #include "CEGUIKeyFrame.h"
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
00056 class CEGUIEXPORT Affector
00057 {
00058 public:
00060 enum ApplicationMethod
00061 {
00063 AM_Absolute,
00064
00068 AM_Relative,
00069
00073 AM_RelativeMultiply
00074 };
00075
00079 Affector(Animation* parent);
00080
00082 ~Affector(void);
00083
00092 void setApplicationMethod(ApplicationMethod method);
00093
00101 ApplicationMethod getApplicationMethod() const;
00102
00107 void setTargetProperty(const String& target);
00108
00113 const String& getTargetProperty() const;
00114
00122 void setInterpolator(Interpolator* interpolator);
00123
00131 void setInterpolator(const String& name);
00132
00137 Interpolator* getInterpolator() const;
00138
00143 KeyFrame* createKeyFrame(float position);
00144
00153 KeyFrame* createKeyFrame(float position, const String& value,
00154 KeyFrame::Progression progression = KeyFrame::P_Linear,
00155 const String& sourceProperty = "");
00156
00161 void destroyKeyFrame(KeyFrame* keyframe);
00162
00167 KeyFrame* getKeyFrameAtPosition(float position) const;
00168
00173 KeyFrame* getKeyFrameAtIdx(size_t index) const;
00174
00179 size_t getNumKeyFrames() const;
00180
00185 void moveKeyFrameToPosition(KeyFrame* keyframe, float newPosition);
00186
00191 void moveKeyFrameToPosition(float oldPosition, float newPosition);
00192
00202 void savePropertyValues(AnimationInstance* instance);
00203
00216 void apply(AnimationInstance* instance);
00217
00218 private:
00220 Animation* d_parent;
00222 ApplicationMethod d_applicationMethod;
00224 String d_targetProperty;
00226 Interpolator* d_interpolator;
00227
00228 typedef std::map<float, KeyFrame*> KeyFrameMap;
00232 KeyFrameMap d_keyFrames;
00233 };
00234
00235 }
00236
00237 #if defined(_MSC_VER)
00238 # pragma warning(pop)
00239 #endif
00240
00241 #endif // end of guard _CEGUIAffector_h_
00242