Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

AnimControl Class Reference

#include <animControl.h>

Inheritance diagram for AnimControl:

ReferenceCount List of all members.

Public Member Functions

 AnimControl (PartBundle *part, AnimBundle *anim, int channel_index)
void play (const CPT_Event &stop_event=NULL)
void play (int from, int to, const CPT_Event &stop_event=NULL)
void loop (bool restart)
void loop (bool restart, int from, int to)
void pingpong (bool restart, int from, int to)
void stop ()
void pose (int frame)
void add_event (int frame, const CPT_Event &event)
int remove_event (const string &event_name)
void remove_all_events ()
INLINE void set_play_rate (double play_rate)
INLINE double get_play_rate () const
INLINE double get_frame_rate () const
INLINE int get_frame () const
INLINE int get_num_frames () const
INLINE bool is_playing () const
PartBundleget_part () const
INLINE AnimBundleget_anim () const
void advance_time (double time)
bool channel_has_changed (AnimChannelBase *channel) const
void mark_channels ()
INLINE int get_channel_index () const
void output (ostream &out) const

Static Public Member Functions

TypeHandle get_class_type ()
void init_type ()

Public Attributes

PUBLISHED __pad0__: ~AnimControl()

Private Types

typedef pmultimap< int, ActionActions
enum  ActionType {
  AT_event, AT_stop, AT_jump, AT_forward,
  AT_backward
}

Private Member Functions

void set_frame (double frame)
bool do_actions_forward (int from, int to)
bool do_actions_backward (int from, int to)
void do_action (int frame, const Action &action, int &sequence_frame, const Action *&sequence_action)
void do_sequence_action (int frame, const Action &action)
 PT (PartGroup) _part
 PT (AnimBundle) _anim

Static Private Member Functions

void insert_event_action (Actions &actions, int frame, const CPT_Event &event)
void insert_stop_action (Actions &actions, int frame)
void insert_jump_action (Actions &actions, int frame, int jump_to)
void insert_forward_action (Actions &actions, int frame)
void insert_backward_action (Actions &actions, int frame)

Private Attributes

Actions _actions
Actions _user_actions
int _channel_index
double _play_rate
double _frame
double _as_of_time
bool _playing
int _marked_frame

Static Private Attributes

TypeHandle _type_handle

Friends

class AnimControl::Action
ostream & operator<< (ostream &, const AnimControl::Action &)

Member Typedef Documentation

typedef pmultimap<int, Action> AnimControl::Actions [private]
 

Definition at line 115 of file animControl.h.

Referenced by remove_event().


Member Enumeration Documentation

enum AnimControl::ActionType [private]
 

Enumeration values:
AT_event 
AT_stop 
AT_jump 
AT_forward 
AT_backward 

Definition at line 93 of file animControl.h.


Constructor & Destructor Documentation

AnimControl::AnimControl PartBundle part,
AnimBundle anim,
int  channel_index
 

Definition at line 37 of file animControl.cxx.

References _as_of_time, _channel_index, _frame, _marked_frame, _play_rate, _playing, and get_class_type().


Member Function Documentation

void AnimControl::add_event int  frame,
const CPT_Event event
 

Definition at line 283 of file animControl.cxx.

References _actions, _user_actions, and insert_event_action().

void AnimControl::advance_time double  time  ) 
 

Definition at line 378 of file animControl.cxx.

References _as_of_time, _frame, _playing, cfloor(), do_actions_backward(), do_actions_forward(), get_frame(), get_frame_rate(), get_num_frames(), and num_frames.

Referenced by PartBundle::advance_time().

bool AnimControl::channel_has_changed AnimChannelBase channel  )  const
 

Definition at line 439 of file animControl.cxx.

References _marked_frame, get_frame(), and AnimChannelBase::has_changed().

Referenced by MovingPartBase::do_update().

void AnimControl::do_action int  frame,
const Action action,
int &  sequence_frame,
const Action *&  sequence_action
[private]
 

Definition at line 679 of file animControl.cxx.

References _play_rate, AnimControl::Action::_type, AT_backward, AT_event, AT_forward, AT_jump, AT_stop, and throw_event().

Referenced by do_actions_backward(), and do_actions_forward().

bool AnimControl::do_actions_backward int  from,
int  to
[private]
 

Definition at line 628 of file animControl.cxx.

References _actions, do_action(), and do_sequence_action().

Referenced by advance_time().

