You.i Engine
CYITimelineGroup Class Reference

Detailed Description

The base class for types of timeline groups.

This class provides a common interface for any timeline group. Basic operations including adding, removing, and updating offsets. Groups can be nested to create the desired effect.

Groups do NOT take ownership of their children. Children may be added to multiple groups without a problem. As expected, if the same properties of a CYISceneNode are modified simultaneously the modifiers will compete. This is true whether the modifiers are the same timeline or different timelines.

This class cannot be instantiated.

#include <animation/YiTimelineGroup.h>

Inheritance diagram for CYITimelineGroup:

Public Member Functions

virtual ~CYITimelineGroup ()
 
void AddTimeline (CYIAbstractTimeline *pTimeline)
 
void AddTimelineWithOffset (CYIAbstractTimeline *pTimeline, uint64_t uMillis)
 
uint32_t GetTimelineCount () const
 
std::vector< CYIAbstractTimeline * > GetTimelines () const
 
std::vector< std::pair< CYIAbstractTimeline *, uint64_t > > GetTimelinesWithOffsets (CYIAbstractTimeline::DIRECTION eDirection=CYIAbstractTimeline::FORWARD) const
 
uint64_t GetTimelineOffset (CYIAbstractTimeline *pTimeline, CYIAbstractTimeline::DIRECTION eDirection=CYIAbstractTimeline::FORWARD) const
 
void RemoveTimeline (CYIAbstractTimeline *pTimeline)
 
void RemoveAllTimelines ()
 
void RemoveTimelinesIf (const std::function< bool(CYIAbstractTimeline *)> &predicate)
 
void UpdateOffsetOfTimeline (const CYIAbstractTimeline *pTimeline, uint64_t uMillis)
 
- Public Member Functions inherited from CYIAbstractTimeline
virtual ~CYIAbstractTimeline ()
 
void Start ()
 
void Finish ()
 
void Pause ()
 
void Continue ()
 
void SetDirection (DIRECTION direction)
 
DIRECTION GetDirection () const
 
STATUS GetStatus () const
 
uint64_t GetStartTime () const
 
uint64_t GetCurrentTime () const
 
float GetTimeAsPercentage () const
 
uint64_t GetTotalTime () const
 
void SeekToPercentage (float fPercentage)
 
void SeekToTime (uint64_t uMillis)
 
void Abort ()
 
void SetDisablesInput (bool bDisablesInput)
 
void Track ()
 
void Untrack ()
 
void StartForward ()
 
void StartReverse ()
 
void ContinueForward ()
 
void ContinueReverse ()
 
void SetDirectionForward ()
 
void SetDirectionReverse ()
 
void SetFrameModes (YI_FRAME_MODE eStartFrameMode, YI_FRAME_MODE eEndFrameMode)
 
bool SetSourcePositions (CYISceneNode *pNode, const glm::vec3 &vPosition)
 
bool ClearSourcePositions (CYISceneNode *pNode)
 
bool SetTargetPositions (CYISceneNode *pNode, const glm::vec3 &vPosition)
 
bool ClearTargetPositions (CYISceneNode *pNode)
 
const std::shared_ptr< CYITimelineProxy > & GetProxy () const
 
void SetRootNode (CYISceneNode *pRootNode)
 
const std::shared_ptr< CYISceneNodeProxy > & GetRootNode () const
 
- Public Member Functions inherited from CYISignalHandler
 CYISignalHandler ()
 
 CYISignalHandler (const CYISignalHandler &rSignalHandler)
 
virtual ~CYISignalHandler ()
 
CYISignalHandleroperator= (const CYISignalHandler &rSignalHandler)
 
void MoveToThread (CYIThread *pThread)
 This function allows the user to override the default thread affinity to any CYIThread that may or may not be running. More...
 
CYIThreadHandle GetThreadAffinity () const
 
void SetThreadAffinity (const CYIThreadHandle &rThreadAffinity)
 
virtual bool IsConnected () const
 
virtual bool IsConnected (const CYISignalBase &rSignal) const
 
void Disconnect (CYISignalBase &rSignal)
 
void DisconnectFromAllSignals ()
 
- Public Member Functions inherited from CYIThread::Listener
 Listener ()
 
virtual ~Listener ()
 
virtual void OnThreadStarted (CYIThread *)
 
virtual void OnThreadTerminated (CYIThread *)
 
virtual void OnThreadFinished (CYIThread *)
 
- Public Member Functions inherited from CYIScriptableRTTIObject
 CYIScriptableRTTIObject ()
 
virtual ~CYIScriptableRTTIObject ()
 
virtual const CYIRuntimeTypeInfoGetRuntimeTypeInfoForScriptObject () const override
 
- Public Member Functions inherited from CYIScriptableObject
 CYIScriptableObject ()
 
 CYIScriptableObject (const CYIScriptableObject &other)
 
CYIScriptableObjectoperator= (const CYIScriptableObject &other)
 
virtual ~CYIScriptableObject ()
 
CYIBindingImplementationGetBindingImplementation () const
 
void SetBindingImplementation (CYIBindingImplementation *pBindingImplementation)
 

Public Attributes

CYISignal< CYIAbstractTimeline * > ChildTimelineCompleted
 called whenever execution of one of the contained timelines completes normally More...
 
