<DIV><FONT face=Arial>Hi, everyone,</FONT></DIV>
<DIV><FONT face=Arial> I am displaying several 2D images using class vtkImageViewer2, of course, there is several objects of class vtkImageViewer2. and I want to know which object would be picked when I press my mouse left button. so I want to use vtkPointPicker to do it.</FONT></DIV>
<DIV><FONT face=Arial> however, the actor of class vtkImageViewer2 is vtkImageActor, while class vtkPointPicker could only get a object of class vtkActor by method GetActor(). so I have to change my mind. I want to testify which vtkImageViewer2 would be picked by class vtkRenderWindowInteractor.</FONT></DIV>
<DIV><FONT face=Arial> I add a mouse events observer like:</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff>virtual void execute(...) {</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff> // picker and viewer are pointers to the actual vtkPointPicker/vtkImageViewer2 objects.<BR> int i = picker->Pick(viewer->GetRenderWindow()->GetInteractor()->GetEventPosition()[0],</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff> viewer->GetRenderWindow()->GetInteractor()->GetEventPosition()[1],</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff> viewer->GetSlice(), viewer->GetRenderer());</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff> if (i == 0) </FONT></DIV>
<DIV><FONT face=Arial color=#0000ff> {</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff> return;</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff> }</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff> vtkRenderWindowInteractor * temp = picker->GetRenderer()->GetRenderWindow()->GetInteractor();</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff> <FONT color=#ff0000>// .... and then test which vtkImageViewer2 the interactor is in</FONT></FONT></DIV>
<DIV><FONT face=Arial color=#ff0000> // but it don't work!!!!</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff>} </FONT></DIV>
<DIV><FONT face=Arial> who can tell me how to pick one object of vtkImageViewer2 from the objects set of vtkImageViewer2? is there any method to know whick one I have picked?</FONT></DIV>
<DIV><FONT face=Arial> thank you!</FONT></DIV>
<DIV><FONT face=Arial> MJ</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial></FONT> </DIV>