Cinder  0.9.1
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
cinder::Tween< T > Class Template Reference

#include <Tween.h>

Inherits cinder::TweenBase.

Inherited by cinder::FnTween< T >.

Classes

class  Options
 

Public Types

typedef std::function< T(const T &, const T &, float)> LerpFn
 
typedef std::function< void()> StartFn
 
typedef std::function< void()> FinishFn
 
typedef std::function< void()> UpdateFn
 

Public Member Functions

 Tween (T *target, T endValue, float startTime, float duration, EaseFn easeFunction=easeNone, LerpFn lerpFunction=&tweenLerp< T >)
 
 Tween (T *target, T startValue, T endValue, float startTime, float duration, EaseFn easeFunction=easeNone, LerpFn lerpFunction=&tweenLerp< T >)
 
virtual ~Tween ()
 
getStartValue () const
 
getEndValue () const
 
T * getTarget () const
 
bool isCopyStartValue ()
 
void setLerpFn (const LerpFn &lerpFn)
 
TweenRef< T > getThisRef ()
 
void setEaseFn (EaseFn easeFunction)
 
EaseFn getEaseFn () const
 
void setStartFn (StartFn startFunction)
 
StartFn getStartFn () const
 
void setReverseStartFn (StartFn reverseStartFunction)
 
StartFn getReverseStartFn () const
 
void setUpdateFn (UpdateFn updateFunction)
 
UpdateFn getUpdateFn () const
 
void setFinishFn (FinishFn finishFn)
 
FinishFn getFinishFn () const
 
void setReverseFinishFn (FinishFn reverseFinishFn)
 
FinishFn getReverseFinishFn () const
 
float getStartTime () const
 
void setStartTime (float newTime)
 
float getDuration () const
 
void setDuration (float newDuration)
 
bool getLoop () const
 
void setLoop (bool doLoop=true)
 
bool getPingPong () const
 
void setPingPong (bool pingPong=true)
 
bool getInfinite () const
 
void setInfinite (bool infinite=true)
 
float getEndTime () const
 
class TimelinegetParent () const
 
void removeSelf ()
 
bool hasStarted () const
 
bool isComplete ()
 
bool getAutoRemove () const
 
void setAutoRemove (bool autoRemove=true)
 
virtual void loopStart ()
 
virtual bool updateAtLoopStart ()
 
virtual float calcDuration () const
 
void stepTo (float time, bool reverse)
 
TimelineItemRef thisRef ()
 

Protected Member Functions

virtual void reverse ()
 
virtual TimelineItemRef clone () const
 
virtual TimelineItemRef cloneReverse () const
 
virtual void start (bool reverse)
 
virtual void update (float relativeTime)
 
virtual void reset (bool unsetStarted)
 
virtual void complete (bool reverse)
 
void setDurationDirty ()
 
void updateDuration () const
 
float loopTime (float absTime)
 
void setTarget (void *target)
 

Protected Attributes

mStartValue
 
mEndValue
 
LerpFn mLerpFunction
 
StartFn mStartFunction
 
StartFn mReverseStartFunction
 
UpdateFn mUpdateFunction
 
FinishFn mFinishFunction
 
FinishFn mReverseFinishFunction
 
EaseFn mEaseFunction
 
float mDuration
 
bool mCopyStartValue
 
class TimelinemParent
 
void * mTarget
 
float mStartTime
 
bool mHasStarted
 
bool mHasReverseStarted
 
bool mComplete
 
bool mReverseComplete
 
bool mMarkedForRemoval
 
bool mInfinite
 
bool mLoop
 
bool mPingPong
 
bool mUseAbsoluteTime
 
bool mAutoRemove
 
int32_t mLastLoopIteration
 

Member Typedef Documentation

template<typename T >
typedef std::function<T (const T&, const T&, float)> cinder::Tween< T >::LerpFn
typedef std::function<void ()> cinder::TweenBase::StartFn
inherited
typedef std::function<void ()> cinder::TweenBase::FinishFn
inherited
typedef std::function<void ()> cinder::TweenBase::UpdateFn
inherited

Constructor & Destructor Documentation

