This is a named collection of AnimControl pointers. More...
#include "animControlCollection.h"
Public Member Functions | |
AnimControlCollection () | |
Returns the AnimControl associated with the given name, or NULL if no such control has been associated. More... | |
void | clear_anims () |
Disassociates all anims from this collection. More... | |
AnimControl * | find_anim (const std::string &name) const |
Returns the AnimControl associated with the given name, or NULL if no such control has been associated. More... | |
AnimControl * | get_anim (int n) const |
std::string | get_anim_name (int n) const |
int | get_frame (const std::string &anim_name) const |
Returns the current frame in the named animation, or 0 if the animation is not found. More... | |
int | get_frame () const |
Returns the current frame in the last-started animation. More... | |
int | get_num_anims () const |
int | get_num_frames (const std::string &anim_name) const |
Returns the total number of frames in the named animation, or 0 if the animation is not found. More... | |
int | get_num_frames () const |
Returns the total number of frames in the last-started animation. More... | |
bool | is_playing (const std::string &anim_name) const |
Returns true if the named animation is currently playing, false otherwise. More... | |
bool | is_playing () const |
Returns true if the last-started animation is currently playing, false otherwise. More... | |
bool | loop (const std::string &anim_name, bool restart) |
Starts the named animation looping. More... | |
bool | loop (const std::string &anim_name, bool restart, double from, double to) |
Starts the named animation looping. More... | |
void | loop_all (bool restart) |
Starts all animations looping. More... | |
void | loop_all (bool restart, double from, double to) |
Starts all animations looping. More... | |
void | output (std::ostream &out) const |
bool | play (const std::string &anim_name) |
Starts the named animation playing. More... | |
bool | play (const std::string &anim_name, double from, double to) |
Starts the named animation playing. More... | |
void | play_all () |
Starts all animations playing. More... | |
void | play_all (double from, double to) |
Starts all animations playing. More... | |
bool | pose (const std::string &anim_name, double frame) |
Sets to a particular frame in the named animation. More... | |
void | pose_all (double frame) |
Sets all animations to the indicated frame. More... | |
bool | stop (const std::string &anim_name) |
Stops the named animation. More... | |
bool | stop_all () |
Stops all currently playing animations. More... | |
void | store_anim (AnimControl *control, const std::string &name) |
Associates the given AnimControl with this collection under the given name. More... | |
bool | unbind_anim (const std::string &name) |
Removes the AnimControl associated with the given name, if any. More... | |
std::string | which_anim_playing () const |
Returns the name of the bound AnimControl currently playing, if any. More... | |
void | write (std::ostream &out) const |
Public Attributes | |
get_anim | |
Returns the nth AnimControl associated with this collection. More... | |
get_anim_name | |
Returns the name of the nth AnimControl associated with this collection. More... | |
get_num_anims | |
Returns the number of AnimControls associated with this collection. More... | |
This is a named collection of AnimControl pointers.
An AnimControl may be added to the collection by name. While an AnimControl is associated, its reference count is maintained; associating a new AnimControl with the same name will decrement the previous control's reference count (and possibly delete it, unbinding its animation).
Definition at line 33 of file animControlCollection.h.
AnimControlCollection::AnimControlCollection | ( | ) |
Returns the AnimControl associated with the given name, or NULL if no such control has been associated.
Definition at line 24 of file animControlCollection.cxx.
void AnimControlCollection::clear_anims | ( | ) |
Disassociates all anims from this collection.
Definition at line 146 of file animControlCollection.cxx.
AnimControl * AnimControlCollection::find_anim | ( | const std::string & | name | ) | const |
Returns the AnimControl associated with the given name, or NULL if no such control has been associated.
Definition at line 71 of file animControlCollection.cxx.
Referenced by get_frame(), get_num_frames(), is_playing(), loop(), play(), pose(), and stop().
|
inline |
Returns the current frame in the named animation, or 0 if the animation is not found.
Definition at line 103 of file animControlCollection.I.
References find_anim(), and AnimInterface::get_frame.
|
inline |
Returns the current frame in the last-started animation.
Definition at line 115 of file animControlCollection.I.
References AnimInterface::get_frame.
|
inline |
Returns the total number of frames in the named animation, or 0 if the animation is not found.
Definition at line 151 of file animControlCollection.I.
References find_anim(), and AnimInterface::get_num_frames.
|
inline |
Returns the total number of frames in the last-started animation.
Definition at line 163 of file animControlCollection.I.
References AnimInterface::get_num_frames.
|
inline |
Returns true if the named animation is currently playing, false otherwise.
Definition at line 126 of file animControlCollection.I.
References find_anim(), and AnimInterface::is_playing.
|
inline |
Returns true if the last-started animation is currently playing, false otherwise.
Definition at line 139 of file animControlCollection.I.
References AnimInterface::is_playing.
|
inline |
Starts the named animation looping.
Definition at line 46 of file animControlCollection.I.
References find_anim(), and AnimInterface::loop().
|
inline |
Starts the named animation looping.
Definition at line 60 of file animControlCollection.I.
References find_anim(), and AnimInterface::loop().
void AnimControlCollection::loop_all | ( | bool | restart | ) |
Starts all animations looping.
Definition at line 179 of file animControlCollection.cxx.
Referenced by WindowFramework::loop_animations(), and WindowFramework::next_anim_control().
void AnimControlCollection::loop_all | ( | bool | restart, |
double | from, | ||
double | to | ||
) |
Starts all animations looping.
Definition at line 191 of file animControlCollection.cxx.
|
inline |
Starts the named animation playing.
Definition at line 18 of file animControlCollection.I.
References find_anim(), and AnimInterface::play().
|
inline |
Starts the named animation playing.
Definition at line 32 of file animControlCollection.I.
References find_anim(), and AnimInterface::play().
void AnimControlCollection::play_all | ( | ) |
Starts all animations playing.
Definition at line 155 of file animControlCollection.cxx.
void AnimControlCollection::play_all | ( | double | from, |
double | to | ||
) |
Starts all animations playing.
Definition at line 167 of file animControlCollection.cxx.
|
inline |
Sets to a particular frame in the named animation.
Definition at line 88 of file animControlCollection.I.
References find_anim(), and AnimInterface::pose().
void AnimControlCollection::pose_all | ( | double | frame | ) |
Sets all animations to the indicated frame.
Definition at line 221 of file animControlCollection.cxx.
|
inline |
Stops the named animation.
Definition at line 74 of file animControlCollection.I.
References find_anim(), and AnimInterface::stop().
bool AnimControlCollection::stop_all | ( | ) |
Stops all currently playing animations.
Returns true if any animations were stopped, false if none were playing.
Definition at line 204 of file animControlCollection.cxx.
void AnimControlCollection::store_anim | ( | AnimControl * | control, |
const std::string & | name | ||
) |
Associates the given AnimControl with this collection under the given name.
The AnimControl will remain associated until a new AnimControl is associated with the same name later, or until unbind_anim() is called with this name.
Definition at line 42 of file animControlCollection.cxx.
bool AnimControlCollection::unbind_anim | ( | const std::string & | name | ) |
Removes the AnimControl associated with the given name, if any.
Returns true if an AnimControl was removed, false if there was no AnimControl with the indicated name.
Definition at line 88 of file animControlCollection.cxx.
string AnimControlCollection::which_anim_playing | ( | ) | const |
Returns the name of the bound AnimControl currently playing, if any.
If more than one AnimControl is currently playing, returns all of the names separated by spaces.
Definition at line 235 of file animControlCollection.cxx.
AnimControl * AnimControlCollection::get_anim |
Returns the nth AnimControl associated with this collection.
Definition at line 45 of file animControlCollection.h.
string AnimControlCollection::get_anim_name |
Returns the name of the nth AnimControl associated with this collection.
Definition at line 46 of file animControlCollection.h.
int AnimControlCollection::get_num_anims |
Returns the number of AnimControls associated with this collection.
Definition at line 45 of file animControlCollection.h.
Referenced by WindowFramework::next_anim_control().