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

This is the base class for AnimChannel and AnimBundle. More...

#include "animGroup.h"

Inheritance diagram for AnimGroup:
TypedWritableReferenceCount Namable TypedWritable ReferenceCount MemoryBase TypedObject MemoryBase MemoryBase AnimBundle AnimChannelBase AnimChannel< SwitchType > AnimChannel< ACMatrixSwitchType > AnimChannelFixed< SwitchType > AnimChannelScalarDynamic AnimChannelScalarTable AnimChannelMatrixDynamic AnimChannelMatrixFixed AnimChannelMatrixXfmTable

List of all members.

Public Member Functions

 AnimGroup (AnimGroup *parent, const string &name)
 Creates the AnimGroup, and adds it to the indicated parent.
virtual int complete_pointers (TypedWritable **p_list, BamReader *manager)
 Takes in a vector of pointes to TypedWritable objects that correspond to all the requests for pointers that this object made to BamReader.
AnimGroupfind_child (const string &name) const
 Returns the first descendant found with the indicated name, or NULL if no such descendant exists.
virtual TypeHandle force_init_type ()
AnimGroupget_child (int n) const
 Returns the nth child of the group.
AnimGroupget_child_named (const string &name) const
 Returns the first child found with the indicated name, or NULL if no such child exists.
int get_num_children () const
 Returns the number of child nodes of the group.
virtual TypeHandle get_type () const
virtual TypeHandle get_value_type () const
 Returns the TypeHandle associated with the ValueType we are concerned with.
 MAKE_SEQ (get_children, get_num_children, get_child)
virtual void output (ostream &out) const
 Writes a one-line description of the group.
void sort_descendants ()
 Sorts the children nodes at each level of the hierarchy into alphabetical order.
virtual void write (ostream &out, int indent_level) const
 Writes a brief description of the group 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_AnimGroup (const FactoryParams &params)
 Factory method to generate a AnimGroup object.
static void register_with_read_factory ()
 Factory method to generate a AnimGroup object.

Protected Types

typedef pvector< PT(AnimGroup) > Children

Protected Member Functions

 AnimGroup (const string &name="")
 The default constructor is protected: don't try to create an AnimGroup without a parent.
 AnimGroup (AnimGroup *parent, const AnimGroup &copy)
 Creates a new AnimGroup, 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).
 PT (AnimGroup) copy_subtree(AnimGroup *parent) const
void write_descendants (ostream &out, int indent_level) const
 Writes a brief description of all of the group's descendants.

Protected Attributes

Children _children
AnimBundle_root

Detailed Description

This is the base class for AnimChannel and AnimBundle.

It implements a hierarchy of AnimChannels. The root of the hierarchy must be an AnimBundle.

Definition at line 36 of file animGroup.h.


Constructor & Destructor Documentation

AnimGroup::AnimGroup ( const string &  name = "") [protected]

The default constructor is protected: don't try to create an AnimGroup without a parent.

To create an AnimChannel hierarchy, you must first create an AnimBundle, and use that to create any subsequent children.

Definition at line 42 of file animGroup.cxx.

Referenced by make_AnimGroup(), and make_copy().

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

Creates a new AnimGroup, 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 58 of file animGroup.cxx.

AnimGroup::AnimGroup ( AnimGroup parent,
const string &  name 
)

Creates the AnimGroup, and adds it to the indicated parent.

The only way to delete it subsequently is to delete the entire hierarchy.

Definition at line 78 of file animGroup.cxx.


Member Function Documentation

int AnimGroup::complete_pointers ( TypedWritable **  p_list,
BamReader manager 
) [virtual]

Takes in a vector of pointes to TypedWritable objects that correspond to all the requests for pointers that this object made to BamReader.

Reimplemented from TypedWritable.

Reimplemented in AnimChannelMatrixDynamic, and AnimChannelScalarDynamic.

Definition at line 327 of file animGroup.cxx.

References TypeHandle::get_name().

void AnimGroup::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.

