Re: Performer loading Getting Stats

New Message Reply Date view Thread view Subject view Author view

Michael Jones (mtj++at++babar)
Mon, 9 Jan 1995 09:01:15 -0800


If what you really want is aggregate database stats, you can
use Sharon's pfuTravCountDB() function from the utility
library. That's what I did in the new Inventor loader. Here's
the way to do it:

    :
    :

    /* print statistics about file importation process */
    if (pfGetNotifyLevel() >= PFNFY_INFO)
    {
        float totalPrims = 0.0f;

        static float ftmp[4];
        static unsigned int qtmp[4] =
        {
            PFFSTATS_BUF_CUR | PFSTATSVAL_GFX_GEOM_TRIS,
            PFFSTATS_BUF_CUR | PFSTATSVAL_GFX_GEOM_LINES,
            PFFSTATS_BUF_CUR | PFSTATSVAL_GFX_GEOM_POINTS,
            NULL
        };

        fprintf(stderr, "LoadIv:\n");

        fprintf(stderr, " file name = %s\n", fileName);
        if (strcmp(fileName, filePath) != 0)
            fprintf(stderr, " full file path = %s\n", filePath);

        if (sceneGraph != NULL)
        {
            pfFrameStats *fs = pfNewFStats();

            /* traverse scene graph and tabulate contents */
            pfuTravCountDB(sceneGraph, fs);

            /* extract values from tabulated statistics */
            pfMQueryStats(fs, qtmp, ftmp);

            /* print information about scene graph contents */
            fprintf(stderr, " triangles = %8d\n", (int)ftmp[0]);
            fprintf(stderr, " lines = %8d\n", (int)ftmp[1]);
            fprintf(stderr, " points = %8d\n", (int)ftmp[2]);
            totalPrims = ftmp[0] + ftmp[1] + ftmp[2];
            fprintf(stderr, " total primitives = %8d\n", (int)totalPrims);

            /* discard stats structure */
            pfDelete(fs);
        }

-- 

Be seeing you, Phone:415.390.1455 Fax:415.390.2658 M/S:8U-590 Michael T. Jones Silicon Graphics, Advanced Graphics Division mtj++at++sgi.com 2011 N. Shoreline Blvd., Mtn. View, CA 94039-7311


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:50:51 PDT

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