Panda3D
Public Member Functions | Static Public Member Functions | Public Attributes
EggBinMaker Class Reference

This is a handy class for collecting related nodes together. More...

#include "eggBinMaker.h"

Inheritance diagram for EggBinMaker:
EggObject TypedReferenceCount TypedObject ReferenceCount MemoryBase MemoryBase EggBinner EggPolysetMaker

List of all members.

Public Member Functions

virtual bool collapse_group (const EggGroup *group, int bin_number)
 May be overridden in derived classes to specify whether a particular group node, apparently redundant, may be safely collapsed out.
virtual TypeHandle force_init_type ()
virtual string get_bin_name (int bin_number, const EggNode *child)
 May be overridden in derived classes to define a name for each new bin, based on its bin number, and a sample child.
virtual int get_bin_number (const EggNode *node)=0
virtual TypeHandle get_type () const
int make_bins (EggGroupNode *root_group)
 The main entry point to EggBinMaker.
virtual void prepare_node (EggNode *node)
 May be overridden in derived classes to perform some setup work as each node is encountered.
virtual PT (EggBin) make_bin(int bin_number
virtual bool sorts_less (int bin_number, const EggNode *a, const EggNode *b)
 May be overridden in derived classes to create additional bins within a particular bin number, based on some arbitrary property of nodes.

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.

Public Attributes

virtual const EggNodechild
virtual const EggNode EggGroupcollapse_from

Detailed Description

This is a handy class for collecting related nodes together.

It is an abstract class; to use it you must subclass off of it. See the somewhat lengthy comment above.

Definition at line 254 of file eggBinMaker.h.


Member Function Documentation

bool EggBinMaker::collapse_group ( const EggGroup group,
int  bin_number 
) [virtual]

May be overridden in derived classes to specify whether a particular group node, apparently redundant, may be safely collapsed out.

Definition at line 126 of file eggBinMaker.cxx.

string EggBinMaker::get_bin_name ( int  bin_number,
const EggNode child 
) [virtual]

May be overridden in derived classes to define a name for each new bin, based on its bin number, and a sample child.

Reimplemented in EggBinner.

Definition at line 138 of file eggBinMaker.cxx.

static void EggBinMaker::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 EggPolysetMaker.

Definition at line 306 of file eggBinMaker.h.

References EggObject::init_type().

Referenced by EggPolysetMaker::init_type().

int EggBinMaker::make_bins ( EggGroupNode root_group)

The main entry point to EggBinMaker.

Walks the egg scene graph beginning at the indicated root node, and moves all binnable nodes into EggBin objects. Returns the number of EggBins created.

Definition at line 77 of file eggBinMaker.cxx.

Referenced by XFileMaker::add_tree().

void EggBinMaker::prepare_node ( EggNode node) [virtual]

May be overridden in derived classes to perform some setup work as each node is encountered.

This will be called once for each node in the egg hierarchy.

Reimplemented in EggBinner.

Definition at line 99 of file eggBinMaker.cxx.

bool EggBinMaker::sorts_less ( int  bin_number,
const EggNode a,
const EggNode b 
) [virtual]

May be overridden in derived classes to create additional bins within a particular bin number, based on some arbitrary property of nodes.

This function establishes an arbitrary but fixed ordering between nodes; if two nodes do not sort to the same position, different bins are created for each one (with the same bin number on each bin).

Reimplemented in EggPolysetMaker, and EggBinner.

Definition at line 114 of file eggBinMaker.cxx.

Referenced by EggBinMakerCompareNodes::operator()().


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