# EggPolysetMaker

from pandac.PandaModules import EggPolysetMaker

Class : EggPolysetMaker
Description : A specialization on EggBinMaker for making polysets that share the same basic rendering characteristic. This really just defines the example functions described in the leading comment to EggBinMaker.
It makes some common assumptions about how polysets should be grouped; if these are not sufficient, you can always rederive your own further specialization of this class.

## Inheritance:

EggPolysetMaker: EggBinMaker
EggBinMaker: EggObject
EggObject: TypedReferenceCount
TypedReferenceCount: TypedObject ReferenceCount
TypedObject: MemoryBase
MemoryBase:
ReferenceCount: MemoryBase

## Methods of EggPolysetMaker:

getClassType
setProperties

## Methods of EggBinMaker:

collapseGroup
getBinName
getBinNumber
getClassType
makeBin
makeBins
prepareNode
sortsLess

## Methods of EggObject:

clearUserData
getClassType
getUserData
hasUserData
operator =
setUserData

## Methods of TypedReferenceCount:

getClassType

## Methods of TypedObject:

getClassType
getType
getTypeIndex
isExactType
isOfType

## Methods of ReferenceCount:

getClassType
getRefCount
ref
testRefCountIntegrity
testRefCountNonzero
unref

## Constants in EggPolysetMaker:

BNNone | (BinNumber)
BNPolyset | (BinNumber)
PHasTexture | (Properties)
PTexture | (Properties)
PHasMaterial | (Properties)
PMaterial | (Properties)
PHasPolyColor | (Properties)
PPolyColor | (Properties)
PHasPolyNormal | (Properties)
PHasVertexNormal | (Properties)
PHasVertexColor | (Properties)
PBface | (Properties)

getClassType static TypeHandle EggPolysetMaker::get_class_type(void); Undocumented function.

setProperties void EggPolysetMaker::set_properties(int properties); Description: Sets the set of properties that determines which polygons are allowed to be grouped together into a single polyset. This is the bitwise 'or' of all the properties that matter. If this is 0, all polygons (within a given group) will be lumped into a common polyset regardless of their properties.

collapseGroup virtual bool EggBinMaker::collapse_group(EggGroup const *group, int bin_number); Description: May be overridden in derived classes to specify whether a particular group node, apparently redundant, may be safely collapsed out.

getBinName virtual string EggBinMaker::get_bin_name(int bin_number, EggNode const *child); Description: May be overridden in derived classes to define a name for each new bin, based on its bin number, and a sample child.

getBinNumber virtual int EggBinMaker::get_bin_number(EggNode const *node) = 0; Undocumented function.

getClassType static TypeHandle EggBinMaker::get_class_type(void); Undocumented function.

makeBin virtual PointerTo< EggBin > EggBinMaker::make_bin(int bin_number, EggNode const *child, EggGroup *collapse_from); Description: 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.

makeBins int EggBinMaker::make_bins(EggGroupNode *root_group); Description: 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 virtual void EggBinMaker::prepare_node(EggNode *node); Description: 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.

sortsLess virtual bool EggBinMaker::sorts_less(int bin_number, EggNode const *a, EggNode const *b); Description: 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).

clearUserData void EggObject::clear_user_data(void); Description: Removes *all* user data pointers from the node. Description: Removes the user data pointer of the indicated type.

getClassType static TypeHandle EggObject::get_class_type(void); Undocumented function.

getUserData EggUserData *EggObject::get_user_data(void) const; Description: Returns the user data pointer most recently stored on this object, or NULL if nothing was previously stored. Description: Returns the user data pointer of the indicated type, if it exists, or NULL if it does not.

hasUserData bool EggObject::has_user_data(void) const; Description: Returns true if a generic user data pointer has recently been set and not yet cleared, false otherwise. Description: Returns true if the user data pointer of the indicated type has been set, false otherwise.

operator = EggObject &EggObject::operator =(EggObject const &copy); Description:

setUserData void EggObject::set_user_data(EggUserData *user_data); Description: Sets the user data associated with this object. This may be any EggUserData-derived object. The egg library will do nothing with this pointer, except to hold its reference count and return the pointer on request. The EggObject maintains multiple different EggUserData pointers, one for each unique type (as reported by get_type()). If you know that only one type of EggUserData object will be added in your application, you may use the query functions that accept no parameters, but it is recommended that in general you pass in the type of your particular user data, to allow multiple applications to coexist in the same egg data. This pointer is also copied by the copy assignment operator and copy constructor.

getClassType static TypeHandle TypedReferenceCount::get_class_type(void); Undocumented function.

getClassType static TypeHandle TypedObject::get_class_type(void); Undocumented function.

getType virtual TypeHandle TypedObject::get_type(void) const = 0; Derived classes should override this function to return get_class_type().

getTypeIndex int TypedObject::get_type_index(void) const; Description: Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. This is equivalent to get_type().get_index().

isExactType bool TypedObject::is_exact_type(TypeHandle handle) const; Description: Returns true if the current object is the indicated type exactly.

isOfType bool TypedObject::is_of_type(TypeHandle handle) const; Description: Returns true if the current object is or derives from the indicated type.

getClassType static TypeHandle ReferenceCount::get_class_type(void); Undocumented function.

getRefCount int ReferenceCount::get_ref_count(void) const; Description: Returns the current reference count.

ref void ReferenceCount::ref(void) const; Description: Explicitly increments the reference count. User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.

testRefCountIntegrity bool ReferenceCount::test_ref_count_integrity(void) const; Description: Does some easy checks to make sure that the reference count isn't completely bogus. Returns true if ok, false otherwise.

testRefCountNonzero bool ReferenceCount::test_ref_count_nonzero(void) const; Description: Does some easy checks to make sure that the reference count isn't zero, or completely bogus. Returns true if ok, false otherwise.

unref bool ReferenceCount::unref(void) const; Description: Explicitly decrements the reference count. Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic; plus, we don't have a virtual destructor anyway.) However, see the helper function unref_delete(). User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it. The return value is true if the new reference count is nonzero, false if it is zero.