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

SelectiveChildNode Class Reference

A base class for nodes like LODNode and SequenceNode that select only one visible child at a time. More...

#include "selectiveChildNode.h"

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

List of all members.

Public Member Functions

 SelectiveChildNode (const string &name)
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_next_visible_child (int n) const
 Returns the index number of the next visible child of this node following the indicated child, or a number >= get_num_children() if there are no more visible children of this node.
virtual TypeHandle get_type () const
virtual bool has_selective_visibility () const
 Should be overridden by derived classes to return true if this kind of node has some restrictions on the set of children that should be rendered.

Static Public Member Functions

static TypeHandle get_class_type ()
static void init_type ()

Protected Member Functions

 SelectiveChildNode (const SelectiveChildNode &copy)
void select_child (int n)
 Selects the indicated child for rendering.

Detailed Description

A base class for nodes like LODNode and SequenceNode that select only one visible child at a time.

Definition at line 27 of file selectiveChildNode.h.


Member Function Documentation

int SelectiveChildNode::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 PandaNode.

Reimplemented in SequenceNode, and SwitchNode.

Definition at line 54 of file selectiveChildNode.cxx.

int SelectiveChildNode::get_next_visible_child ( int  n) const [virtual]

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

See has_selective_visibility() and get_first_visible_child().

Reimplemented from PandaNode.

Definition at line 69 of file selectiveChildNode.cxx.

References PandaNode::get_num_children().

bool SelectiveChildNode::has_selective_visibility ( ) const [virtual]

Should be overridden by derived classes to return true if this kind of node has some restrictions on the set of children that should be rendered.

Node with this property include LODNodes, SwitchNodes, and SequenceNodes.

If this function returns true, get_first_visible_child() and get_next_visible_child() will be called to walk through the list of children during cull, instead of iterating through the entire list. This method is called after cull_callback(), so cull_callback() may be responsible for the decisions as to which children are visible at the moment.

Reimplemented from PandaNode.

Definition at line 39 of file selectiveChildNode.cxx.

void SelectiveChildNode::select_child ( int  n) [inline, protected]

Selects the indicated child for rendering.

This is normally called during the cull_callback() method, but it may be called at any time.

Definition at line 48 of file selectiveChildNode.I.

Referenced by SwitchNode::cull_callback(), and SequenceNode::cull_callback().


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