Hi all,<br><br>Posted this over the last couple of days but did not get any response nor did I have any luck trying this on my side. So, here it goes again:<br><br>So, I am basically having trouble picking 2D actors using vtkPropPicker. What is happening is I have set the location of the 2D actor at a position on the screen using:
<br><br>m_actor->SetPosition(x, y);<br><br>but I can only pick it at coordinates (0, 0) through to width and height of the image. <br><br>It looks like I am not the only one who had this problem. While searching, I came upon a person with the same problem. The thread is located at:
<br><br><a href="http://public.kitware.com/pipermail/vtkusers/2004-October/077010.html">http://public.kitware.com/pipermail/vtkusers/2004-October/077010.html</a><br><br>It does not have any responses. There was another thread by the same author that mentions that this problem only happens when the vtkActor2D has a vtkImageMapper associated with it.
<br><br>This is what my code looks like:<br><br>The actor is setup in the following way:<br><br>m_mapper = vtkImageMapper::New();<br>m_mapper->SetInput(myImage->GetOutput());<br> <br>m_actor = vtkActor2D::New();
<br>m_actor->SetMapper(m_mapper);<br><br>// The position is set using<br>m_actor->SetPosition(x, y);<br><br>I can see the cursor at the correct position on the screen. <br><br>Now the picking is done as follows:<br>
<br>// Interaction coordinate<br>int x = this->Interactor->GetEventPosition()[0];<br>int y = this->Interactor->GetEventPosition()[1];<br>this->FindPokedRenderer(x, y);<br> <br>if (this->CurrentRenderer == NULL)
<br> return;<br><br>// Create the picker<br>vtkPropPicker * picker = vtkPropPicker::New();<br> <br>if (picker->PickProp(x, y, this->CurrentRenderer))<br>{<br> // The correct prop is only picked when x, y is around 0, 0
<br> vtkProp * prop = picker->GetViewProp(); <br>}<br>picker->Delete();<br><br>I am having tons of problem with this and a lot depends on this working correctly. If you have any ideas or suggestions, no matter how wild, please share!
<br><br>Cheers,<br>Anja