bool AnimControl::do_actions_forward int  from,
int  to
[private]
 

Definition at line 582 of file animControl.cxx.

References _actions, do_action(), and do_sequence_action().

Referenced by advance_time(), and set_frame().

void AnimControl::do_sequence_action int  frame,
const Action action
[private]
 

Definition at line 726 of file animControl.cxx.

References AnimControl::Action::_jump_to, _play_rate, AnimControl::Action::_type, AT_backward, AT_event, AT_forward, AT_jump, AT_stop, set_frame(), and stop().

Referenced by do_actions_backward(), and do_actions_forward().

INLINE AnimBundle* AnimControl::get_anim  )  const
 

Referenced by output().

INLINE int AnimControl::get_channel_index  )  const
 

Referenced by MovingPartBase::do_update(), MovingPartScalar::get_blend_value(), and MovingPartMatrix::get_blend_value().

TypeHandle AnimControl::get_class_type void   )  [inline, static]
 

Reimplemented from ReferenceCount.

Definition at line 157 of file animControl.h.

Referenced by AnimControl().

INLINE int AnimControl::get_frame  )  const
 

Referenced by advance_time(), channel_has_changed(), MovingPartScalar::get_blend_value(), MovingPartMatrix::get_blend_value(), mark_channels(), and set_frame().

INLINE double AnimControl::get_frame_rate  )  const
 

Referenced by advance_time().

INLINE int AnimControl::get_num_frames  )  const
 

Referenced by advance_time(), loop(), pingpong(), play(), and pose().

PartBundle * AnimControl::get_part  )  const
 

Definition at line 361 of file animControl.cxx.

References DCAST.

Referenced by PartBundle::control_activated(), PartBundle::get_control_effect(), loop(), output(), pingpong(), play(), pose(), and PartBundle::set_control_effect().

INLINE double AnimControl::get_play_rate  )  const
 

Referenced by loop(), and play().

void AnimControl::init_type void   )  [inline, static]
 

Reimplemented from ReferenceCount.

Definition at line 160 of file animControl.h.

References ReferenceCount::get_class_type(), ReferenceCount::init_type(), and register_type().

Referenced by ConfigureFn().

void AnimControl::insert_backward_action Actions actions,
int  frame
[static, private]
 

Definition at line 550 of file animControl.cxx.

References AnimControl::Action::_type, and AT_backward.

Referenced by pingpong().

void AnimControl::insert_event_action Actions actions,
int  frame,
const CPT_Event event
[static, private]
 

Definition at line 486 of file animControl.cxx.

References AnimControl::Action::_event, AnimControl::Action::_type, and AT_event.

Referenced by add_event(), and play().

void AnimControl::insert_forward_action Actions actions,
int  frame
[static, private]
 

Definition at line 535 of file animControl.cxx.

References AnimControl::Action::_type, and AT_forward.

Referenced by pingpong().

void AnimControl::insert_jump_action Actions actions,
int  frame,
int  jump_to
[static, private]
 

Definition at line 519 of file animControl.cxx.

References AnimControl::Action::_jump_to, AnimControl::Action::_type, and AT_jump.

Referenced by loop().

void AnimControl::insert_stop_action Actions actions,
int  frame
[static, private]
 

Definition at line 502 of file animControl.cxx.

References AnimControl::Action::_type, and AT_stop.

Referenced by play().

INLINE bool AnimControl::is_playing  )  const
 

void AnimControl::loop bool  restart,
int  from,
int  to
 

Definition at line 148 of file animControl.cxx.

References _actions, _as_of_time, _playing, _user_actions, PartBundle::control_activated(), ClockObject::get_frame_time(), ClockObject::get_global_clock(), get_num_frames(), get_part(), get_play_rate(), insert_jump_action(), and set_frame().

void AnimControl::loop bool  restart  ) 
 

Definition at line 120 of file animControl.cxx.

References _actions, _as_of_time, _playing, _user_actions, PartBundle::control_activated(), ClockObject::get_frame_time(), ClockObject::get_global_clock(), get_num_frames(), get_part(), get_play_rate(), and set_frame().

void AnimControl::mark_channels  ) 
 

Definition at line 461 of file animControl.cxx.

References _marked_frame, and get_frame().

Referenced by PartBundle::force_update(), and PartBundle::update().

void AnimControl::output ostream &  out  )  const
 

Definition at line 471 of file animControl.cxx.

