Panda3D
Public Types | Public Member Functions | Public Attributes

EggBinner Class Reference

A special binner used only within this package to pre-process the egg tree for the loader and group things together as appropriate. More...

#include "eggBinner.h"

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

List of all members.

Public Types

enum  BinNumber {
  BN_none = 0, BN_polyset, BN_lod, BN_nurbs_surface,
  BN_nurbs_curve
}

Public Member Functions

 EggBinner (EggLoader &loader)
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)
virtual void prepare_node (EggNode *node)
 May be overridden in derived classes to perform some setup work as each node is encountered.
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.

Public Attributes

EggLoader_loader

Detailed Description

A special binner used only within this package to pre-process the egg tree for the loader and group things together as appropriate.

It is used to collect similar polygons together for a Geom, as well as to group related LOD children together under a single LOD node.

Definition at line 34 of file eggBinner.h.


Member Function Documentation

string EggBinner::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 from EggBinMaker.

Definition at line 86 of file eggBinner.cxx.

void EggBinner::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 from EggBinMaker.

Definition at line 43 of file eggBinner.cxx.

References TypedObject::is_of_type(), and EggObject::set_user_data().

bool EggBinner::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 from EggBinMaker.

Definition at line 100 of file eggBinner.cxx.

References LVecBase3d::compare_to(), EggRenderState::compare_to(), EggPrimitive::get_sort_name(), and EggObject::get_user_data().


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