Panda3D
|
This table records data about a list of animations for a particular model, such as number of frames and frame rate. More...
#include "animPreloadTable.h"
Classes | |
class | AnimRecord |
Public Member Functions | |
void | add_anim (const string &basename, PN_stdfloat base_frame_rate, int num_frames) |
Adds a new animation record to the table. | |
void | add_anims_from (const AnimPreloadTable *other) |
Copies the animation records from the other table into this one. | |
void | clear_anims () |
Removes all animation records from the table. | |
int | find_anim (const string &basename) const |
Returns the index number in the table of the animation record with the indicated name, or -1 if the name is not present. | |
virtual TypeHandle | force_init_type () |
PN_stdfloat | get_base_frame_rate (int n) const |
Returns the frame rate stored for the nth animation record. | |
string | get_basename (int n) const |
Returns the basename stored for the nth animation record. | |
int | get_num_anims () const |
Returns the number of animation records in the table. | |
int | get_num_frames (int n) const |
Returns the number of frames stored for the nth animation record. | |
virtual TypeHandle | get_type () const |
virtual void | output (ostream &out) const |
void | remove_anim (int n) |
Removes the nth animation records from the table. | |
virtual void | write (ostream &out, int indent_level) const |
virtual void | write_datagram (BamWriter *manager, Datagram &dg) |
Function to write the important information in the particular object to a Datagram. | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
static TypedWritable * | make_from_bam (const FactoryParams ¶ms) |
Factory method to generate an AnimPreloadTable object. | |
static void | register_with_read_factory () |
Factory method to generate an AnimPreloadTable object. | |
Protected Member Functions | |
void | fillin (DatagramIterator &scan, BamReader *manager) |
Function that reads out of the datagram (or asks manager to read) all of the data that is needed to re-create this object and stores it in the appropiate place. | |
virtual | PT (CopyOnWriteObject) make_cow_copy() |
This table records data about a list of animations for a particular model, such as number of frames and frame rate.
It's used for implementating asynchronous binding.
This table is normally built by an offline tool, such as egg-optchar.
Definition at line 39 of file animPreloadTable.h.
void AnimPreloadTable::add_anim | ( | const string & | basename, |
PN_stdfloat | base_frame_rate, | ||
int | num_frames | ||
) |
Adds a new animation record to the table.
If there is already a record of this name, no operation is performed (the original record is unchanged). See find_anim(). This will invalidate existing index numbers.
Definition at line 119 of file animPreloadTable.cxx.
References ordered_vector< Key, Compare >::push_back().
void AnimPreloadTable::add_anims_from | ( | const AnimPreloadTable * | other | ) |
Copies the animation records from the other table into this one.
If a given record name exists in both tables, the record in this one supercedes.
Definition at line 137 of file animPreloadTable.cxx.
References ordered_vector< Key, Compare >::begin(), ordered_vector< Key, Compare >::end(), ordered_vector< Key, Compare >::push_back(), and ordered_vector< Key, Compare >::size().
void AnimPreloadTable::clear_anims | ( | ) |
Removes all animation records from the table.
Definition at line 92 of file animPreloadTable.cxx.
References ordered_vector< Key, Compare >::clear().
void AnimPreloadTable::fillin | ( | DatagramIterator & | scan, |
BamReader * | manager | ||
) | [protected, virtual] |
Function that reads out of the datagram (or asks manager to read) all of the data that is needed to re-create this object and stores it in the appropiate place.
Reimplemented from TypedWritable.
Definition at line 231 of file animPreloadTable.cxx.
References DatagramIterator::get_int32(), DatagramIterator::get_stdfloat(), DatagramIterator::get_string(), DatagramIterator::get_uint16(), and ordered_vector< Key, Compare >::push_back().
Referenced by make_from_bam().
int AnimPreloadTable::find_anim | ( | const string & | basename | ) | const |
Returns the index number in the table of the animation record with the indicated name, or -1 if the name is not present.
By convention, the basename is the filename of the egg or bam file, without the directory part and without the extension. That is, it is Filename::get_basename_wo_extension().
Definition at line 75 of file animPreloadTable.cxx.
References ordered_vector< Key, Compare >::begin(), and ordered_vector< Key, Compare >::end().
PN_stdfloat AnimPreloadTable::get_base_frame_rate | ( | int | n | ) | const [inline] |
Returns the frame rate stored for the nth animation record.
Definition at line 55 of file animPreloadTable.I.
References ordered_vector< Key, Compare >::size().
string AnimPreloadTable::get_basename | ( | int | n | ) | const [inline] |
Returns the basename stored for the nth animation record.
See find_anim().
Definition at line 42 of file animPreloadTable.I.
References ordered_vector< Key, Compare >::size().
int AnimPreloadTable::get_num_anims | ( | ) | const |
Returns the number of animation records in the table.
Definition at line 60 of file animPreloadTable.cxx.
References ordered_vector< Key, Compare >::size().
int AnimPreloadTable::get_num_frames | ( | int | n | ) | const [inline] |
Returns the number of frames stored for the nth animation record.
Definition at line 68 of file animPreloadTable.I.
References ordered_vector< Key, Compare >::size().
TypedWritable * AnimPreloadTable::make_from_bam | ( | const FactoryParams & | params | ) | [static] |
Factory method to generate an AnimPreloadTable object.
Definition at line 212 of file animPreloadTable.cxx.
References fillin().
Referenced by register_with_read_factory().
void AnimPreloadTable::register_with_read_factory | ( | ) | [static] |
Factory method to generate an AnimPreloadTable object.
Definition at line 182 of file animPreloadTable.cxx.
References BamReader::get_factory(), make_from_bam(), and Factory< Type >::register_factory().
void AnimPreloadTable::remove_anim | ( | int | n | ) |
Removes the nth animation records from the table.
This renumbers indexes for following animations.
Definition at line 104 of file animPreloadTable.cxx.
References ordered_vector< Key, Compare >::begin(), and ordered_vector< Key, Compare >::size().
Function to write the important information in the particular object to a Datagram.
Reimplemented from TypedWritable.
Definition at line 193 of file animPreloadTable.cxx.
References Datagram::add_int32(), Datagram::add_stdfloat(), Datagram::add_string(), Datagram::add_uint16(), ordered_vector< Key, Compare >::begin(), ordered_vector< Key, Compare >::end(), and ordered_vector< Key, Compare >::size().