Panda3D
Public Member Functions | Static Public Member Functions

EggPoolUniquifier Class Reference

This is a specialization of EggNameUniquifier to generate unique names for textures, materials, and vertex pools prior to writing out an egg file. More...

Inheritance diagram for EggPoolUniquifier:
EggNameUniquifier EggObject

List of all members.

Public Member Functions

 EggPoolUniquifier ()
bool addName (string category, string name, EggNode node)
 Adds the name to the indicated category.
bool addName (string category, string name)
 Adds the name to the indicated category.
 clear ()
 Empties the table of used named and prepares the Uniquifier for a new tree.
 clearUserData ()
 Removes *all* user data pointers from the node.
 clearUserData (TypeHandle type)
 Removes the user data pointer of the indicated type.
string filterName (EggNode node)
 Returns the name of the given node, or at least the name it should be.
string generateName (EggNode node, string category, int index)
 Generates a new name for the given node when its existing name clashes with some other node.
string getCategory (EggNode node)
EggNode getNode (string category, string name)
 Returns the node associated with the given category and name, or NULL if the name has not been used.
EggUserData getUserData (TypeHandle type)
 Returns the user data pointer of the indicated type, if it exists, or NULL if it does not.
EggUserData getUserData ()
 Returns the user data pointer most recently stored on this object, or NULL if nothing was previously stored.
bool hasName (string category, string name)
 Returns true if the name has been used for the indicated category already, false otherwise.
bool hasUserData (TypeHandle type)
 Returns true if the user data pointer of the indicated type has been set, false otherwise.
bool hasUserData ()
 Returns true if a generic user data pointer has recently been set and not yet cleared, false otherwise.
 setUserData (EggUserData user_data)
 Sets the user data associated with this object.
 uniquify (EggNode node)
 Begins the traversal from the indicated node.

Static Public Member Functions

static TypeHandle getClassType ()

Detailed Description

This is a specialization of EggNameUniquifier to generate unique names for textures, materials, and vertex pools prior to writing out an egg file.

It's automatically called by EggData prior to writing out an egg file.


Constructor & Destructor Documentation


Member Function Documentation

bool addName ( string  category,
string  name,
EggNode  node 
) [inherited]

Adds the name to the indicated category.

This name will not be used for any other egg node within this category. Returns true if the name was added, or false if it was already in use for the category.

bool addName ( string  category,
string  name 
) [inherited]

Adds the name to the indicated category.

This name will not be used for any other egg node within this category. Returns true if the name was added, or false if it was already in use for the category.

clear ( ) [inherited]

Empties the table of used named and prepares the Uniquifier for a new tree.

clearUserData ( ) [inherited]

Removes *all* user data pointers from the node.

clearUserData ( TypeHandle  type) [inherited]

Removes the user data pointer of the indicated type.

string filterName ( EggNode  node) [inherited]

Returns the name of the given node, or at least the name it should be.

This provides a hook to adjust the name before attempting to uniquify it, if desired, for instance to remove invalid characters.

string generateName ( EggNode  node,
string  category,
int  index 
) [inherited]

Generates a new name for the given node when its existing name clashes with some other node.

This function will be called repeatedly, if necessary, until it returns a name that actually is unique.

The category is the string returned by get_category(), and index is a uniquely-generated number that may be useful for synthesizing the name.

string getCategory ( EggNode  node) [inherited]
static TypeHandle getClassType ( ) [static]

Reimplemented from EggNameUniquifier.

EggNode getNode ( string  category,
string  name 
) [inherited]

Returns the node associated with the given category and name, or NULL if the name has not been used.

EggUserData getUserData ( TypeHandle  type) [inherited]

Returns the user data pointer of the indicated type, if it exists, or NULL if it does not.

EggUserData getUserData ( ) [inherited]

Returns the user data pointer most recently stored on this object, or NULL if nothing was previously stored.

bool hasName ( string  category,
string  name 
) [inherited]

Returns true if the name has been used for the indicated category already, false otherwise.

bool hasUserData ( TypeHandle  type) [inherited]

Returns true if the user data pointer of the indicated type has been set, false otherwise.

bool hasUserData ( ) [inherited]

Returns true if a generic user data pointer has recently been set and not yet cleared, false otherwise.

setUserData ( EggUserData  user_data) [inherited]

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.

uniquify ( EggNode  node) [inherited]

Begins the traversal from the indicated node.

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties