Re: pfiPick Functions

New Message Reply Date view Thread view Subject view Author view

Andrew Shein (ashein++at++orac.boston.sgi.com)
Wed, 7 Aug 1996 22:16:38 -0400


Hope this helps. I did it to pick DCS's (which are all doors in my example)
if you ever have problems with the man pages in performer always look at
perfly or the other example source.
                                Andy

   befor things get going ...

   picker = new pfiPick();
   picker->addChan( channel );
   picker->setupChans();

   and in the main while loop

      if( mouse.flags & PFUDEV_MOUSE_LEFT_DOWN )
      {
         int hit_count;

         hit_count = picker->doPick( mouse.xpos, mouse.ypos );

         if( hit_count )
         {
            pfNode *node;
            pfNode *parent;

            node = picker->getNode();
            if( node != NULL )
            {
               cout << "node = " << node << "\n" << flush;
               cout << node->getName() << "\n" << flush;
               do
               {
                  parent = (pfNode *)node->getParent(0);
                  if( parent != NULL )
                  {
                     if( parent->isOfType( parent, pfDCS::getClassType() ) )
                     {
                        cout << "parent = " << parent << " name= " <<
parent->getName() << "\n" << flush;
                        picked_dcs = (pfDCS *)parent;
                        break;
                     }

                     node = parent;
                  }

               } while( parent != NULL );
            }

         } // end num_hits != 0

      } // end if PDEV_MOUSE_LEFT_DOWN

-- 
Andrew Shein   SE Stout               email: ashein++at++boston.sgi.com
Silicon Graphics Inc.                 phone: (508) 562 - 4800
1 Cabot Road                            fax: (508) 562 - 4755
Hudson, MA 01749                      vmail: 59688
=======================================================================
List Archives, FAQ, FTP:  http://www.sgi.com/Technology/Performer/
            Submissions:  info-performer++at++sgi.com
        Admin. requests:  info-performer-request++at++sgi.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:53:19 PDT

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