pfScene(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages pfScene(3pf)NAMEpfScene - Create a scene or root node, set and get scene pfGeoState or
pfGeoState index.
FUNCTION SPECIFICATION
#include <Performer/pf/pfScene.h>
pfScene::pfScene();
static pfType * pfScene::getClassType(void);
void pfScene::setGState(pfGeoState *gstate);
pfGeoState * pfScene::getGState(void);
void pfScene::setGStateIndex(int index);
int pfScene::getGStateIndex(void);
PARENT CLASS FUNCTIONS
The OpenGL Performer class pfScene is derived from the parent class
pfGroup, so each of these member functions of class pfGroup are also
directly usable with objects of class pfScene. This is also true for
ancestor classes of class pfGroup.
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);
Since the class pfGroup is itself derived from the parent class pfNode,
objects of class pfScene can also be used with these functions designed
for objects 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);
Page 1
pfScene(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages pfScene(3pf)
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);
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 pfScene 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 pfScene 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();
Page 2
pfScene(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages pfScene(3pf)
void * pfMemory::getArena();
int pfMemory::getSize();
PARAMETERS
gstate identifies a pfGeoState.
DESCRIPTION
A pfScene is the root of a hierarchical database which may be drawn or
intersected with. pfScene is derived from pfGroup so it can use pfGroup
and pfNode API. A pfScene may have children like a pfGroup but it cannot
be a child of another node. Its special purpose is to serve as the root
node of a scene graph.
new pfScene creates and returns a handle to a pfScene. Like other
pfNodes, pfTexts are always allocated from shared memory and cannot be
created statically, on the stack or in arrays. pfScenes should be
deleted using pfDelete rather than the delete operator.
pfScene::getClassType returns the pfType* for the class pfScene. The
pfType* returned by pfScene::getClassType is the same as the pfType*
returned by invoking the virtual function getType on any instance of
class pfScene. 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.
OpenGL Performer will automatically carry out the APP, CULL, and DRAW
traversals on pfScenes which are attached to pfChannels by pfChanScene.
The CULL and DRAW traversals are directly or indirectly triggered by
pfFrame while the APP traversal is triggered by pfAppFrame.
Multiple pfChannels may reference the same pfScene but each pfChannel
references only a single pfScene.
pfScene::setGState attaches gstate to the pfScene. The pfGeoState of a
pfScene defines the "global state" which may be inherited by other
pfGeoStates. This state inheritance mechanism is further described in the
pfGeoState man page.
The scene pfGeoState is defined as the global state by pfGeoState::load.
This pfGeoState will be loaded before the pfChannel DRAW callback (-
pfChannel::setTravFunc) is invoked so any custom rendering in the
callback will inherit the state set by the scene pfGeoState.
pfScene::getGState returns the directly referenced pfGeoState of the
pfScene or the appropriate pfGeoState in the global table if the pfScene
indexes its pfGeoState or NULL if the index cannot be resolved.
The scene pfGeoState may be indexed through a global table by assigning
an index with pfScene::setGStateIndex and specifying the table with
pfGeoState::applyTable. Usually this table is provided by the pfChannel
(pfChannel::setGStateTable). pfScene::getGStateIndex returns the
Page 3
pfScene(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages pfScene(3pf)
pfGeoState index of the pfScene or -1 if the pfScene directly references
its pfGeoState.
It is not necessary to provide a scene pfGeoState, but it is a convenient
way to specify the default inheritable values for all pfGeoState elements
on a per-scene basis.
SEE ALSO
pfChannel, pfGeoState, pfGroup, pfDelete
Page 4