Re: Highlighting objects

New Message Reply Date view Thread view Subject view Author view

Swaminathan N. (swami++at++evl.eecs.uic.edu)
Mon, 12 Aug 1996 11:26:48 -0500 (CDT)


On Mon, 12 Aug 1996, Kenneth Gordon wrote:

> I am trying to use a laser pointer to highlight certain certain objects, and am
> trying to find a simple way to do it. The objects are fairly small, so I am
> trying to highlight the bounding box (or sphere, if the box won't work) around
> the object. I have come up with a couple of different ways, but none of them
> seems to work very well, and I was wondering if anyone has any other ideas:

Here's some code that I've used. I use a global highlight which I've
enabled. Then depending on whether the Anchor is selected or not, I
enable and then disable the highlighting. The callbacks are attached to
pfWWWAnchor which is actually a pfGroup. Hope that helps...

int
preDrawCB_Anchor(pfTraverser *trav, void *data) {
  data;
  pfWWWAnchor *in = (pfWWWAnchor *) trav->getNode();
  pfPushState();
  if (in->selected) {
    //fprintf(stderr, "in draw callback\n");
    pfEnable(PFEN_HIGHLIGHTING);
  }
  return PFTRAV_CONT;
}

int
postDrawCB_Anchor(pfTraverser *trav, void *data) {
  data;
  pfWWWAnchor *in = (pfWWWAnchor *) trav->getNode();
  if (pfGetEnable(PFEN_HIGHLIGHTING))
    pfDisable(PFEN_HIGHLIGHTING);
  pfPopState();
  return PFTRAV_CONT;
}

 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
v Swaminathan Narayanan ^
v swami++at++evl.eecs.uic.edu ^
v Office: 996-3002 ^
v Home: 850-3725 ^
v http://evlweb.eecs.uic.edu/swami ^
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

=======================================================================
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:20 PDT

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