Is there no routine to find Geode under constructed tree?

New Message Reply Date view Thread view Subject view Author view

Masahiko Yamanaka (wry++at++dimwit.dst.nk-exa.co.jp)
Wed, 19 Jan 94 15:31:32 +0900


I wanted to use pfBillboard( a kind of pfGeode ).
Models had been constructed with MultiGen.

When I used pfBillboard, I did follows...

  pfBillboard *bboard = pfNewBboard;
  pfAddGSet( (pfGeode *)bboard, geoSet );

So, I had to find the geoSet from the top node of MultiGen data structure.
And made a following routine.

pfGeode *
findGeode( pfNode *group )
{
  long n1 = pfGetNumChildren( group );
  long i;
  for( i=0; i<n1; i++ )
  {
    pfNode *child = pfGetChild( group, i );
    if( pfGetType( (void *)child ) & PFTYPE_GEODE ) return (pfGeode *)child;
    if( pfGetType( (void *)child ) & PFTYPE_GROUP )
    {
      pfGeode *geode;
      if( (geode = findGeode( child )) != NULL ) return geode;
    }
  }
  return NULL;
}

My MultiGen data file has only one geode.
This routine has been executed well for me.

But, if there is really no routine to find Geode in Performer, I think it is better
that there is a routine like mine.

How do you think abount this?


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:09 PDT

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