Panda3D
|
Corresponding to an <S$Anim> entry, this stores a single column of numbers, for instance for a morph target, or as one column in an EggXfmSAnim. More...
#include "eggSAnimData.h"
Public Member Functions | |
EggSAnimData (const string &name="") | |
EggSAnimData (const EggSAnimData ©) | |
virtual TypeHandle | force_init_type () |
int | get_num_rows () const |
Returns the number of rows in the table. | |
virtual TypeHandle | get_type () const |
double | get_value (int row) const |
Returns the value at the indicated row. | |
EggSAnimData & | operator= (const EggSAnimData ©) |
void | optimize () |
Optimizes the data by collapsing a long table of duplicate values into a single value. | |
void | set_value (int row, double value) |
Changes the value at the indicated row. | |
virtual void | write (ostream &out, int indent_level) const |
Writes the data to the indicated output stream in Egg format. | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
This function is declared non-inline to work around a compiler bug in g++ 2.96. |
Corresponding to an <S$Anim> entry, this stores a single column of numbers, for instance for a morph target, or as one column in an EggXfmSAnim.
Definition at line 28 of file eggSAnimData.h.
int EggSAnimData::get_num_rows | ( | ) | const [inline] |
Returns the number of rows in the table.
For an SAnim table, each row has one column.
Definition at line 56 of file eggSAnimData.I.
References EggAnimData::get_size().
Referenced by EggXfmAnimData::EggXfmAnimData(), EggXfmSAnim::get_num_rows(), get_value(), EggXfmSAnim::get_value(), optimize(), EggXfmSAnim::optimize(), set_value(), and write().
double EggSAnimData::get_value | ( | int | row | ) | const [inline] |
Returns the value at the indicated row.
Row must be in the range 0 <= row < get_num_rows().
Definition at line 68 of file eggSAnimData.I.
References get_num_rows().
Referenced by EggXfmAnimData::EggXfmAnimData(), EggXfmSAnim::get_value(), optimize(), EggXfmSAnim::optimize(), and write().
static void EggSAnimData::init_type | ( | ) | [inline, static] |
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Making it inline seems to cause problems in the optimizer.
Reimplemented from EggAnimData.
Definition at line 47 of file eggSAnimData.h.
References EggAnimData::init_type().
void EggSAnimData::optimize | ( | ) |
Optimizes the data by collapsing a long table of duplicate values into a single value.
Definition at line 32 of file eggSAnimData.cxx.
References get_num_rows(), and get_value().
Referenced by EggXfmSAnim::optimize().
void EggSAnimData::set_value | ( | int | row, |
double | value | ||
) | [inline] |
Changes the value at the indicated row.
Row must be in the range 0 <= row < get_num_rows().
Definition at line 81 of file eggSAnimData.I.
References get_num_rows().
void EggSAnimData::write | ( | ostream & | out, |
int | indent_level | ||
) | const [virtual] |
Writes the data to the indicated output stream in Egg format.
Implements EggNode.
Definition at line 56 of file eggSAnimData.cxx.
References EggAnimData::get_fps(), get_num_rows(), get_value(), Namable::has_name(), and EggNamedObject::write_header().
Referenced by EggXfmSAnim::write().