pfHit->query core dump

New Message Reply Date view Thread view Subject view Author view

Dwight Meglan (dwight++at++ht.com)
Tue, 30 Jan 1996 11:19:54 -0400


Suggestions on the nature of this error (undoubtly of my own origin ;-)
would be appreciated. Here is a code snippet that dumps on the second pass
through the for loop below:

    float nX,nY;
    pfuCalcNormalizedChanXY(&nX,&nY,_channel,mousePos[0],mousePos[1]);

    pfHit **hits[10];
    int numHits= _channel->pick(PFPK_M_ALL | PFTRAV_IS_PRIM,nX,nY,0.0f,hits );

    if ( numHits <= 0 )
        return NULL;

    pfNode* hitNode= NULL;

    for (int j=0; j<numHits && j<10; j++)
      {
          (*hits[j])->query(PFQHIT_NODE,&hitNode);
          fprintf(stderr,"\nHit # %d on %s (pfType %s) with path:\n",
                  j,hitNode->getName(),hitNode->getTypeName());
          pfNode* node= hitNode->getParent(0);
          while ( node != NULL )
              {
                  fprintf(stderr,"Name: %s pfType:
%s\n",node->getName(),node->getTypeName());
                  node= node->getParent(0);
              }
      }

When j=0, I get a beautiful, correct printout of the path to the top of the
scenegraph. When j=1 (in the trial case here numHits was 3), the code bombs
inside pfHit->query at pfGeoSet.C line 3402. Since I don't have the source
I can't look at this. My best guess is that something is not right with how
I am passing hitNode to pfHit->query. The passing of &hitNode is based on
the code of lib/libpfui/pfiPick.C -- I initially assumed it was just
hitNode( since the call parameter is void* and I had a PfNode*) which
produced a core -- changing it to &hitNode works just fine, for one pass
that is...

Thanks in advance for advice,

--dwight

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dwight Meglan, PhD | Developers of complete surgery simulation
Engineering Coordinator | training systems and surgery simulation
High Techsplanations, Inc. | creation software tools
6001 Montrose Rd., Suite 902 |
Rockville, MD 20852-4874 | "Witty, yet erudite saying goes here..."
301 984 3706 x38 |
301 984 2104 : FAX |
dwight++at++ht.com | http://www.ht.com


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

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