template<typename T >
cinder::Tween< T >::Tween ( T *  target,
endValue,
float  startTime,
float  duration,
EaseFn  easeFunction = easeNone,
LerpFn  lerpFunction = &tweenLerp<T> 
)
template<typename T >
cinder::Tween< T >::Tween ( T *  target,
startValue,
endValue,
float  startTime,
float  duration,
EaseFn  easeFunction = easeNone,
LerpFn  lerpFunction = &tweenLerp<T> 
)
template<typename T >
virtual cinder::Tween< T >::~Tween ( )
virtual

Member Function Documentation

template<typename T >
T cinder::Tween< T >::getStartValue ( ) const

Returns the starting value for the tween. If the tween will copy its target's value upon starting (isCopyStartValue()) and the tween has not started, this returns the value of its target when the tween was created.

template<typename T >
T cinder::Tween< T >::getEndValue ( ) const
template<typename T >
T* cinder::Tween< T >::getTarget ( ) const
template<typename T >
bool cinder::Tween< T >::isCopyStartValue ( )

Returns whether the tween will copy its target's value upon starting.

template<typename T >
void cinder::Tween< T >::setLerpFn ( const LerpFn lerpFn)
template<typename T >
TweenRef<T> cinder::Tween< T >::getThisRef ( )

Returns a TweenRef<T> to this.

template<typename T >
virtual void cinder::Tween< T >::reverse ( )
protectedvirtual

Implements cinder::TimelineItem.

template<typename T >
virtual TimelineItemRef cinder::Tween< T >::clone ( ) const
protectedvirtual

Creates a clone of the item.

Implements cinder::TimelineItem.

template<typename T >
virtual TimelineItemRef cinder::Tween< T >::cloneReverse ( ) const
protectedvirtual

Creates a cloned item which runs in reverse relative to a timeline of duration timelineDuration.

Implements cinder::TimelineItem.

template<typename T >
virtual void cinder::Tween< T >::start ( bool  reverse)
protectedvirtual

Implements cinder::TimelineItem.

template<typename T >
virtual void cinder::Tween< T >::update ( float  relativeTime)
protectedvirtual

Implements cinder::TimelineItem.

Reimplemented in cinder::FnTween< T >.

void cinder::TweenBase::setEaseFn ( EaseFn  easeFunction)
inherited

change how the tween moves through time

EaseFn cinder::TweenBase::getEaseFn ( ) const
inherited
void cinder::TweenBase::setStartFn ( StartFn  startFunction)
inherited
StartFn cinder::TweenBase::getStartFn ( ) const
inherited
void cinder::TweenBase::setReverseStartFn ( StartFn  reverseStartFunction)
inherited
StartFn cinder::TweenBase::getReverseStartFn ( ) const
inherited
void cinder::TweenBase::setUpdateFn ( UpdateFn  updateFunction)
inherited
UpdateFn cinder::TweenBase::getUpdateFn ( ) const
inherited
void cinder::TweenBase::setFinishFn ( FinishFn  finishFn)
inherited
FinishFn cinder::TweenBase::getFinishFn ( ) const
inherited
void cinder::TweenBase::setReverseFinishFn ( FinishFn  reverseFinishFn)
inherited
FinishFn cinder::TweenBase::getReverseFinishFn ( ) const
inherited
virtual void cinder::TweenBase::reset ( bool  unsetStarted)
protectedvirtualinherited

Marks the item as not completed, and if unsetStarted, marks the item as not started.

Reimplemented from cinder::TimelineItem.

virtual void cinder::TweenBase::complete ( bool  reverse)
protectedvirtualinherited

Implements cinder::TimelineItem.

float cinder::TimelineItem::getStartTime ( ) const
inherited

Returns the item's start time.

void cinder::TimelineItem::setStartTime ( float  newTime)
inherited

Set the items's start time to newTime.

float cinder::TimelineItem::getDuration ( ) const
inherited

Returns the item's duration.

void cinder::TimelineItem::setDuration ( float  newDuration)
inherited

Sets the item's duration to newDuration.

bool cinder::TimelineItem::getLoop ( ) const
inherited

Returns whether the item starts over when it is complete.

void cinder::TimelineItem::setLoop ( bool  doLoop = true)
inherited

Sets whether the item starts over when it is complete.

bool cinder::TimelineItem::getPingPong ( ) const
inherited

Returns whether the item alternates between forward and reverse. Overrides loop when true.

