Crazy Eddie's GUI System  0.8.7
KeyFrame.h
1 /***********************************************************************
2  created: 7/8/2010
3  author: Martin Preisler
4 
5  purpose: Defines the interface for the KeyFrame class
6 *************************************************************************/
7 /***************************************************************************
8  * Copyright (C) 2004 - 2010 Paul D Turner & The CEGUI Development Team
9  *
10  * Permission is hereby granted, free of charge, to any person obtaining
11  * a copy of this software and associated documentation files (the
12  * "Software"), to de/al in the Software without restriction, including
13  * without limitation the rights to use, copy, modify, merge, publish,
14  * distribute, sublicense, and/or sell copies of the Software, and to
15  * permit persons to whom the Software is furnished to do so, subject to
16  * the following conditions:
17  *
18  * The above copyright notice and this permission notice shall be
19  * included in all copies or substantial portions of the Software.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
25  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
26  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27  * OTHER DEALINGS IN THE SOFTWARE.
28  ***************************************************************************/
29 #ifndef _CEGUIKeyFrame_h_
30 #define _CEGUIKeyFrame_h_
31 
32 #include "CEGUI/String.h"
33 
34 // Start of CEGUI namespace section
35 namespace CEGUI
36 {
37 
49 class CEGUIEXPORT KeyFrame :
50  public AllocatedObject<KeyFrame>
51 {
52 public:
57  {
68  P_Discrete
69  };
70 
72  KeyFrame(Affector* parent, float position);
73 
75  ~KeyFrame(void);
76 
81  Affector* getParent() const;
82 
90  size_t getIdxInParent() const;
91 
96  void moveToPosition(float newPosition);
97 
102  float getPosition() const;
103 
114  void setValue(const String& value);
115 
120  const String& getValue() const;
121 
134  void setSourceProperty(const String& sourceProperty);
135 
140  const String& getSourceProperty() const;
141 
154 
168 
174 
180  float alterInterpolationPosition(float position);
181 
188 
199  void notifyPositionChanged(float newPosition);
200 
208  void writeXMLToStream(XMLSerializer& xml_stream) const;
209 
210 private:
212  Affector* d_parent;
214  float d_position;
215 
217  String d_value;
219  String d_sourceProperty;
221  Progression d_progression;
222 };
223 
224 } // End of CEGUI namespace section
225 
226 #endif // end of guard _CEGUIKeyFrame_h_
227 
CEGUI::KeyFrame::writeXMLToStream
void writeXMLToStream(XMLSerializer &xml_stream) const
Writes an xml representation of this KeyFrame to out_stream.
CEGUI::KeyFrame::getProgression
Progression getProgression() const
Retrieves progression method of this key frame.
CEGUI::KeyFrame::alterInterpolationPosition
float alterInterpolationPosition(float position)
Internal method, alters interpolation position based on progression method. Don't use unless you know...
CEGUI::KeyFrame::getSourceProperty
const String & getSourceProperty() const
Gets the source property of this key frame.
CEGUI::KeyFrame::moveToPosition
void moveToPosition(float newPosition)
Moves this keyframe to a new given position.
CEGUI::KeyFrame::setValue
void setValue(const String &value)
Sets the value of this key frame.
CEGUI::AnimationInstance
Defines an 'animation instance' class.
Definition: AnimationInstance.h:75
CEGUI::KeyFrame::KeyFrame
KeyFrame(Affector *parent, float position)
internal constructor, please use Affector::createKeyFrame
CEGUI::KeyFrame::getValue
const String & getValue() const
Retrieves value of this key frame.
CEGUI::XMLSerializer
Class used to create XML Document.
Definition: XMLSerializer.h:87
CEGUI
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
CEGUI::AllocatedObject
Definition: MemoryAllocatedObject.h:110
CEGUI::KeyFrame::getPosition
float getPosition() const
Retrieves position of this key frame in the animation (in seconds)
CEGUI::KeyFrame::getParent
Affector * getParent() const
Retrieves parent Affector of this Key Frame.
CEGUI::Affector
Defines an 'affector' class.
Definition: Affector.h:56
CEGUI::KeyFrame::setSourceProperty
void setSourceProperty(const String &sourceProperty)
Sets the source property of this key frame.
CEGUI::KeyFrame::notifyPositionChanged
void notifyPositionChanged(float newPosition)
internal method, notifies this keyframe that it has been moved
CEGUI::KeyFrame::savePropertyValue
void savePropertyValue(AnimationInstance *instance)
Internal method, if this keyframe is using source property, this saves it's value to given instance b...
CEGUI::KeyFrame::P_Linear
@ P_Linear
linear progression
Definition: KeyFrame.h:59
CEGUI::KeyFrame::~KeyFrame
~KeyFrame(void)
internal destructor, please use Affector::destroyKeyFrame
CEGUI::KeyFrame::setProgression
void setProgression(Progression p)
Sets the progression method of this key frame.
CEGUI::KeyFrame::P_QuadraticDecelerating
@ P_QuadraticDecelerating
progress is decelerated, starts fast and slows down
Definition: KeyFrame.h:63
CEGUI::KeyFrame::getValueForAnimation
const String & getValueForAnimation(AnimationInstance *instance) const
Retrieves value of this for use when animating.
CEGUI::String
String class used within the GUI system.
Definition: String.h:64
CEGUI::KeyFrame::Progression
Progression
Definition: KeyFrame.h:57
CEGUI::KeyFrame::P_QuadraticAccelerating
@ P_QuadraticAccelerating
progress is accelerated, starts slow and speeds up
Definition: KeyFrame.h:61
CEGUI::KeyFrame::getIdxInParent
size_t getIdxInParent() const
Retrieves index with which this keyframe is retrievable in parent Affector.
CEGUI::KeyFrame
Defines a 'key frame' class.
Definition: KeyFrame.h:51