#include <animControlCollection.h>
Inheritance diagram for AnimControlCollection:
Public Member Functions | |
AnimControlCollection () | |
Returns the AnimControl associated with the given name, or NULL if no such control has been associated. | |
~AnimControlCollection () | |
void | store_anim (AnimControl *control, const string &name) |
Associates the given AnimControl with this collection under the given name. | |
AnimControl * | find_anim (const string &name) const |
Returns the AnimControl associated with the given name, or NULL if no such control has been associated. | |
bool | unbind_anim (const string &name) |
Removes the AnimControl associated with the given name, if any. | |
int | get_num_anims () const |
Returns the number of AnimControls associated with this collection. | |
void | clear_anims () |
Disassociates all anims from this collection. | |
void | set_stop_event (const CPT_Event &stop_event) |
Sets the event that will be thrown when the next animation that is played eventually comes to a stop. | |
void | clear_stop_event () |
Indicates that the next-started animation will not throw a stop event when it comes to a stop. | |
bool | has_stop_event () const |
Returns true if a stop event has been established via set_stop_event(). | |
CPT_Event | get_stop_event () const |
Returns the event that has been established via set_stop_event(). | |
bool | play (const string &anim_name) |
Starts the named animation playing. | |
bool | play (const string &anim_name, int from, int to) |
Starts the named animation playing. | |
bool | loop (const string &anim_name, bool restart) |
Starts the named animation looping. | |
bool | loop (const string &anim_name, bool restart, int from, int to) |
Starts the named animation looping. | |
bool | stop (const string &anim_name) |
Stops the named animation. | |
bool | pose (const string &anim_name, int frame) |
Sets to a particular frame in the named animation. | |
void | play_all () |
Starts all animations playing. | |
void | play_all (int from, int to) |
Starts all animations playing. | |
void | loop_all (bool restart) |
Starts all animations looping. | |
void | loop_all (bool restart, int from, int to) |
Starts all animations looping. | |
bool | stop_all () |
Stops all currently playing animations. | |
void | pose_all (int frame) |
Sets all animations to the indicated frame. | |
int | get_frame (const string &anim_name) const |
Returns the current frame in the named animation, or 0 if the animation is not found. | |
int | get_frame () const |
Returns the current frame in the last-started animation. | |
int | get_num_frames (const string &anim_name) const |
Returns the total number of frames in the named animation, or 0 if the animation is not found. | |
bool | is_playing (const string &anim_name) const |
Returns true if the named animation is currently playing, false otherwise. | |
bool | is_playing () const |
Returns true if the last-started animation is currently playing, false otherwise. | |
string | which_anim_playing () const |
Returns the name of the bound AnimControl currently playing, if any. | |
Private Types | |
typedef pmap< string, PointerTo< AnimControl > > | Controls |
Private Attributes | |
Controls | _controls |
CPT_Event | _stop_event |
AnimControl * | _last_started_control |
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 54 of file animControlCollection.h.
|
Definition at line 100 of file animControlCollection.h. |
|
Returns the AnimControl associated with the given name, or NULL if no such control has been associated.
Definition at line 37 of file animControlCollection.cxx. |
|
Definition at line 49 of file animControlCollection.cxx. References _controls, _last_started_control, and NULL. |
|
Disassociates all anims from this collection.
Definition at line 151 of file animControlCollection.cxx. References _controls. |
|
Indicates that the next-started animation will not throw a stop event when it comes to a stop. This does not affect any already-started animations. Definition at line 55 of file animControlCollection.I. References _stop_event, INLINE, and NULL. |
|
Returns the AnimControl associated with the given name, or NULL if no such control has been associated.
Definition at line 92 of file animControlCollection.cxx. Referenced by get_frame(), has_stop_event(), loop(), and play(). |
|
Returns the current frame in the last-started animation.
Definition at line 247 of file animControlCollection.I. |
|
Returns the current frame in the named animation, or 0 if the animation is not found.
Definition at line 228 of file animControlCollection.I. References find_anim(), AnimControl::get_num_frames(), INLINE, and NULL. |
|
Returns the number of AnimControls associated with this collection.
Definition at line 138 of file animControlCollection.cxx. References _controls. |
|
Returns the total number of frames in the named animation, or 0 if the animation is not found.
Definition at line 302 of file animControlCollection.I. |
|
Returns the event that has been established via set_stop_event(). This is the event that will be thrown by animations that are started in the future when they stop. However, this may or may not be associated with any currently-playing animations. Definition at line 99 of file animControlCollection.I. |
|
Returns true if a stop event has been established via set_stop_event(). If true, this means that animations that are to be started in the future will throw this event when they stop. However, it does not necessarily mean that the currently-playing animation will throw this event. Definition at line 78 of file animControlCollection.I. References _last_started_control, _stop_event, find_anim(), INLINE, NULL, and AnimControl::play(). |
|
Returns true if the last-started animation is currently playing, false otherwise.
Definition at line 284 of file animControlCollection.I. |
|
Returns true if the named animation is currently playing, false otherwise.
Definition at line 265 of file animControlCollection.I. |
|
Starts the named animation looping.
Definition at line 169 of file animControlCollection.I. References find_anim(), AnimControl::get_frame(), INLINE, and NULL. |
|
Starts the named animation looping.
Definition at line 150 of file animControlCollection.I. |
|
Starts all animations looping.
Definition at line 212 of file animControlCollection.cxx. References _controls. |
|
Starts all animations looping.
Definition at line 196 of file animControlCollection.cxx. References _controls. |
|
Starts the named animation playing.
Definition at line 131 of file animControlCollection.I. |
|
Starts the named animation playing.
Definition at line 112 of file animControlCollection.I. References _last_started_control, find_anim(), AnimControl::loop(), and NULL. |
|
Starts all animations playing.
Definition at line 180 of file animControlCollection.cxx. References _controls. |
|
Starts all animations playing.
Definition at line 164 of file animControlCollection.cxx. References _controls. |
|
Sets to a particular frame in the named animation.
Definition at line 207 of file animControlCollection.I. References NULL. |
|
Sets all animations to the indicated frame.
Definition at line 254 of file animControlCollection.cxx. |
|
Sets the event that will be thrown when the next animation that is played eventually comes to a stop. Setting this does not affect any stop event that is pending from a previously-started animation. Definition at line 38 of file animControlCollection.I. References _stop_event, INLINE, and NULL. |
|
Stops the named animation.
Definition at line 188 of file animControlCollection.I. References _last_started_control, AnimControl::get_frame(), INLINE, and NULL. |
|
Stops all currently playing animations. Returns true if any animations were stopped, false if none were playing. Definition at line 232 of file animControlCollection.cxx. |
|
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 69 of file animControlCollection.cxx. References _controls, and NULL. Referenced by PartBundle::write(). |
|
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 115 of file animControlCollection.cxx. References _controls. |
|
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 276 of file animControlCollection.cxx. |
|
Definition at line 101 of file animControlCollection.h. Referenced by clear_anims(), get_num_anims(), loop_all(), play_all(), store_anim(), unbind_anim(), and ~AnimControlCollection(). |
|
Definition at line 103 of file animControlCollection.h. Referenced by has_stop_event(), play(), stop(), and ~AnimControlCollection(). |
|
Definition at line 102 of file animControlCollection.h. Referenced by clear_stop_event(), has_stop_event(), and set_stop_event(). |