15 #include "eggGroupUniquifier.h" 36 : _filter_names(filter_names)
66 string name = node->get_name();
70 nassertr(!name.empty(), string());
76 string::const_iterator pi;
77 bool last_underscore =
false;
78 for (pi = name.begin(); pi != name.end(); ++pi) {
81 last_underscore =
false;
83 }
else if (!last_underscore) {
85 last_underscore =
true;
90 nassertr(!result.empty(), string());
91 if (isdigit(result[0])) {
92 result =
"_" + result;
113 str << node->get_name() <<
"_group" << index;
virtual string get_category(EggNode *node)
Returns the category name into which the given node should be collected, or the empty string if the n...
virtual string generate_name(EggNode *node, const string &category, int index)
Generates a new name for the given node when its existing name clashes with some other node...
EggGroupUniquifier(bool filter_names=true)
If filter_names is true, then the group names will be coerced into a fairly safe, standard convention...
A base class for things that may be directly added into the egg hierarchy.
bool is_of_type(TypeHandle handle) const
Returns true if the current object is or derives from the indicated type.
bool has_name() const
Returns true if the Namable has a nonempty name set, false if the name is empty.
TypeHandle is the identifier used to differentiate C++ class types.
virtual string filter_name(EggNode *node)
Returns the name of the given node, or at least the name it should be.