Lance R. Marrou (marrou++at++vsl.ist.ucf.edu)
Tue, 13 Feb 1996 08:54:53 -0500
Although I'm sure Marcus will respond as well...You can use the pfd functions
to set the Flight loader register callback function. The purpose of this
function is to allow the application program access to the geometry scene and
the Flight structures as the files are loaded in. Here's an example (with 1.2
source as well):
#if (PF_MAJOR_VERSION >= 2)
#include "pfdu.h"
#include "pfdb/pfflt.h"
#else
#include "pfsgi.h"
#include "pfflt.h"
#endif
void geomGenCB( pfNode *node, int mgOp, int *cbs, COMMENTcb *cbcom );
...
// load function
#if PF_MAJOR_VERSION >= 2
fltRegisterNodeT *tmp = (fltRegisterNodeT *)pfdGetConverterAttr(
"flt", PFFLT_REGISTER_NODE);
fltRegisterNodeT func = geomGenCB;
pfdConverterAttr("flt",PFFLT_REGISTER_NODE,&func);
geomelem.node = (pfGroup *)pfdLoadFile(filename);
pfdConverterAttr("flt",PFFLT_REGISTER_NODE,tmp);
#else
void *tmp = registerNode;
registerNode = geomGenCB;
geomelem.node = (pfGroup *)LoadFile(filename,NULL);
registerNode = (void (*)(pfNode *,int,int *,COMMENTcb *))tmp;
#endif
...
void geomGenCB( pfNode *node, int mgOp, int *cbs, COMMENTcb *cbcom )
{
switch (mgOp)
{
case CB_DOF:
{
pfDCS *dcs = (pfDCS *) node;
DOFcb *dof = (DOFcb *) cbs;
if (dcs && dof)
pfUserData(dcs,dof);
else
{
if (cbs) pfFree(cbs);
if (cbcom) pfFree(cbcom);
}
}
break;
/* case CB_HEADER: */
/* case CB_GROUP: */
/* case CB_LOD: */
/* case CB_OBJECT: */
/* case CB_PUSH: */
/* case CB_POP: */
/* case CB_EYEPOINTS: */
/* case CB_SOUND: */
/* case CB_SWITCH: */
/* case CB_IMPOSSIBLE: */
/* case CB_CLEANNODE: */
default:
if (cbs) pfFree(cbs);
if (cbcom) pfFree(cbcom);
break;
}
}
A similar example is provided directly by MultiGen, Inc. and I think it is in
the release.
--
______________________________________________________________________________
/\ ______ /\____ ______ ______ E-mail: marrou++at++vsl.ist.ucf.edu
Visual / / / _ / / __ // ____// ____/ VSL: (407)658-5074
Systems / /__ / /_/ / / / / // /___ / __/_ R. Marrou Fax: (407)658-5059
Lab /____//____/\\/_/ /_//_____//_____/ http://www.vsl.ist.ucf.edu/~marrou
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:24 PDT