- Public Attributes inherited from CYIAbstractTimeline
CYISignal Playing
 called whenever the timeline starts playing (from any position) More...
 
CYISignal Paused
 called whenever the timeline stops playing, including if the timeline execution completes normally More...
 
CYISignal Aborted
 called when the timeline execution is aborted by the Abort() function More...
 
CYISignal Started
 called when playback of the timeline is initiated by one of the Start() functions More...
 
CYISignal Completed
 called when playback of the timeline completes normally (or when the Finish() function is called) More...
 
CYISignal PlayingForward
 same as Playing, but triggered only when direction is forward More...
 
CYISignal PlayingReverse
 same as Playing, but triggered only when direction is reverse More...
 
CYISignal PausedForward
 same as Paused, but triggered only when direction is forward More...
 
CYISignal PausedReverse
 same as Paused, but triggered only when direction is reverse More...
 
CYISignal StartedForward
 same as Started, but triggered only when direction is forward More...
 
CYISignal StartedReverse
 same as Started, but triggered only when direction is reverse More...
 
CYISignal CompletedForward
 same as Completed, but triggered only when direction is forward More...
 
CYISignal CompletedReverse
 same as Completed, but triggered only when direction is reverse More...
 

Protected Member Functions

 CYITimelineGroup (CYITimelineGroupPriv *pPriv)
 
- Protected Member Functions inherited from CYIAbstractTimeline
 CYIAbstractTimeline (CYIAbstractTimelinePriv *pPriv)
 
- Protected Member Functions inherited from CYIScriptableRTTIObject
virtual std::pair< const CYIRuntimeTypeInfo *, const void * > GetRuntimeTypeInfoWithObject () const =0
 

Additional Inherited Members

- Public Types inherited from CYIAbstractTimeline
enum  YI_FRAME_MODE {
  YI_ABSOLUTE,
  YI_RELATIVE
}
 
enum  STATUS {
  STOPPED,
  PLAYING
}
 
enum  DIRECTION {
  FORWARD,
  REVERSE
}
 
- Protected Attributes inherited from CYIAbstractTimeline
CYIAbstractTimelinePriv * m_pPriv
 

Constructor & Destructor Documentation

virtual CYITimelineGroup::~CYITimelineGroup ( )
virtual
CYITimelineGroup::CYITimelineGroup ( CYITimelineGroupPriv *  pPriv)
protected

Member Function Documentation

void CYITimelineGroup::AddTimeline ( CYIAbstractTimeline pTimeline)

Adds pTimeline to the group in the default way. For CYISerialTimelineGroup, this has the same effect as calling CYISerialTimelineGroup::AddTimelineToEnd. For CYIParallelTimelineGroup, this adds pTimeline with no offset.

void CYITimelineGroup::AddTimelineWithOffset ( CYIAbstractTimeline pTimeline,
uint64_t  uMillis 
)

Adds pTimeline to the group with an offset in the default way. For CYISerialTimelineGroup, this has the same effect as calling CYISerialTimelineGroup::AddTimelineToEndWithOffset. For CYIParallelTimelineGroup, this adds a timeline with an offset of uMillis.

uint32_t CYITimelineGroup::GetTimelineCount ( ) const

Returns the number of immediate children.

uint64_t CYITimelineGroup::GetTimelineOffset ( CYIAbstractTimeline pTimeline,
CYIAbstractTimeline::DIRECTION  eDirection = CYIAbstractTimeline::FORWARD 
) const

Returns the offset of child timeline pTimeline. If pTimeline is not a child of this timeline group, 0 is returned. Specify eDirection as CYIAbstractTimeline::REVERSE to obtain the offset from the end this offset is used when the group is playing in reverse.

Note
The offset for the reverse direction is a calculated offset, it is the difference between the group end time and pTimeline's total time plus offset.
This function runs in O(n) time.
std::vector<CYIAbstractTimeline*> CYITimelineGroup::GetTimelines ( ) const

Returns the immediate children of this timeline group.

std::vector<std::pair<CYIAbstractTimeline *, uint64_t> > CYITimelineGroup::GetTimelinesWithOffsets ( CYIAbstractTimeline::DIRECTION  eDirection = CYIAbstractTimeline::FORWARD) const

Returns the immediate children of this timeline group, along with the offsets for each timeline.

See also
GetTimelineOffset
void CYITimelineGroup::RemoveAllTimelines ( )
void CYITimelineGroup::RemoveTimeline ( CYIAbstractTimeline pTimeline)

Finds pTimeline among the children of this group and removes it.

void CYITimelineGroup::RemoveTimelinesIf ( const std::function< bool(CYIAbstractTimeline *)> &  predicate)

Removes from this group all timelines for which predicate returns true.

void CYITimelineGroup::UpdateOffsetOfTimeline ( const CYIAbstractTimeline pTimeline,
uint64_t  uMillis 
)

Finds pTimeline among the children of this group and changes the offset of pTimeline to uMillis. If pTimeline is not found, there is no effect.

Member Data Documentation

CYISignal<CYIAbstractTimeline*> CYITimelineGroup::ChildTimelineCompleted

called whenever execution of one of the contained timelines completes normally


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