pfGroup(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages pfGroup(3pf)NAMEpfGroup - Create, modify, and query a group node.
FUNCTION SPECIFICATION
#include <Performer/pf/pfGroup.h>
pfGroup::pfGroup();
static pfType * pfGroup::getClassType(void);
int pfGroup::addChild(pfNode *child);
int pfGroup::insertChild(int index, pfNode *child);
int pfGroup::replaceChild(pfNode *old, pfNode *new);
int pfGroup::removeChild(pfNode* child);
int pfGroup::searchChild(pfNode* child);
pfNode * pfGroup::getChild(int index);
int pfGroup::getNumChildren(void);
int pfGroup::bufferAddChild(pfNode *child);
int pfGroup::bufferRemoveChild(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. This is also true for
ancestor classes of class pfNode.
pfGroup * pfNode::getParent(int i);
int pfNode::getNumParents(void);
void pfNode::setBound(pfSphere *bsph, int mode);
int pfNode::getBound(pfSphere *bsph);
pfNode* pfNode::clone(int mode);
pfNode* pfNode::bufferClone(int mode, pfBuffer *buf);
int pfNode::flatten(int mode);
int pfNode::setName(const char *name);
const char * pfNode::getName(void);
pfNode* pfNode::find(const char *pathName, pfType *type);
pfNode* pfNode::lookup(const char *name, pfType* type);
int pfNode::isect(pfSegSet *segSet, pfHit **hits[]);
void pfNode::setTravMask(int which, uint mask, int setMode,
int bitOp);
uint pfNode::getTravMask(int which);
void pfNode::setTravFuncs(int which, pfNodeTravFuncType pre,
pfNodeTravFuncType post);
Page 1
pfGroup(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages pfGroup(3pf)
void pfNode::getTravFuncs(int which, pfNodeTravFuncType *pre,
pfNodeTravFuncType *post);
void pfNode::setTravData(int which, void *data);
void * pfNode::getTravData(int which);
void pfNode::setTravMode(int which, int mode, int val);
int pfNode::getTravMode(int which, int mode) const;
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* pfObject::operator new(size_t);
void* pfObject::operator new(size_t, pfFluxMemory *fmem);
void pfObject::setUserData(void *data);
void pfObject::setUserData(int slot, void *data);
void* pfObject::getUserData(pfObject *obj);
void* pfObject::getUserData(pfObject *obj, int slot);
int pfObject::getNumUserData();
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.
void* pfMemory::getData(const void *ptr);
pfType * pfMemory::getType();
int pfMemory::isOfType(pfType *type);
int pfMemory::isExactType(pfType *type);
const char * pfMemory::getTypeName();
int pfMemory::copy(pfMemory *src);
int pfMemory::compare(const pfMemory *mem);
void pfMemory::print(uint which, uint verbose, char *prefix,
FILE *file);
int pfMemory::getArena(void *ptr);
void* pfMemory::getArena();
int pfMemory::ref();
int pfMemory::unref();
int pfMemory::unrefDelete();
int pfMemory::unrefGetRef();
int pfMemory::getRef();
int pfMemory::checkDelete();
int pfMemory::isFluxed();
void * pfMemory::getArena();
int pfMemory::getSize();
PARAMETERS
group identifies a pfGroup.
Page 2
pfGroup(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages pfGroup(3pf)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
new pfGroup creates and returns a handle to a pfGroup. Like other
pfNodes, pfGroups are always allocated from shared memory and cannot be
created statically, on the stack or in arrays. pfGroups should be
deleted using pfDelete rather than the delete operator.
pfGroup::getClassType returns the pfType* for the class pfGroup. The
pfType* returned by pfGroup::getClassType is the same as the pfType*
returned by invoking the virtual function getType 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 the member function isOfType 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.
pfGroup::addChild appends child to the pfGroup and increments the
reference count of child. pfGroup::removeChild 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.
pfGroup::removeChild returns a 1 if child was actually removed and 0 if
it was not found in the list. pfGroup::removeChild decrements the
reference count of child but does not delete child if its reference count
reaches 0.
pfGroup::insertChild inserts child before the child with index index.
index must be within the range 0 to pfGroup::getNumChildren().
pfGroup::replaceChild replaces old with new and returns 1 if the
operation was successful or 0 if old is not a child of the pfGroup.
pfGroup::searchChild returns the index of child if it was found in the
children list of the pfGroup or -1 if it was not found.
pfGroup::getNumChildren returns the number of children in the pfGroup.
pfGroup::getChild returns a handle to the child with index index or NULL
if the index is out of range.
Page 3
pfGroup(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages pfGroup(3pf)
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 pfNode::setBound).
pfGroup::bufferAddChild and pfGroup::bufferRemoveChild provide access to
nodes that do not exist in the current pfBuffer (See the pfBuffer man
page). Either, none, or both of the pfBuffer and node may exist outside
the current pfBuffer. pfGroup::bufferAddChild and
pfGroup::bufferRemoveChild act just like their non-buffered counterparts
pfGroup::addChild and pfGroup::removeChild 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 pfBuffer::merge
when both the parent pfGroup and node are found in the main OpenGL
Performer pfBuffer. The list of pfGroup::bufferAddChild and
pfGroup::bufferRemoveChild requests is traversed in pfBuffer::merge after
all nodes have been merged. pfGroup::bufferAddChild and
pfGroup::bufferRemoveChild return TRUE if the request was recorded and
FALSE otherwise.
SEE ALSO
pfNode, pfBuffer, pfDelete
Page 4