Panda3D
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions
AnimPreloadTable Class Reference

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"

Inheritance diagram for AnimPreloadTable:
CopyOnWriteObject CachedTypedWritableReferenceCount TypedWritableReferenceCount TypedWritable ReferenceCount TypedObject MemoryBase MemoryBase

List of all members.

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 TypedWritablemake_from_bam (const FactoryParams &params)
 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()

Detailed Description

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.


Member Function Documentation

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().

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(), ordered_vector< Key, Compare >::reserve(), and ordered_vector< Key, Compare >::size().

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(), ordered_vector< Key, Compare >::push_back(), and ordered_vector< Key, Compare >::reserve().

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().

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().

Factory method to generate an AnimPreloadTable object.

Definition at line 212 of file animPreloadTable.cxx.

References fillin().

Referenced by register_with_read_factory().

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().

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().

void AnimPreloadTable::write_datagram ( BamWriter manager,
Datagram dg 
) [virtual]

The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations