34 : _filter_names(filter_names)
58 string name = node->get_name();
62 nassertr(!name.empty(), string());
68 string::const_iterator pi;
69 bool last_underscore =
false;
70 for (pi = name.begin(); pi != name.end(); ++pi) {
73 last_underscore =
false;
75 }
else if (!last_underscore) {
77 last_underscore =
true;
82 nassertr(!result.empty(), string());
83 if (isdigit(result[0])) {
84 result =
"_" + result;
100 std::ostringstream str;
101 str << node->get_name() <<
"_group" << index;
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual std::string get_category(EggNode *node)
Returns the category name into which the given node should be collected, or the empty string if the n...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual std::string generate_name(EggNode *node, const std::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 std::string filter_name(EggNode *node)
Returns the name of the given node, or at least the name it should be.