Panda3D
Public Member Functions | Static Public Member Functions | Protected Types | Protected Attributes
EggComponentData Class Reference

This is the base class of both EggJointData and EggSliderData. More...

#include "eggComponentData.h"

Inheritance diagram for EggComponentData:
EggObject Namable TypedReferenceCount MemoryBase TypedObject ReferenceCount MemoryBase MemoryBase EggJointData EggSliderData

List of all members.

Public Member Functions

 EggComponentData (EggCharacterCollection *collection, EggCharacterData *char_data)
virtual void add_back_pointer (int model_index, EggObject *egg_object)=0
void add_name (const string &name, NameUniquifier &uniquifier)
 Adds the indicated name to the set of names that this component can be identified with.
void extend_to (int model_index, int num_frames) const
 Extends the number of frames in the indicated model (presumably an animation table model) to the given number.
virtual TypeHandle force_init_type ()
double get_frame_rate (int model_index) const
 Returns the number of frames of animation for this particular component in the indicated model.
EggBackPointerget_model (int model_index) const
 Returns the back pointer to an egg file for the indicated model if it exists, or NULL if it does not.
int get_num_frames (int model_index) const
 Returns the number of frames of animation for this particular component in the indicated model.
int get_num_models () const
 Returns the maximum number of back pointers this component may have.
virtual TypeHandle get_type () const
bool has_model (int model_index) const
 Returns true if the component has a back pointer to an egg file somewhere for the indicated model, false otherwise.
bool matches_name (const string &name) const
 Returns true if the indicated name matches any name that was ever matched with this particular joint, false otherwise.
void set_model (int model_index, EggBackPointer *back)
 Sets the back_pointer associated with the given model_index.
virtual void write (ostream &out, int indent_level=0) const =0

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.

Protected Types

typedef pvector< EggBackPointer * > BackPointers
typedef pset< string > Names

Protected Attributes

BackPointers _back_pointers
EggCharacterData_char_data
EggCharacterCollection_collection
Names _names

Detailed Description

This is the base class of both EggJointData and EggSliderData.

It represents a single component of a character, either a joint or a slider, along with back pointers to the references to this component in all model and animation egg files read.

Definition at line 37 of file eggComponentData.h.


Member Function Documentation

void EggComponentData::add_name ( const string &  name,
NameUniquifier uniquifier 
)

Adds the indicated name to the set of names that this component can be identified with.

If this is the first name added, it becomes the primary name of the component; later names added do not replace the primary name, but do get added to the list of names that will be accepted by matched_name().

Definition at line 64 of file eggComponentData.cxx.

References NameUniquifier::add_name(), and Namable::has_name().

void EggComponentData::extend_to ( int  model_index,
int  num_frames 
) const

Extends the number of frames in the indicated model (presumably an animation table model) to the given number.

Definition at line 115 of file eggComponentData.cxx.

References EggBackPointer::extend_to(), and get_model().

Referenced by EggCharacterData::check_num_frames().

double EggComponentData::get_frame_rate ( int  model_index) const

Returns the number of frames of animation for this particular component in the indicated model.

Definition at line 128 of file eggComponentData.cxx.

References EggBackPointer::get_frame_rate(), and get_model().

Referenced by EggCharacterData::get_frame_rate().

EggBackPointer * EggComponentData::get_model ( int  model_index) const [inline]
int EggComponentData::get_num_frames ( int  model_index) const

Returns the number of frames of animation for this particular component in the indicated model.

Definition at line 99 of file eggComponentData.cxx.

References get_model().

Referenced by EggCharacterData::check_num_frames(), EggCharacterData::get_num_frames(), and EggJointData::score_reparent_to().

int EggComponentData::get_num_models ( ) const [inline]

Returns the maximum number of back pointers this component may have.

The component may store a back pointer for models indexed 0 .. num_models - 1. You must call has_model() on each model index to confirm whether a particular model in that range has a back pointer.

Definition at line 27 of file eggComponentData.I.

Referenced by EggJointData::do_finish_reparent(), EggJointData::force_initial_rest_frame(), EggJointData::move_vertices_to(), EggRetargetAnim::retarget_anim(), EggJointData::score_reparent_to(), and EggTopstrip::strip_anim().

bool EggComponentData::has_model ( int  model_index) const [inline]
static void EggComponentData::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 EggObject.

Reimplemented in EggJointData, and EggSliderData.

Definition at line 76 of file eggComponentData.h.

bool EggComponentData::matches_name ( const string &  name) const

Returns true if the indicated name matches any name that was ever matched with this particular joint, false otherwise.

Definition at line 85 of file eggComponentData.cxx.

void EggComponentData::set_model ( int  model_index,
EggBackPointer back 
)

Sets the back_pointer associated with the given model_index.

Definition at line 143 of file eggComponentData.cxx.

Referenced by EggSliderData::add_back_pointer(), and EggJointData::add_back_pointer().


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