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 millis)
 
size_t GetTimelineCount () const
 
std::vector< CYIAbstractTimeline * > GetTimelines () const
 
std::vector< std::pair< CYIAbstractTimeline *, uint64_t > > GetTimelinesWithOffsets (CYIAbstractTimeline::Direction direction=CYIAbstractTimeline::Direction::Forward) const
 
uint64_t GetTimelineOffset (CYIAbstractTimeline *pTimeline, CYIAbstractTimeline::Direction direction=CYIAbstractTimeline::Direction::Forward) const
 
void RemoveTimeline (CYIAbstractTimeline *pTimeline)
 
void RemoveAllTimelines ()
 
void RemoveTimelinesIf (const std::function< bool(CYIAbstractTimeline *)> &predicate)
 
void UpdateOffsetOfTimeline (const CYIAbstractTimeline *pTimeline, uint64_t millis)
 
- 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 percentage)
 
void SeekToTime (uint64_t millis)
 
void Abort ()
 
void SetDisablesInput (bool disablesInput)
 
void Track ()
 
void Untrack ()
 
void StartForward ()
 
void StartReverse ()
 
void ContinueForward ()
 
void ContinueReverse ()
 
void SetDirectionForward ()
 
void SetDirectionReverse ()
 
void SetFrameModes (FrameMode startFrameMode, FrameMode endFrameMode)
 
bool SetSourcePositions (CYISceneNode *pNode, const glm::vec3 &position)
 
bool ClearSourcePositions (CYISceneNode *pNode)
 
bool SetTargetPositions (CYISceneNode *pNode, const glm::vec3 &position)
 
bool ClearTargetPositions (CYISceneNode *pNode)
 
bool SetSourceScales (CYISceneNode *pNode, const glm::vec3 &scale)
 
bool ClearSourceScales (CYISceneNode *pNode)
 
void SetLooping (bool isLooping)
 
bool GetLooping () const
 
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 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 TimelineLooped
 called whenever a loop completes and the next loop starts 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 (std::unique_ptr< CYITimelineGroupPriv > pPriv)
 
- Protected Member Functions inherited from CYIAbstractTimeline
 CYIAbstractTimeline (std::unique_ptr< CYIAbstractTimelinePriv > pPriv)
 

Additional Inherited Members

- Public Types inherited from CYIAbstractTimeline
enum  FrameMode : uint8_t {
  FrameMode::Absolute,
  FrameMode::Relative
}
 
enum  Status : uint8_t {
  Status::Stopped,
  Status::Playing
}
 
enum  Direction : uint8_t {
  Direction::Forward,
  Direction::Reverse
}
 
- Protected Attributes inherited from CYIAbstractTimeline
std::unique_ptr< CYIAbstractTimelinePriv > m_pPriv
 

Constructor & Destructor Documentation

◆ ~CYITimelineGroup()

virtual CYITimelineGroup::~CYITimelineGroup ( )
virtual

◆ CYITimelineGroup()

CYITimelineGroup::CYITimelineGroup ( std::unique_ptr< CYITimelineGroupPriv >  pPriv)
protected

Member Function Documentation

◆ AddTimeline()

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.

◆ AddTimelineWithOffset()

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

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 millis.

◆ GetTimelineCount()

size_t CYITimelineGroup::GetTimelineCount ( ) const

Returns the number of immediate children.

◆ GetTimelineOffset()

uint64_t CYITimelineGroup::GetTimelineOffset ( CYIAbstractTimeline pTimeline,
CYIAbstractTimeline::Direction  direction = CYIAbstractTimeline::Direction::Forward 
) const

Returns the offset of child timeline pTimeline. If pTimeline is not a child of this timeline group, 0 is returned. Specify direction as CYIAbstractTimeline::Direction::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.

◆ GetTimelines()

std::vector<CYIAbstractTimeline *> CYITimelineGroup::GetTimelines ( ) const

Returns the immediate children of this timeline group.

◆ GetTimelinesWithOffsets()

std::vector<std::pair<CYIAbstractTimeline *, uint64_t> > CYITimelineGroup::GetTimelinesWithOffsets ( CYIAbstractTimeline::Direction  direction = CYIAbstractTimeline::Direction::Forward) const

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

See also
GetTimelineOffset

◆ RemoveAllTimelines()

void CYITimelineGroup::RemoveAllTimelines ( )

◆ RemoveTimeline()

void CYITimelineGroup::RemoveTimeline ( CYIAbstractTimeline pTimeline)

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

◆ RemoveTimelinesIf()

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

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

◆ UpdateOffsetOfTimeline()

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

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

Member Data Documentation

◆ ChildTimelineCompleted

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: