pfdCleanTree(3pf) OpenGL Performer 3.2.2 libpfdu Reference Pages
NAME
pfdFreezeTransforms, pfdCleanTree, pfdReplaceNode, pfdInsertGroup,
pfdRemoveGroup - Scene graph optimizations
FUNCTION SPECIFICATION
#include <Performer/pfdu.h>
pfNode * pfdFreezeTransforms(pfNode *node, pfuTravFuncType func);
pfNode * pfdCleanTree(pfNode *node, pfuTravFuncType func);
void pfdReplaceNode(pfNode *oldn, pfNode *newn);
void pfdInsertGroup(pfNode *oldn, pfGroup *grp);
void pfdRemoveGroup(pfGroup *oldn);
DESCRIPTION
pfdCleanTree traverses the scene graph rooted at node and removes
redundant and empty pfGroups from the scene graph. It also converts any
pfSCS with an identity transformation into a pfGroup.
By default, pfGroups are eliminated if they have one or fewer children.
Any children are reparented to the parent of the pfGroup being
eliminated. The one exception is a pfSwitch node with one child, which
is not eliminated. An optional function func can be provided to alter
this determination during the traversal. At each candidate pfGroup, func
is passed a pfuTraverser which includes the current node. If func
returns TRUE, the current node is eliminated. If func returns FALSE, the
current node is retained.
pfdFreezeTransforms traverses the scene graph rooted at node and converts
pfDCSes to pfSCSes. Usually in preparation for a subsequent call to
pfFlatten. By default the conversion occurs for those pfDCSes that don't
have any callbacks and do not have the string "dcs" or "DCS" embedded in
the node name. An optional function func can be provided to alter this
determination during the traversal. At each candidate pfGroup, func is
passed a pfuTraverser which includes the current node. If func returns
TRUE, the current node is converted. If func returns FALSE, the current
node remains a pfDCS.
pfdReplaceNode, pfdInsertGroup and pfdRemoveGroup are helper routines.
pfdReplaceNode replaces the node oldn with the node newn in the scene
graph, including reparenting newn to the oldn's parents and reparenting
oldn's children to newn. oldn is not deleted. Any callbacks, traversal
masks and the node name are also copied. pfdInsertGroup inserts the
group grp above oldn in the the scene graph. grp replaces oldn as a
child of all grp's parents. oldn becomes a child of grp. pfdRemoveGroup
removes oldn from the scene graph, reparenting all of oldn's children to
the parents of oldn. oldn is not deleted.
Page 1
pfdCleanTree(3pf) OpenGL Performer 3.2.2 libpfdu Reference Pages
SEE ALSO
pfFlatten
Page 2