Panda3D
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

AnimChannelScalarTable Class Reference

An animation channel that issues a scalar each frame, read from a table such as might have been read from an egg file. More...

#include "animChannelScalarTable.h"

Inheritance diagram for AnimChannelScalarTable:
AnimChannel< SwitchType > AnimChannelBase AnimGroup TypedWritableReferenceCount Namable TypedWritable ReferenceCount MemoryBase TypedObject MemoryBase MemoryBase

List of all members.

Public Member Functions

 AnimChannelScalarTable (AnimGroup *parent, const string &name)
void clear_table ()
 Empties the data table.
virtual TypeHandle force_init_type ()
CPTA_stdfloat get_table () const
 Returns a pointer to the table's data, if it exists, or NULL if it does not.
virtual TypeHandle get_type () const
virtual void get_value (int frame, PN_stdfloat &value)
 Gets the value of the channel at the indicated frame.
virtual bool has_changed (int last_frame, double last_frac, int this_frame, double this_frac)
 Returns true if the value has changed since the last call to has_changed().
bool has_table () const
 Returns true if the data table has been assigned.
void set_table (const CPTA_stdfloat &table)
 Assigns the data table.
virtual void write (ostream &out, int indent_level) const
 Writes a brief description of the table and all of its descendants.
virtual void write_datagram (BamWriter *manager, Datagram &me)
 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_AnimChannelScalarTable (const FactoryParams &params)
 Factory method to generate a AnimChannelScalarTable object.
static void register_with_read_factory ()
 Factory method to generate a AnimChannelScalarTable object.

Protected Member Functions

 AnimChannelScalarTable (AnimGroup *parent, const AnimChannelScalarTable &copy)
 Creates a new AnimChannelScalarTable, just like this one, without copying any children.
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 AnimGroupmake_copy (AnimGroup *parent) const
 Returns a copy of this object, and attaches it to the indicated parent (which may be NULL only if this is an AnimBundle).

Protected Attributes

CPTA_stdfloat _table

Detailed Description

An animation channel that issues a scalar each frame, read from a table such as might have been read from an egg file.

Definition at line 31 of file animChannelScalarTable.h.


Constructor & Destructor Documentation

AnimChannelScalarTable::AnimChannelScalarTable ( AnimGroup parent,
const AnimChannelScalarTable copy 
) [protected]

Creates a new AnimChannelScalarTable, just like this one, without copying any children.

The new copy is added to the indicated parent. Intended to be called by make_copy() only.

Definition at line 47 of file animChannelScalarTable.cxx.


Member Function Documentation

void AnimChannelScalarTable::clear_table ( ) [inline]

Empties the data table.

Definition at line 44 of file animChannelScalarTable.I.

void AnimChannelScalarTable::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 AnimChannelBase.

Definition at line 282 of file animChannelScalarTable.cxx.

References DatagramIterator::get_bool(), BamReader::get_file_minor_ver(), DatagramIterator::get_stdfloat(), DatagramIterator::get_uint16(), DatagramIterator::get_uint8(), FFTCompressor::read_header(), and FFTCompressor::read_reals().

Referenced by make_AnimChannelScalarTable().

CPTA_stdfloat AnimChannelScalarTable::get_table ( ) const [inline]

Returns a pointer to the table's data, if it exists, or NULL if it does not.

Definition at line 23 of file animChannelScalarTable.I.

void AnimChannelScalarTable::get_value ( int  frame,
PN_stdfloat &  value 
) [virtual]

Gets the value of the channel at the indicated frame.

Definition at line 102 of file animChannelScalarTable.cxx.

bool AnimChannelScalarTable::has_changed ( int  last_frame,
double  last_frac,
int  this_frame,
double  this_frac 
) [virtual]

Returns true if the value has changed since the last call to has_changed().

last_frame is the frame number of the last call; this_frame is the current frame number.

Reimplemented from AnimChannelBase.

Definition at line 74 of file animChannelScalarTable.cxx.

bool AnimChannelScalarTable::has_table ( ) const [inline]

Returns true if the data table has been assigned.

Definition at line 33 of file animChannelScalarTable.I.

TypedWritable * AnimChannelScalarTable::make_AnimChannelScalarTable ( const FactoryParams params) [static]

Factory method to generate a AnimChannelScalarTable object.

Definition at line 352 of file animChannelScalarTable.cxx.

References fillin().

Referenced by register_with_read_factory().

AnimGroup * AnimChannelScalarTable::make_copy ( AnimGroup parent) const [protected, virtual]

Returns a copy of this object, and attaches it to the indicated parent (which may be NULL only if this is an AnimBundle).

Intended to be called by copy_subtree() only.

Reimplemented from AnimGroup.

Definition at line 159 of file animChannelScalarTable.cxx.

void AnimChannelScalarTable::register_with_read_factory ( ) [static]

Factory method to generate a AnimChannelScalarTable object.

Reimplemented from AnimGroup.

Definition at line 368 of file animChannelScalarTable.cxx.

References BamReader::get_factory(), make_AnimChannelScalarTable(), and Factory< Type >::register_factory().

void AnimChannelScalarTable::set_table ( const CPTA_stdfloat table)

Assigns the data table.

Definition at line 117 of file animChannelScalarTable.cxx.

References AnimBundle::get_num_frames().

void AnimChannelScalarTable::write ( ostream &  out,
int  indent_level 
) const [virtual]

Writes a brief description of the table and all of its descendants.

Reimplemented from AnimGroup.

Definition at line 137 of file animChannelScalarTable.cxx.

References AnimGroup::write_descendants().

void AnimChannelScalarTable::write_datagram ( BamWriter manager,
Datagram me 
) [virtual]

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