pfGeoSetCB(3pf) OpenGL Performer 3.2.2 libpr C Reference Pages
NAME
pfNewGSetCB, pfGetGSetCBClassType, pfGSetCBDrawCB, pfGetGSetCBDrawCB,
pfGetGSetCBDrawCBData - A geometry set with a draw callback.
FUNCTION SPECIFICATION
#include <Performer/pr.h>
pfGeoSetCB * pfNewGSetCB(void *arena);
pfType * pfGetGSetCBClassType(void);
void pfGSetCBDrawCB(pfGeoSetCB* gsetcb, pfGSetCBType cb,
void *data);
pfGSetCBType pfGetGSetCBDrawCB(pfGeoSetCB* gsetcb);
void* pfGetGSetCBDrawCBData(pfGeoSetCB* gsetcb);
typedef void (*pfGSetCBType)(pfGeoSet *, void *);
PARENT CLASS FUNCTIONS
The OpenGL Performer class pfGeoSetCB is derived from the parent class
pfGeoSet, so each of these member functions of class pfGeoSet are also
directly usable with objects of class pfGeoSetCB. Casting an object of
class pfGeoSetCB to an object of class pfGeoSet is taken care of
automatically. This is also true for casts to objects of ancestor
classes of class pfGeoSet.
void pfCompileGSet(pfGeoSet *gset);
void pfDrawGSet(pfGeoSet *gset);
void pfDrawHlightedGSet(pfGeoSet* gset);
void pfGSetNumPrims(pfGeoSet *gset, int num);
int pfGetGSetNumPrims(const pfGeoSet *gset);
void pfGSetPrimType(pfGeoSet *gset, int type);
int pfGetGSetPrimType(const pfGeoSet *gset);
void pfGSetPrimLengths(pfGeoSet* gset, int *lengths);
int * pfGetGSetPrimLengths(const pfGeoSet* gset);
int pfGetGSetPrimLength(const pfGeoSet* gset, int i);
void pfGSetAttr(pfGeoSet *gset, int attr, int bind,
void *alist, ushort *ilist);
int pfGetGSetAttrBind(const pfGeoSet *gset, int attr);
void pfGetGSetAttrLists(const pfGeoSet *gset, int attr,
void **alist, ushort **ilist);
int pfGetGSetAttrRange(const pfGeoSet *gset, int attr,
int *minIndex, int *maxIndex);
Page 1
pfGeoSetCB(3pf) OpenGL Performer 3.2.2 libpr C Reference Pages
void pfGSetMultiAttr(pfGeoSet *gset, int attr, int index,
int bind, void *alist, ushort *ilist);
int pfGetGSetMultiAttrBind(const pfGeoSet *gset, int attr,
int index);
void pfGetGSetMultiAttrLists(const pfGeoSet *gset, int attr,
int index, void **alist, ushort **ilist);
int pfGetGSetMultiAttrRange(const pfGeoSet *gset, int attr,
int index, int *minIndex, int *maxIndex);
void pfGSetDecalPlane(pfGeoSet *gset, pfPlane *plane);
pfPlane * pfGetGSetDecalPlane(pfGeoSet *gset);
void pfGSetDrawMode(pfGeoSet *gset, int mode, int val);
int pfGetGSetDrawMode(const pfGeoSet *gset, int mode);
void pfGSetGState(pfGeoSet *gset, pfGeoState *gstate);
pfGeoState * pfGetGSetGState(const pfGeoSet *gset);
void pfGSetGStateIndex(pfGeoSet *gset, int id);
int pfGetGSetGStateIndex(const pfGeoSet *gset);
void pfGSetLineWidth(pfGeoSet *gset, float width);
float pfGetGSetLineWidth(const pfGeoSet *gset);
void pfGSetPntSize(pfGeoSet *gset, float size);
float pfGetGSetPntSize(const pfGeoSet *gset);
void pfGSetHlight(pfGeoSet* gset, pfHighlight *hlight);
pfHighlight * pfGetGSetHlight(const pfGeoSet* gset);
void pfGSetDrawBin(pfGeoSet *gset, short bin);
int pfGetGSetDrawBin(const pfGeoSet *gset);
void pfGSetDrawOrder(pfGeoSet * gset, unsigned int order);
unsigned int pfGetGSetDrawOrder(const pfGeoSet *gset)
void pfGSetPassFilter(uint mask);
uint pfGetGSetPassFilter(void);
void pfHideGSetStripPrim(const pfGeoSet* gset, int i);
void pfUnhideGSetStripPrim(const pfGeoSet* gset, int i);
int pfIsGSetStripPrimHidden(const pfGeoSet* gset, int i);
int pfQueryGSet(const pfGeoSet* gset, uint which,
void* dst);
int pfMQueryGSet(const pfGeoSet* gset, uint* which,
void* dst);
void pfGSetBBox(pfGeoSet *gset, pfBox *box, int mode);
int pfGetGSetBBox(pfGeoSet *gset, pfBox *box);
void pfGSetBBoxFlux(pfGeoSet *gset, pfFlux *flux);
pfFlux* pfGetGSetBBoxFlux(pfGeoSet *gset);
void pfGSetIsectMask(pfGeoSet *gset, uint mask, int setMode,
int bitOp);
uint pfGetGSetIsectMask(pfGeoSet *gset);
int pfGSetIsectSegs(pfGeoSet *gset, pfSegSet *segSet,
pfHit **hits[]);
void pfGSetPassList(pfGeoSet *gset, pfPassList *passList);
pfPassList * pfGetGSetPassList(pfGeoSet *gset);
void pfGSetUpdateCteRefs(pfGeoSet *gset);
void pfGSetCalcTexBBox(pfGeoSet *gset);
void pfGSetTexBBox_i(pfGeoSet *gset, uint centerS,
uint centerT, uint halfwidth, uint halfheight);
Page 2
pfGeoSetCB(3pf) OpenGL Performer 3.2.2 libpr C Reference Pages
void pfGSetTexBBox_f(pfGeoSet *gset, float minS, float maxS,
float minT, float maxT);
int pfGetGSetTexBBox_i(pfGeoSet *gset, uint* centerS,
uint* centerT, uint* halfwidth, uint* halfheight);
int pfGetGSetTexBBox_f(pfGeoSet *gset, float* minS,
float* maxS, float* minT, float* maxT);
void pfGSetCteAttr(pfGeoSet *gset, int which, void* val);
void* pfGetGSetCteAttr(pfGeoSet *gset, int which);
void pfGSetAppearance(pfGeoSet *gset,
islAppearance *appearance);
islAppearance* pfGetGSetAppearance(const pfGeoSet* gset);
int pfGSetIsShaded(pfGeoSet *gset);
void pfQuickCopyGSet(pfGeoSet *gset, pfGeoSet *src);
void pfGSetQuickAttr(pfGeoSet *gset, int _attr, void* _alist,
unsigned short* _ilist);
void pfGSetQuickMultiAttr(pfGeoSet *gset, int _attr,
int _index, void* _alist, unsigned short* _ilist);
void pfGSetQuickPrimLengths(pfGeoSet *gset, int *_lengths);
void pfQuickResetGSet(pfGeoSet *gset, int extRefOnly);
void pfGSetOptimize(int _state);
int pfGetGSetOptimize(void);
int pfFluxedGSetInit(pfFluxMemory *fmem);
Since the class pfGeoSet is itself derived from the parent class
pfObject, objects of class pfGeoSetCB 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 pfGetGLHandle(pfObject *obj);
int pfDeleteGLHandle(pfObject *obj);
Since the class pfObject is itself derived from the parent class
pfMemory, objects of class pfGeoSetCB 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);
Page 3
pfGeoSetCB(3pf) OpenGL Performer 3.2.2 libpr C Reference Pages
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);
void pfPrint(const void *ptr, uint which, uint verbose,
FILE *file);
void * pfGetArena(void *ptr);
PARAMETERS
gsetcb identifies a pfGeoSet.
DESCRIPTION
A pfGetSetCB is a subclass of pfGeoSet. It provides a back door for
complete application control over the drawing operation of some geometry.
A pfGetSetCB never draws its internal geometry. It doesn't even have to
have any attributes specified. Instead, the application has to specify a
callback frunction for drawing the pfGetSetCB. Performer calls this
callback function When this pfGetSetCB has to be drawn.
pfNewGSetCB creates and returns a handle to a pfGeoSetCB. arena
specifies a malloc arena out of which the pfGeoSetCB is allocated or NULL
for allocation off the process heap. pfGeoSetCBs can be deleted with
pfDelete.
pfGSetCBDrawCB sets the draw callback and user data for a pfGetSetCB. The
provided callback function is called when this pfGeoSetCB is drawn.
pfGetGSetCBDrawCB and pfGetGSetCBDrawCBData return the contents of the
current draw callback and callback-data on a pfGeoSetCB.
Code examples
The following code sample creates a pfGeoSetCB, sets a static bounding
box, adds a transparent pfGeoState, and adds the pfGeoSetCB to a pfGeode.
The draw callback drawCB will be called when Performer draws the
transparent bin.
pfGeode *geode = pfNewGeode(pfGetSharedArena());
pfGeoSetCB *gsetCB = pfNewGeoSetCB(pfGetSharedArena());
pfBox box;
pfGeoState *gstate = pfNewGeoState(pfGetSharedArena());
box . min[0] = -SIZE;
box . min[1] = -SIZE;
box . min[2] = -SIZE;
box . max[0] = SIZE;
box . max[1] = SIZE;
Page 4
pfGeoSetCB(3pf) OpenGL Performer 3.2.2 libpr C Reference Pages
box . max[2] = SIZE;
/*
* Must set a static bounding box on the geoset. This geoset has no
* explicit geometry so Performer has no way to compute its bounding
* box.
*/
pfGSetBBox (gsetCB, &box, PFBOUND_STATIC);
pfGSetCBDrawCB (gsetCB, drawCB, NULL);
pfMakeBasicGState(gstate);
/*
* Request high-quality transparency. This geoset will be
* drawn in the transparent bin - following all opaque geometry.
* In other words, the draw callback will be called after drawing all
* opaque geometry.
*/
pfGStateMode(gstate, PFSTATE_TRANSPARENCY, PFTR_HIGH_QUALITY);
pfGSetGState(gsetCB, gstate);
pfAddGSet(geode, gsetCB);
NOTES
Performer sorts a pfGeoSetCB - just like any other pfGeoSet - based on
its pfGeoState. For example, setting the pfGeoState mode using
pfGStateMode(gstate, PFSTATE_TRANSPARENCY, PFTR_HIGH_QUALITY); the
pfGeoSetCB is drawn in the transparent bin, following all opaque
geometry.
Performer doesn't know the extent of the geometry that the draw callback
draws. Therefore, it can not automatically compute the bounding box of a
pfGeoSetCB. It is the application responsibility to set the pfGeoSetCB
bounding box using pfGeoSetBound(..., PFBOUND_STATIC).
Performer invokes the draw callback after loading the pfGeoState on this
pfGeoSetCB into OpenGL. Any state changes that the drawing callback makes
must be restored to their original state before returning control. The
pfGeoSetCB is a light-weight callback, hence Performer doesn't call state
push/pop around the callback.
SEE ALSO
pfGeoSet, pfApplyGState, pfColortable, pfCopy, pfCycleBuffer, pfDecal,
pfDelete, pfDisable, pfDispList, pfEnable, pfFlux, pfFluxMemory,
pfGSetDrawMode, pfGeoState, pfHit, pfLPointState, pfMalloc, pfMaterial,
Page 5
pfGeoSetCB(3pf) OpenGL Performer 3.2.2 libpr C Reference Pages
pfNewHlight, pfObject, pfGSetIsectSegs, pfShadeModel, pfState,
pfuFillGSetPackedAttrs, pfuTravCreatePackedAttrs, pfShader,
pfShaderManager
Page 6