Hi all,<br><br>Ok, tried all sorts of pickers in the vtk framework but nothing really picks 2D actors.<br><br>The examples and the archives do not really have anything on 2D picking.<br><br>If anyone has had any success in picking 2D actors when there is more than one 2D actor on the scene, please share! I am pretty desperate here.
<br><br>Here is what I have tried... I would be really grateful if someone takes a look at it and comments on what else I could ry here...<br><br>Repeating message here:<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-&gt;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" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">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-&gt;SetInput(myImage-&gt;GetOutput());<br><div id="mb_0">&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br>m_actor = vtkActor2D::New();
<br>m_actor-&gt;SetMapper(m_mapper);<br><br>// The position is set using<br>m_actor-&gt;SetPosition(x, y);<br><br>I can see the image at the correct position on the screen. <br><br>Now the picking is done as follows:<br>

<br>// Interaction coordinate<br>int x = this-&gt;Interactor-&gt;GetEventPosition()[0];<br>int y = this-&gt;Interactor-&gt;GetEventPosition()[1];<br>this-&gt;FindPokedRenderer(x, y);<br>&nbsp;&nbsp; &nbsp;<br>if (this-&gt;CurrentRenderer == NULL)
<br>&nbsp;&nbsp; &nbsp;return;<br><br>// Create the picker<br>vtkPropPicker * picker = vtkPropPicker::New();<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br>if (picker-&gt;PickProp(x, y, this-&gt;CurrentRenderer))<br>{<br>&nbsp;&nbsp;&nbsp; // The correct prop is only picked when x, y is around 0, 0
<br>&nbsp;&nbsp; &nbsp;vtkProp * prop = picker-&gt;GetViewProp();&nbsp;&nbsp; &nbsp;<br>}<br>picker-&gt;Delete();<br><br>I had counted on this working correctly... Is this not possible at all? should I keep track of all my objects myself???<br><br>Cheers,
<br><span class="sg">Anja</span></div><br>