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

This is a handy class for guaranteeing unique node names in an egg hierarchy. More...

Inheritance diagram for EggNameUniquifier:
EggObject EggGroupUniquifier EggPoolUniquifier

List of all members.

Public Member Functions

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.
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.
bool hasName (string category, string name)
 Returns true if the name has been used for the indicated category already, false otherwise.
 uniquify (EggNode node)
 Begins the traversal from the indicated node.

Static Public Member Functions

static TypeHandle getClassType ()

Detailed Description

This is a handy class for guaranteeing unique node names in an egg hierarchy.

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


Member Function Documentation

bool addName ( string  category,
string  name,
EggNode  node 
)

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 
)

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

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

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 
)

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.

static TypeHandle getClassType ( ) [static]

Reimplemented from EggObject.

Reimplemented in EggPoolUniquifier, and EggGroupUniquifier.

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.

bool hasName ( string  category,
string  name 
)

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

uniquify ( EggNode  node)

Begins the traversal from the indicated node.

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties