Panda3D
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions
SequenceNode Class Reference

A node that automatically cycles through rendering each one of its children according to its frame rate. More...

#include "sequenceNode.h"

Inheritance diagram for SequenceNode:
SelectiveChildNode AnimInterface PandaNode TypedWritable Namable LinkedListNode ReferenceCount TypedObject MemoryBase MemoryBase MemoryBase

List of all members.

Public Member Functions

 SequenceNode (const string &name)
virtual bool cull_callback (CullTraverser *trav, CullTraverserData &data)
 This function will be called during the cull traversal to perform any additional operations that should be performed at cull time.
virtual TypeHandle force_init_type ()
virtual int get_first_visible_child () const
 Returns the index number of the first visible child of this node, or a number >= get_num_children() if there are no visible children of this node.
virtual int get_num_frames () const
 Returns the number of frames in the animation.
virtual TypeHandle get_type () const
virtual int get_visible_child () const
 Returns the index number of the currently visible child of this node.
virtual bool has_single_child_visibility () const
 Should be overridden by derived classes to return true if this kind of node has the special property that just one of its children is visible at any given time, and furthermore that the particular visible child can be determined without reference to any external information (such as a camera).
virtual PandaNodemake_copy () const
 Returns a newly-allocated Node that is a shallow copy of this one.
virtual void output (ostream &out) const
virtual bool safe_to_combine () const
 Returns true if it is generally safe to combine this particular kind of PandaNode with other kinds of PandaNodes of compatible type, adding children or whatever.
virtual bool safe_to_combine_children () const
 Returns true if it is generally safe to combine the children of this PandaNode with each other.
void set_frame_rate (double frame_rate)
 Changes the advertised frame rate of the SequenceNode.
virtual void write_datagram (BamWriter *manager, Datagram &dg)
 Writes the contents of this object to the datagram for shipping out to a Bam file.

Static Public Member Functions

static TypeHandle get_class_type ()
static void init_type ()
static void register_with_read_factory ()
 Tells the BamReader how to create objects of type SequenceNode.

Protected Member Functions

 SequenceNode (const SequenceNode &copy)
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 SequenceNode.

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 type SequenceNode is encountered in the Bam file.

Detailed Description

A node that automatically cycles through rendering each one of its children according to its frame rate.

Definition at line 29 of file sequenceNode.h.


Member Function Documentation

bool SequenceNode::cull_callback ( CullTraverser trav,
CullTraverserData data 
) [virtual]

This function will be called during the cull traversal to perform any additional operations that should be performed at cull time.

This may include additional manipulation of render state or additional visible/invisible decisions, or any other arbitrary operation.

Note that this function will *not* be called unless set_cull_callback() is called in the constructor of the derived class. It is necessary to call set_cull_callback() to indicated that we require cull_callback() to be called.

By the time this function is called, the node has already passed the bounding-volume test for the viewing frustum, and the node's transform and state have already been applied to the indicated CullTraverserData object.

The return value is true if this node should be visible, or false if it should be culled.

Reimplemented from PandaNode.

Definition at line 116 of file sequenceNode.cxx.

References AnimInterface::get_frame(), and SelectiveChildNode::select_child().

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

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

Reimplemented from AnimInterface.

Definition at line 231 of file sequenceNode.cxx.

Referenced by make_from_bam().

int SequenceNode::get_first_visible_child ( ) const [virtual]

Returns the index number of the first visible child of this node, or a number >= get_num_children() if there are no visible children of this node.

This is called during the cull traversal, but only if has_selective_visibility() has already returned true. See has_selective_visibility().

Reimplemented from SelectiveChildNode.

Definition at line 132 of file sequenceNode.cxx.

References AnimInterface::get_frame().

int SequenceNode::get_num_frames ( ) const [virtual]

Returns the number of frames in the animation.

This is a property of the animation and may not be directly adjusted by the user (although it may change without warning with certain kinds of animations, since this is a virtual method that may be overridden).

Reimplemented from AnimInterface.

Definition at line 44 of file sequenceNode.cxx.

References PandaNode::get_num_children().

int SequenceNode::get_visible_child ( ) const [virtual]

Returns the index number of the currently visible child of this node.

This is only meaningful if has_single_child_visibility() has returned true.

Reimplemented from PandaNode.

Definition at line 165 of file sequenceNode.cxx.

References AnimInterface::get_frame().

Should be overridden by derived classes to return true if this kind of node has the special property that just one of its children is visible at any given time, and furthermore that the particular visible child can be determined without reference to any external information (such as a camera).

At present, only SequenceNodes and SwitchNodes fall into this category.

If this function returns true, get_visible_child() can be called to return the index of the currently-visible child.

Reimplemented from PandaNode.

Definition at line 153 of file sequenceNode.cxx.

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

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

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

Reimplemented from PandaNode.

Definition at line 86 of file sequenceNode.cxx.

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

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

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

Reimplemented from PandaNode.

Definition at line 212 of file sequenceNode.cxx.

References fillin().

Referenced by register_with_read_factory().

Tells the BamReader how to create objects of type SequenceNode.

Reimplemented from PandaNode.

Definition at line 187 of file sequenceNode.cxx.

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

bool SequenceNode::safe_to_combine ( ) const [virtual]

Returns true if it is generally safe to combine this particular kind of PandaNode with other kinds of PandaNodes of compatible type, adding children or whatever.

For instance, an LODNode should not be combined with any other PandaNode, because its set of children is meaningful.

Reimplemented from PandaNode.

Definition at line 59 of file sequenceNode.cxx.

bool SequenceNode::safe_to_combine_children ( ) const [virtual]

Returns true if it is generally safe to combine the children of this PandaNode with each other.

For instance, an LODNode's children should not be combined with each other, because the set of children is meaningful.

Reimplemented from PandaNode.

Definition at line 73 of file sequenceNode.cxx.

void SequenceNode::set_frame_rate ( double  frame_rate) [inline]

Changes the advertised frame rate of the SequenceNode.

This can be used in conjunction with get_play_rate() to change the effective frame rate of the node.

Reimplemented from AnimInterface.

Definition at line 37 of file sequenceNode.I.

void SequenceNode::write_datagram ( BamWriter manager,
Datagram dg 
) [virtual]

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

Reimplemented from AnimInterface.

Definition at line 198 of file sequenceNode.cxx.


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