Reimplemented in AnimChannelMatrixXfmTable, AnimChannelMatrixDynamic, AnimChannelScalarDynamic, AnimChannelScalarTable, AnimBundle, AnimChannelBase, and AnimChannelMatrixFixed.

Definition at line 309 of file animGroup.cxx.

References DatagramIterator::get_string(), DatagramIterator::get_uint16(), and BamReader::read_pointer().

Referenced by make_AnimGroup().

AnimGroup * AnimGroup::find_child ( const string &  name) const

Returns the first descendant found with the indicated name, or NULL if no such descendant exists.

This method searches the entire graph beginning at this AnimGroup; see also get_child_named().

Definition at line 151 of file animGroup.cxx.

References find_child().

Referenced by find_child().

AnimGroup * AnimGroup::get_child ( int  n) const

Returns the nth child of the group.

Definition at line 115 of file animGroup.cxx.

Referenced by PartGroup::bind_hierarchy(), and PartGroup::check_hierarchy().

AnimGroup * AnimGroup::get_child_named ( const string &  name) const

Returns the first child found with the indicated name, or NULL if no such child exists.

This method searches only the children of this particular AnimGroup; it does not recursively search the entire graph. See also find_child().

Definition at line 130 of file animGroup.cxx.

Referenced by PartGroup::check_hierarchy().

Returns the number of child nodes of the group.

Definition at line 104 of file animGroup.cxx.

Referenced by PartGroup::bind_hierarchy(), and PartGroup::check_hierarchy().

Returns the TypeHandle associated with the ValueType we are concerned with.

This is provided to allow a bit of run-time checking that joints and channels are matching properly in type.

Reimplemented in AnimChannel< SwitchType >, AnimChannel< ACMatrixSwitchType >, and AnimChannelBase.

Definition at line 204 of file animGroup.cxx.

References TypeHandle::none().

Referenced by PartGroup::check_hierarchy().

TypedWritable * AnimGroup::make_AnimGroup ( const FactoryParams params) [static]

Factory method to generate a AnimGroup object.

Definition at line 346 of file animGroup.cxx.

References AnimGroup(), and fillin().

Referenced by register_with_read_factory().

AnimGroup * AnimGroup::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 in AnimChannelMatrixXfmTable, AnimChannelMatrixDynamic, AnimChannelScalarDynamic, AnimChannelScalarTable, and AnimBundle.

Definition at line 259 of file animGroup.cxx.

References AnimGroup().

void AnimGroup::output ( ostream &  out) const [virtual]

Writes a one-line description of the group.

Reimplemented from Namable.

Reimplemented in AnimChannelFixed< SwitchType >, AnimChannelMatrixFixed, and AnimBundle.

Definition at line 214 of file animGroup.cxx.

Referenced by AnimChannelFixed< SwitchType >::output().

Sorts the children nodes at each level of the hierarchy into alphabetical order.

This should be done after creating the hierarchy, to guarantee that the correct names will match up together when the AnimBundle is later bound to a PlayerRoot.

Definition at line 185 of file animGroup.cxx.

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

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

Reimplemented in AnimChannelMatrixXfmTable, and AnimChannelScalarTable.

Definition at line 225 of file animGroup.cxx.

References write_descendants().

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

Function to write the important information in the particular object to a Datagram.

Reimplemented from TypedWritable.

Reimplemented in AnimChannelMatrixDynamic, AnimChannelMatrixXfmTable, AnimChannelScalarDynamic, AnimChannelScalarTable, AnimBundle, AnimChannelBase, and AnimChannelMatrixFixed.

Definition at line 290 of file animGroup.cxx.

References Datagram::add_string(), Datagram::add_uint16(), and BamWriter::write_pointer().

void AnimGroup::write_descendants ( ostream &  out,
int  indent_level 
) const [protected]

Writes a brief description of all of the group's descendants.

Definition at line 242 of file animGroup.cxx.

Referenced by AnimChannelScalarTable::write(), write(), and AnimChannelMatrixXfmTable::write().


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