Re: function of 'registerNode' in Performer 1.2 flt loader

New Message Reply Date view Thread view Subject view Author view

Lance R. Marrou (marrou++at++vsl.ist.ucf.edu)
Tue, 13 Feb 1996 08:54:53 -0500


On Feb 13, 11:06am, (Mario Veraart) wrote:
> Subject: function of 'registerNode' in Performer 1.2 flt loader
> Hello Performer users,
>
> I'm working on a port of an application from performer 1.2
> to 2.0. This application uses a third party library that some
> performer calls to the flight loader. The only thing I can't find
> in the flight loader that comes with performer 2.0 is an
> equavalent of the
> void (*registerNode)(pfNode *,int mgOpt, COMMENTcb com)
> variable.
> My question: what is the purpose of the function pointed at and
> how can I emmulate it's function with the
> performer 2.0 flight loader?
>
> Thanks in advance
> Mario Veraart
>
>-- End of excerpt from (Mario Veraart)

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

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:24 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.