Extracting from pfGeoSet

New Message Reply Date view Thread view Subject view Author view

From: Chris Scharver (scharver++at++evl.uic.edu)
Date: 02/28/2001 08:58:03


Hi.

What's the correct process to extract data from a pfGeoSet? I cannot seem
to get the vertex data for the PFGS_COORD3 attribute. I check the number
of primitives, I get the attribute rangem and then I call getAttrLists;

int numgsets = gd->getNumGSets();
pfGeoSet *gs = ((pfGeode*) obj)->getGSet( 0 );
int bind = gs->getAttrBind( PFGS_COORD3 );
int rMax;
int nverts = gs->getAttrRange( PFGS_COORD3, NULL, &rMax );
void **verts;
ushort **vindex;
gs->getAttrLists( PFGS_COORD3, verts, vindex );
for (int i=0; i<gs->getNumPrims(); i++)
{
        cout << "Length of prim "<<i<<": "<<gs->getPrimLength( i )<<endl;
        for (int j=0; j<gs->getPrimLength( i ); j++)
        {
                cout << "("
                     << ((pfVec3*)verts)[i+j][0] << " "
                     << ((pfVec3*)verts)[i+j][1] << " "
                     << ((pfVec3*)verts)[i+j][2] << ") ";
        }
        cout << endl;
}

Right now I'm just trying to print out the vertices as I parse through the
geoset. However, I'm getting all 0's. Do I need to allocate memory for
the pointer before I call getAttrLists, or does Performer directly pass
the base pointer from within the geoset? The man pages aren't too clear
a,d I couldn't find anything useful in the Insight books.

Thanks,
Chris
__________________________________________________________________________
Chris Scharver EECS Graduate Student
Electronic Visualization Laboratory EVL Phone: 312-996-3002
The University of Illinois at Chicago EVL FAX: 312-413-7585
1998-1999 UIC Men's Swimming and Diving


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Feb 28 2001 - 08:58:09 PST

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