Antkeeper  0.0.1
Classes | Public Types | Public Member Functions | List of all members
animation_channel< T > Class Template Reference

Single channel in a keyframe animation. More...

#include <animation-channel.hpp>

Public Types

typedef std::tuple< float, T > keyframe
 Keyframe consisting of a time and a value. More...
 

Public Member Functions

 animation_channel (int id)
 Creates an animation channel. More...
 
 animation_channel ()
 Creates an animation channel. More...
 
 animation_channel (const animation_channel &other)
 Creates an animation channel. More...
 
animation_channeloperator= (const animation_channel &other)
 Assigns the contents of another channel to this channel. More...
 
void insert_keyframe (const keyframe &k)
 Adds a keyframe to the animation. More...
 
void remove_keyframes (float start, float end)
 Removes all keyframes on [start, end). More...
 
void remove_keyframes ()
 Removes all keyframes from the animation. More...
 
std::array< const keyframe *, 2 > find_keyframes (float position) const
 Finds the keyframes to the left and right of position. More...
 
std::list< keyframefind_keyframes (float start, float end) const
 Finds all the keyframes on [start, end). More...
 
int get_id () const
 Returns the ID of the animation channel. More...
 
float get_duration () const
 Returns the duration of the animation channel. More...
 

Detailed Description

template<typename T>
class animation_channel< T >

Single channel in a keyframe animation.

See also
animation

Definition at line 33 of file animation-channel.hpp.

Member Typedef Documentation

◆ keyframe

template<typename T >
typedef std::tuple<float, T> animation_channel< T >::keyframe

Keyframe consisting of a time and a value.

Definition at line 37 of file animation-channel.hpp.

Constructor & Destructor Documentation

◆ animation_channel() [1/3]

template<typename T >
animation_channel< T >::animation_channel ( int  id)
explicit

Creates an animation channel.

Parameters
idID of the channel.

Definition at line 110 of file animation-channel.hpp.

◆ animation_channel() [2/3]

template<typename T >
animation_channel< T >::animation_channel

Creates an animation channel.

Definition at line 116 of file animation-channel.hpp.

◆ animation_channel() [3/3]

template<typename T >
animation_channel< T >::animation_channel ( const animation_channel< T > &  other)

Creates an animation channel.

Definition at line 121 of file animation-channel.hpp.

Member Function Documentation

◆ find_keyframes() [1/2]

template<typename T >
std::array< const typename animation_channel< T >::keyframe *, 2 > animation_channel< T >::find_keyframes ( float  position) const

Finds the keyframes to the left and right of position.

Parameters
positionPosition in time.
Returns
Array containing the the keyframes on the left and right of position.

Definition at line 155 of file animation-channel.hpp.

◆ find_keyframes() [2/2]

template<typename T >
std::list< typename animation_channel< T >::keyframe > animation_channel< T >::find_keyframes ( float  start,
float  end 
) const

Finds all the keyframes on [start, end).

Parameters
startStarting position in time (inclusive).
endEnding position in time (non-inclusive).
Returns
All keyframes on [start, end).

Definition at line 172 of file animation-channel.hpp.

◆ get_duration()

template<typename T >
float animation_channel< T >::get_duration

Returns the duration of the animation channel.

Definition at line 193 of file animation-channel.hpp.

◆ get_id()

template<typename T >
int animation_channel< T >::get_id
inline

Returns the ID of the animation channel.

Definition at line 187 of file animation-channel.hpp.

◆ insert_keyframe()

template<typename T >
void animation_channel< T >::insert_keyframe ( const keyframe k)

Adds a keyframe to the animation.

Parameters
kKeyframe to add.

Definition at line 135 of file animation-channel.hpp.

◆ operator=()

template<typename T >
animation_channel< T > & animation_channel< T >::operator= ( const animation_channel< T > &  other)

Assigns the contents of another channel to this channel.

Definition at line 127 of file animation-channel.hpp.

◆ remove_keyframes() [1/2]

template<typename T >
void animation_channel< T >::remove_keyframes

Removes all keyframes from the animation.

Definition at line 149 of file animation-channel.hpp.

◆ remove_keyframes() [2/2]

template<typename T >
void animation_channel< T >::remove_keyframes ( float  start,
float  end 
)

Removes all keyframes on [start, end).

Parameters
startStarting position in time (inclusive).
endEnding position in time (non-inclusive).

Definition at line 141 of file animation-channel.hpp.


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