void cinder::TimelineItem::setPingPong ( bool  pingPong = true)
inherited

Sets whether the item alternates between forward and reverse. Overrides loop when true.

bool cinder::TimelineItem::getInfinite ( ) const
inherited

Returns whether the item ever is marked as complete.

void cinder::TimelineItem::setInfinite ( bool  infinite = true)
inherited

Sets whether the item ever is marked as complete.

float cinder::TimelineItem::getEndTime ( ) const
inherited

Returns the time of the item's competion, equivalent to getStartTime() + getDuration().

class Timeline* cinder::TimelineItem::getParent ( ) const
inherited

Returns a pointer to the item's parent Timeline.

void cinder::TimelineItem::removeSelf ( )
inherited

Removes the item from its parent Timeline.

bool cinder::TimelineItem::hasStarted ( ) const
inherited

Returns whether the item has started.

bool cinder::TimelineItem::isComplete ( )
inherited

Returns whether the item has completed.

bool cinder::TimelineItem::getAutoRemove ( ) const
inherited

Should the item remove itself from the Timeline when it is complete.

void cinder::TimelineItem::setAutoRemove ( bool  autoRemove = true)
inherited

Sets whether the item will remove itself from the Timeline when it is complete.

virtual void cinder::TimelineItem::loopStart ( )
virtualinherited

Reimplemented in cinder::Cue, and cinder::Timeline.

virtual bool cinder::TimelineItem::updateAtLoopStart ( )
virtualinherited

Call update() only at the beginning of each loop (for example Cues exhibit require this behavior)

Reimplemented in cinder::Cue.

virtual float cinder::TimelineItem::calcDuration ( ) const
virtualinherited

Reimplemented in cinder::Timeline.

void cinder::TimelineItem::stepTo ( float  time,
bool  reverse 
)
inherited

go to a specific time, generally called by the parent Timeline only. If reverse then playhead is interpreted as retreating rather than advancing.

TimelineItemRef cinder::TimelineItem::thisRef ( )
inherited
void cinder::TimelineItem::setDurationDirty ( )
protectedinherited
void cinder::TimelineItem::updateDuration ( ) const
protectedinherited
float cinder::TimelineItem::loopTime ( float  absTime)
protectedinherited

Converts time from absolute to absolute based on item's looping attributes.

void cinder::TimelineItem::setTarget ( void *  target)
protectedinherited

Member Data Documentation

template<typename T >
T cinder::Tween< T >::mStartValue
protected
template<typename T >
T cinder::Tween< T >::mEndValue
protected
template<typename T >
LerpFn cinder::Tween< T >::mLerpFunction
protected
StartFn cinder::TweenBase::mStartFunction
protectedinherited
StartFn cinder::TweenBase::mReverseStartFunction
protectedinherited
UpdateFn cinder::TweenBase::mUpdateFunction
protectedinherited
FinishFn cinder::TweenBase::mFinishFunction
protectedinherited
FinishFn cinder::TweenBase::mReverseFinishFunction
protectedinherited
EaseFn cinder::TweenBase::mEaseFunction
protectedinherited
float cinder::TweenBase::mDuration
protectedinherited
bool cinder::TweenBase::mCopyStartValue
protectedinherited
class Timeline* cinder::TimelineItem::mParent
protectedinherited
void* cinder::TimelineItem::mTarget
protectedinherited
float cinder::TimelineItem::mStartTime
protectedinherited
bool cinder::TimelineItem::mHasStarted
protectedinherited
bool cinder::TimelineItem::mHasReverseStarted
protectedinherited
bool cinder::TimelineItem::mComplete
protectedinherited
bool cinder::TimelineItem::mReverseComplete
protectedinherited
bool cinder::TimelineItem::mMarkedForRemoval
protectedinherited
bool cinder::TimelineItem::mInfinite
protectedinherited
bool cinder::TimelineItem::mLoop
protectedinherited
bool cinder::TimelineItem::mPingPong
protectedinherited
bool cinder::TimelineItem::mUseAbsoluteTime
protectedinherited
bool cinder::TimelineItem::mAutoRemove
protectedinherited
int32_t cinder::TimelineItem::mLastLoopIteration
protectedinherited

The documentation for this class was generated from the following file: