pfGroup(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages pfGroup(3pf)NAME
pfNewGroup, pfGetGroupClassType, pfAddChild, pfInsertChild,
pfReplaceChild, pfRemoveChild, pfSearchChild, pfGetChild,
pfGetNumChildren, pfBufferAddChild, pfBufferRemoveChild - Create, modify,
and query a group node.
FUNCTION SPECIFICATION
#include <Performer/pf.h>
pfGroup * pfNewGroup(void);
pfType * pfGetGroupClassType(void);
int pfAddChild(pfGroup *group, pfNode *child);
int pfInsertChild(pfGroup *group, int index, pfNode *child);
int pfReplaceChild(pfGroup *group, pfNode *old, pfNode *new);
int pfRemoveChild(pfGroup *group, pfNode* child);
int pfSearchChild(pfGroup *group, pfNode* child);
pfNode * pfGetChild(const pfGroup *group, int index);
int pfGetNumChildren(const pfGroup *group);
int pfBufferAddChild(pfGroup *group, pfNode *child);
int pfBufferRemoveChild(pfGroup *group, pfNode *child);
PARENT CLASS FUNCTIONS
The OpenGL Performer class pfGroup is derived from the parent class
pfNode, so each of these member functions of class pfNode are also
directly usable with objects of class pfGroup. Casting an object of
class pfGroup to an object of class pfNode is taken care of
automatically. This is also true for casts to objects of ancestor
classes of class pfNode.
pfGroup * pfGetParent(const pfNode *node, int i);
int pfGetNumParents(const pfNode *node);
void pfNodeBSphere(pfNode *node, pfSphere *bsph, int mode);
int pfGetNodeBSphere(pfNode *node, pfSphere *bsph);
pfNode* pfClone(pfNode *node, int mode);
pfNode* pfBufferClone(pfNode *node, int mode, pfBuffer *buf);
int pfFlatten(pfNode *node, int mode);
int pfNodeName(pfNode *node, const char *name);
const char * pfGetNodeName(const pfNode *node);
pfNode* pfFindNode(pfNode *node, const char *pathName,
pfType *type);
Page 1
pfGroup(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages pfGroup(3pf)
pfNode* pfLookupNode(const char *name, pfType* type);
int pfNodeIsectSegs(pfNode *node, pfSegSet *segSet,
pfHit **hits[]);
void pfNodeTravMask(pfNode *node, int which, uint mask,
int setMode, int bitOp);
uint pfGetNodeTravMask(const pfNode *node, int which);
void pfNodeTravFuncs(pfNode* node, int which,
pfNodeTravFuncType pre, pfNodeTravFuncType post);
void pfGetNodeTravFuncs(const pfNode* node, int which,
pfNodeTravFuncType *pre, pfNodeTravFuncType *post);
void pfNodeTravData(pfNode *node, int which, void *data);
void * pfGetNodeTravData(const pfNode *node, int which);
void pfNodeTravMode(pfNode* node, int which, int mode,
int val);
int pfGetNodeTravMode(const pfNode* node, int which,
int mode);
Since the class pfNode is itself derived from the parent class pfObject,
objects of class pfGroup can also be used with these functions designed
for objects of class pfObject.
void pfUserDataSlot(pfObject *obj, int slot, void *data);
void pfUserData(pfObject *obj, void *data);
void* pfGetUserDataSlot(pfObject *obj, int slot);
void* pfGetUserData(pfObject *obj);
int pfGetNumUserData(pfObject *obj);
int pfGetNamedUserDataSlot(const char *name);
const char* pfGetUserDataSlotName(int slot);
int pfGetNumNamedUserDataSlots(void);
int pfDeleteGLHandle(pfObject *obj);
Since the class pfObject is itself derived from the parent class
pfMemory, objects of class pfGroup can also be used with these functions
designed for objects of class pfMemory.
pfType * pfGetType(const void *ptr);
int pfIsOfType(const void *ptr, pfType *type);
int pfIsExactType(const void *ptr, pfType *type);
const char * pfGetTypeName(const void *ptr);
int pfRef(void *ptr);
int pfUnref(void *ptr);
int pfUnrefDelete(void *ptr);
int pfUnrefGetRef(void *ptr);
int pfGetRef(const void *ptr);
int pfCopy(void *dst, void *src);
int pfDelete(void *ptr);
int pfIsFluxed(void *ptr);
int pfCompare(const void *ptr1, const void *ptr2);
Page 2
pfGroup(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages pfGroup(3pf)
void pfPrint(const void *ptr, uint which, uint verbose,
FILE *file);
void * pfGetArena(void *ptr);
PARAMETERS
group identifies a pfGroup.
DESCRIPTION
A pfGroup is the internal node type of the OpenGL Performer hierarchy and
is derived from pfNode. A pfGroup has a list of children which are
traversed when group is traversed. Children may be any pfNode which
includes both internal nodes (pfGroups) and leaf nodes (pfNodes). Other
nodes which are derived from pfGroup may use pfGroup API. OpenGL
Performer nodes derived from pfGroup are:
pfScene
pfSwitch
pfLOD
pfSequence
pfLayer
pfSCS
pfDCS
pfMorph
pfNewGroup creates and returns a handle to a pfGroup. Like other
pfNodes, pfGroups are always allocated from shared memory and can be
deleted using pfDelete.
pfGetGroupClassType returns the pfType* for the class pfGroup. The
pfType* returned by pfGetGroupClassType is the same as the pfType*
returned by invoking pfGetType on any instance of class pfGroup. Because
OpenGL Performer allows subclassing of built-in types, when decisions are
made based on the type of an object, it is usually better to use
pfIsOfType to test if an object is of a type derived from a Performer
type rather than to test for strict equality of the pfType*'s.
pfAddChild appends child to group and increments the reference count of
child. pfRemoveChild removes child from the list and shifts the list
down over the vacant spot, e.g. - if child had index 0, then index 1
becomes index 0, index 2 becomes index 1 and so on. pfRemoveChild
returns a 1 if child was actually removed and 0 if it was not found in
the list. pfRemoveChild decrements the reference count of child but does
not delete child if its reference count reaches 0.
pfInsertChild inserts child before the child with index index. index
must be within the range 0 to pfGetNumChildren(group).
pfReplaceChild replaces old with new and returns 1 if the operation was
successful or 0 if old is not a child of group.
pfSearchChild returns the index of child if it was found in the children
list of group or -1 if it was not found.
Page 3
pfGroup(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages pfGroup(3pf)
pfGetNumChildren returns the number of children in group. pfGetChild
returns a handle to the child with index index or NULL if the index is
out of range.
The bounding volume of a pfGroup encompasses all its children.
Modifications to the child list of a pfGroup will cause OpenGL Performer
to recompute new bounding volumes for the pfGroup unless it is configured
to use static bounding volumes (see pfNodeBSphere).
pfBufferAddChild and pfBufferRemoveChild provide access to nodes that do
not exist in the current pfBuffer (See the pfBuffer man page). Either,
none, or both of group and node may exist outside the current pfBuffer.
pfBufferAddChild and pfBufferRemoveChild act just like their non-buffered
counterparts pfAddChild and pfRemoveChild except that the addition or
removal request is not carried out immediately but is recorded by the
current pfBuffer. The request is delayed until the first pfMergeBuffer
when both group and node are found in the main OpenGL Performer pfBuffer.
The list of pfBufferAddChild and pfBufferRemoveChild requests is
traversed in pfMergeBuffer after all nodes have been merged.
pfBufferAddChild and pfBufferRemoveChild return TRUE if the request was
recorded and FALSE otherwise.
SEE ALSO
pfLookupNode, pfNode, pfBuffer, pfDelete
Page 4