<div id="RTEContent">Instead of connecting the Observer to the actor connect it to the vtkRenderer Object. This will ensure it only fires once.<br> <br> YOu can get the actors which the ray intersected, by using i guess GetProp method. And when making ur Observer . try to use the EndPickEvent instead of PickEvent unless u are specific abt wat u are aiming for<br> <br> HTH<br> <br> Darshan<br><br><b><i>Mike Jackson <maillist@bluequartz.net></i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> I am trying to use the built in picker in renderer. I put the mouse <br>over my scene and hit the "p"<br> key and a red box shows up around my vtkActor which is really neat. <br>Now how do I actually get any information from that? Looking through <br>the docs I tried to implement a subclass of vtkCommand:<br><br>class PickListener : public vtkCommand<br>{<br> public:<br> ~PickListener();<br><br>
void Execute (vtkObject* caller, unsigned long eventId, void <br>*callData);<br><br> private:<br> void *_document; //Really a PFDocument object<br>};<br><br>And when I create each actor in the scene I add it there.<br><br>PickListener *pickEvent = new PickListener();<br>pickEvent->setDocument( (void *)self);<br>for (unsigned int i = 0; i < numRegions; ++i)<br>{<br> // code above here...<br> vtkActor *dataActor = vtkActor::New();<br> dataActor->AddObserver(vtkCommand::PickEvent, pickEvent );<br> // code below here<br>}<br><br>Now what happens is that for every "Pick" I get multiple calls to the <br>Execute method, each call has a different "caller" associated with <br>it. I figured this was because the "ray" was intersecting multiple <br>actors. How do I sort out which actor was really "picked"? <br>vtkRenderWindow gets it right?<br><br>---<br>Mike Jackson<br>mike _at_ bluequartz dot net<br><br><br>---<br>Mike Jackson<br>mike _at_ bluequartz dot
net<br><br><br>_______________________________________________<br>This is the private VTK discussion list. <br>Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ<br>Follow this link to subscribe/unsubscribe:<br>http://www.vtk.org/mailman/listinfo/vtkusers<br></blockquote><br></div><p>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam? Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com