References get_anim(), and get_part().

Referenced by operator<<().

void AnimControl::pingpong bool  restart,
int  from,
int  to
 

Definition at line 213 of file animControl.cxx.

References _actions, _as_of_time, _playing, _user_actions, PartBundle::control_activated(), ClockObject::get_frame_time(), ClockObject::get_global_clock(), get_num_frames(), get_part(), insert_backward_action(), insert_forward_action(), pose(), and set_frame().

void AnimControl::play int  from,
int  to,
const CPT_Event stop_event = NULL
 

Definition at line 94 of file animControl.cxx.

References _actions, _as_of_time, _playing, _user_actions, PartBundle::control_activated(), ClockObject::get_frame_time(), ClockObject::get_global_clock(), get_num_frames(), get_part(), insert_event_action(), insert_stop_action(), and set_frame().

void AnimControl::play const CPT_Event stop_event = NULL  ) 
 

Definition at line 72 of file animControl.cxx.

References get_num_frames(), and get_play_rate().

void AnimControl::pose int  frame  ) 
 

Definition at line 256 of file animControl.cxx.

References _actions, _as_of_time, _playing, _user_actions, cfloor(), PartBundle::control_activated(), ClockObject::get_frame_time(), ClockObject::get_global_clock(), get_num_frames(), get_part(), num_frames, and set_frame().

Referenced by pingpong().

AnimControl::PT AnimBundle   )  [private]
 

AnimControl::PT PartGroup   )  [private]
 

void AnimControl::remove_all_events  ) 
 

Definition at line 350 of file animControl.cxx.

References _user_actions.

int AnimControl::remove_event const string &  event_name  ) 
 

Definition at line 298 of file animControl.cxx.

References _actions, AnimControl::Action::_event, AnimControl::Action::_type, _user_actions, Actions, and AT_event.

void AnimControl::set_frame double  frame  )  [private]
 

Definition at line 564 of file animControl.cxx.

References _frame, do_actions_forward(), and get_frame().

Referenced by do_sequence_action(), loop(), pingpong(), play(), and pose().

INLINE void AnimControl::set_play_rate double  play_rate  ) 
 

void AnimControl::stop  ) 
 

Definition at line 245 of file animControl.cxx.

References _playing.

Referenced by PartBundle::clear_and_stop_except(), and do_sequence_action().


Friends And Related Function Documentation

friend class AnimControl::Action [friend]
 

Definition at line 170 of file animControl.h.

ostream& operator<< ostream &  out,
const AnimControl::Action action
[friend]
 

Definition at line 178 of file animControl.h.


Member Data Documentation

PUBLISHED AnimControl::__pad0__
 

Reimplemented from ReferenceCount.

Definition at line 52 of file animControl.h.

Actions AnimControl::_actions [private]
 

Definition at line 132 of file animControl.h.

Referenced by add_event(), do_actions_backward(), do_actions_forward(), loop(), pingpong(), play(), pose(), and remove_event().

double AnimControl::_as_of_time [private]
 

Definition at line 149 of file animControl.h.

Referenced by advance_time(), AnimControl(), loop(), pingpong(), play(), and pose().

int AnimControl::_channel_index [private]
 

Definition at line 140 of file animControl.h.

Referenced by AnimControl().

double AnimControl::_frame [private]
 

Definition at line 148 of file animControl.h.

Referenced by advance_time(), AnimControl(), and set_frame().

int AnimControl::_marked_frame [private]
 

Definition at line 154 of file animControl.h.

Referenced by AnimControl(), channel_has_changed(), and mark_channels().

double AnimControl::_play_rate [private]
 

Definition at line 142 of file animControl.h.

Referenced by AnimControl(), do_action(), and do_sequence_action().

bool AnimControl::_playing [private]
 

Definition at line 151 of file animControl.h.

Referenced by advance_time(), AnimControl(), loop(), pingpong(), play(), pose(), and stop().

TypeHandle AnimControl::_type_handle [static, private]
 

Reimplemented from ReferenceCount.

Definition at line 29 of file animControl.cxx.

Actions AnimControl::_user_actions [private]
 

Definition at line 133 of file animControl.h.

Referenced by add_event(), loop(), pingpong(), play(), pose(), remove_all_events(), and remove_event().


The documentation for this class was generated from the following files:
Generated on Fri Apr 18 00:11:18 2003 for Panda by doxygen1.3