Panda3D
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Public Member Functions | Static Public Member Functions
EggBinMaker Class Reference

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

Inheritance diagram for EggBinMaker:
EggObject EggPolysetMaker

List of all members.

Public Member Functions

bool collapseGroup (EggGroup const group, int bin_number)
 May be overridden in derived classes to specify whether a particular group node, apparently redundant, may be safely collapsed out.
string getBinName (int bin_number, EggNode const child)
 May be overridden in derived classes to define a name for each new bin, based on its bin number, and a sample child.
int getBinNumber (EggNode const node)
EggBin makeBin (int bin_number, EggNode const child, EggGroup collapse_from)
 May be overridden in derived classes to construct a new EggBin object (or some derived class, if needed), and preload some initial data into as required.
int makeBins (EggGroupNode root_group)
 The main entry point to EggBinMaker.
 prepareNode (EggNode node)
 May be overridden in derived classes to perform some setup work as each node is encountered.
bool sortsLess (int bin_number, EggNode const a, EggNode const 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 getClassType ()

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.


Member Function Documentation

bool collapseGroup ( EggGroup const  group,
int  bin_number 
)

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

string getBinName ( int  bin_number,
EggNode const  child 
)

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

int getBinNumber ( EggNode const  node)
static TypeHandle getClassType ( ) [static]

Reimplemented from EggObject.

Reimplemented in EggPolysetMaker.

EggBin makeBin ( int  bin_number,
EggNode const  child,
EggGroup  collapse_from 
)

May be overridden in derived classes to construct a new EggBin object (or some derived class, if needed), and preload some initial data into as required.

child is an arbitrary child of the bin, and collapse_from is the group the bin is being collapsed with, if any (implying collapse_group() returned true), or NULL if not.

int makeBins ( 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.

prepareNode ( EggNode  node)

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.

bool sortsLess ( int  bin_number,
EggNode const  a,
EggNode const  b 
)

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).

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties