From: Brian Furtaw (brian++at++sgi.com)
Date: 06/15/2000 06:41:36
I assume you mean the bead callback mechanism. You should read the file
/usr/share/Performer/src/lib/libpfdb/libpfflt/README.FLT.R15_3 it
contains some pretty good information about the bead callbacks. Below is
a recent implementation of a bead callback I got to work. I don't know
if you will be able to do what you want though. Your best bet to change
DOS pathes to UNIX is a perl script that modifes the path strings in
place. If you change all the "\" "/" and remove the "F:\" you can use
the PFPATH variable to find the database. I know the Multigen website
is not altogether working at this point but I was able to download the
OpenFlight API pdf file which explains how to parse a flt file. Get it
from the www.multigen.com/ in the Technical Resources->Documentation
section.
Here is the components of a sample implementation:
#include <Performer/pfdb/pfflt.h>
...
extern void beadCallBack
( pfNode* node, int mgOp, int* cbs, COMMENTcb* cbcom, void* userData );
...
// Before the call to pfConfig()
pfdInitConverter(DatabaseFiles[i]);
fltRegisterNodeT pFunc = beadCallBack;
void* hFunc = & pFunc;
if (strsuffix(DatabaseFiles[i], ".flt")) {
pfdConverterAttr("flt", PFFLT_REGISTER_NODE, hFunc);
pfNotify(PFNFY_NOTICE, PFNFY_PRINT, "Registered bead callback");
}
...
void beadCallBack
( pfNode* node, int mgOp, int* cbs, COMMENTcb* cbcom, void* userData )
{
pfNotify(PFNFY_NOTICE, PFNFY_PRINT, "Bead Op: %d", mgOp);
switch ( mgOp )
{
case CB_HEADER:
case CB_LOD:
case CB_PUSH:
case CB_POP:
case CB_DOF:
case CB_EYEPOINTS:
case CB_SOUND:
case CB_PATH:
case CB_SWITCH:
case CB_LIGHTSRC: if ( cbs ) pfFree( cbs );
if ( cbcom ) pfFree( cbcom );
break;
case CB_CLEANNODE: break;
case CB_CLONE: break;
case CB_GROUP:
case CB_OBJECT: if ( cbs ) pfFree( cbs );
if ( cbcom ) {
pfNotify(PFNFY_NOTICE, PFNFY_PRINT, "Comment field: \"%s\"",
cbcom->text);
pfFree( cbcom );
}
break;
default: if ( cbs ) pfFree( cbs );
if ( cbcom ) pfFree( cbcom ); break;
}
}
Devrim Erdem wrote:
>
> Hi,
>
> I am trying to use pfdConverterAttr to setup a callback for the FLT
> loader. The header has almost no doc. in it and multigen site has a
> deadlink to the man page for the loader. I need to rename a node in the
> flt file which is an external. How can I set a callback to do that ?
>
> PS. performer find doesn't work with node names like "F:\data\file.flt",
> thats way I need to this trick.
>
> Thanks,
>
> --
> /*===============================================
> M. Devrim Erdem devrim++at++infotron.com.tr
> Software Engineering
>
> info(+)TRON, Turkey
> Tel: +90 216 4921002, Ext 138
> Fax: +90 216 3432132
> http://www.infotron-tr.com
> http://abone.turk.net/mderdem
> ===============================================*/
>
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
--
----oOOo---- ----oOOo---- ----oOOo---- ----oOOo----
Brian Furtaw (brian++at++sgi.com)
Graphics Guru Office:(301)572-3293 Fax: (603)250-0370
12200-G Plum Orchard Drive OpenGL/Performer/OpenInventor/ImageVision
Silver Spring, Maryland 20904 Volumizer/Optimizer/React/PCI Device
Drivers
This archive was generated by hypermail 2b29 : Thu Jun 15 2000 - 06:45:22 PDT