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

AnimBundleNode Class Reference

This is a node that contains a pointer to an AnimBundle. More...

#include "animBundleNode.h"

Inheritance diagram for AnimBundleNode:
PandaNode TypedWritable Namable LinkedListNode ReferenceCount TypedObject MemoryBase MemoryBase MemoryBase

List of all members.

Public Member Functions

 AnimBundleNode (const string &name, AnimBundle *bundle)
 The AnimBundle and its node should be constructed together.
virtual int complete_pointers (TypedWritable **p_list, BamReader *manager)
 Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
virtual TypeHandle force_init_type ()
AnimBundleget_bundle () const
virtual TypeHandle get_type () const
virtual PandaNodemake_copy () const
 Returns a newly-allocated PandaNode that is a shallow copy of this one.
virtual bool safe_to_flatten () const
 Returns true if it is generally safe to flatten out this particular kind of Node by duplicating instances, false otherwise (for instance, a Camera cannot be safely flattened, because the Camera pointer itself is meaningful).
virtual void write_datagram (BamWriter *manager, Datagram &me)
 Writes the contents of this object to the datagram for shipping out to a Bam file.

Static Public Member Functions

static AnimBundlefind_anim_bundle (PandaNode *root)
 Recursively walks the scene graph beginning at the indicated node (which need not be an AnimBundleNode), and returns the first AnimBundle found.
static TypeHandle get_class_type ()
static void init_type ()
static void register_with_read_factory ()
 Tells the BamReader how to create objects of type AnimBundleNode.

Protected Member Functions

 AnimBundleNode ()
 For internal use only.
 AnimBundleNode (const AnimBundleNode &copy)
 Use make_copy() or copy_subgraph() to copy one of these.
void fillin (DatagramIterator &scan, BamReader *manager)
 This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new PandaNode.

Static Protected Member Functions

static TypedWritablemake_from_bam (const FactoryParams &params)
 This function is called by the BamReader's factory when a new object of this type is encountered in the Bam file.

Detailed Description

This is a node that contains a pointer to an AnimBundle.

Like PartBundleNode, it exists solely to make it easy to store AnimBundles in the scene graph.

Definition at line 31 of file animBundleNode.h.


Constructor & Destructor Documentation

AnimBundleNode::AnimBundleNode ( const string &  name,
AnimBundle bundle 
) [inline]

The AnimBundle and its node should be constructed together.

Generally, the derived classes of AnimBundleNode will automatically create a AnimBundle of the appropriate type, and pass it up to this constructor.

Definition at line 26 of file animBundleNode.I.

AnimBundleNode::AnimBundleNode ( ) [inline, protected]

For internal use only.

Definition at line 38 of file animBundleNode.I.

Referenced by make_copy(), and make_from_bam().

AnimBundleNode::AnimBundleNode ( const AnimBundleNode copy) [inline, protected]

Use make_copy() or copy_subgraph() to copy one of these.

Definition at line 48 of file animBundleNode.I.


Member Function Documentation

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

Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().

Returns the number of pointers processed.

Reimplemented from TypedWritable.

Definition at line 111 of file animBundleNode.cxx.

void AnimBundleNode::fillin ( DatagramIterator scan,
BamReader manager 
) [protected, virtual]

This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new PandaNode.

Reimplemented from PandaNode.

Definition at line 145 of file animBundleNode.cxx.

References BamReader::read_pointer().

Referenced by make_from_bam().

AnimBundle * AnimBundleNode::find_anim_bundle ( PandaNode root) [static]

Recursively walks the scene graph beginning at the indicated node (which need not be an AnimBundleNode), and returns the first AnimBundle found.

Returns NULL if no AnimBundle can be found.

Definition at line 57 of file animBundleNode.cxx.

References PandaNode::Children::get_child(), PandaNode::get_children(), PandaNode::Children::get_num_children(), and TypedObject::is_of_type().

Referenced by BindAnimRequest::do_task().

PandaNode * AnimBundleNode::make_copy ( ) const [virtual]

Returns a newly-allocated PandaNode that is a shallow copy of this one.

It will be a different pointer, but its internal data may or may not be shared with that of the original PandaNode. No children will be copied.

Reimplemented from PandaNode.

Definition at line 30 of file animBundleNode.cxx.

References AnimBundleNode().

TypedWritable * AnimBundleNode::make_from_bam ( const FactoryParams params) [static, protected]

This function is called by the BamReader's factory when a new object of this type is encountered in the Bam file.

It should create the object and extract its information from the file.

Reimplemented from PandaNode.

Definition at line 126 of file animBundleNode.cxx.

References AnimBundleNode(), and fillin().

Referenced by register_with_read_factory().

void AnimBundleNode::register_with_read_factory ( ) [static]

Tells the BamReader how to create objects of type AnimBundleNode.

Reimplemented from PandaNode.

Definition at line 87 of file animBundleNode.cxx.

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

bool AnimBundleNode::safe_to_flatten ( ) const [virtual]

Returns true if it is generally safe to flatten out this particular kind of Node by duplicating instances, false otherwise (for instance, a Camera cannot be safely flattened, because the Camera pointer itself is meaningful).

Reimplemented from PandaNode.

Definition at line 44 of file animBundleNode.cxx.

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

Writes the contents of this object to the datagram for shipping out to a Bam file.

Reimplemented from PandaNode.

Definition at line 98 of file animBundleNode.cxx.

References BamWriter::write_pointer().


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