add find_child

This commit is contained in:
David Rose 2003-07-22 01:49:23 +00:00
parent 06808bf5f2
commit c37f62fd9a
2 changed files with 21 additions and 0 deletions

View File

@ -289,6 +289,25 @@ steal_children(EggGroupNode &other) {
_children.splice(_children.end(), other._children);
}
////////////////////////////////////////////////////////////////////
// Function: EggGroupNode::find_child
// Access: Public
// Description: Returns the child of this node whose name is the
// indicated string, or NULL if there is no child of
// this node by that name. Does not search recursively.
////////////////////////////////////////////////////////////////////
EggNode *EggGroupNode::
find_child(const string &name) const {
Children::const_iterator ci;
for (ci = _children.begin(); ci != _children.end(); ++ci) {
EggNode *child = (*ci);
if (child->get_name() == name) {
return child;
}
}
return NULL;
}
////////////////////////////////////////////////////////////////////
// Function: EggGroupNode::resolve_filenames

View File

@ -109,6 +109,8 @@ public:
PT(EggNode) remove_child(PT(EggNode) node);
void steal_children(EggGroupNode &other);
EggNode *find_child(const string &name) const;
void resolve_filenames(const DSearchPath &searchpath);
void reverse_vertex_ordering();