I suggest using vtkExtractSelectedFrustum instead of picking. See <div><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/Frustum">http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/Frustum</a></div>

<div>and </div><div><a href="http://vtk.org/gitweb?p=VTK.git;a=blob;f=Rendering/Testing/Cxx/TestAreaSelections.cxx">http://vtk.org/gitweb?p=VTK.git;a=blob;f=Rendering/Testing/Cxx/TestAreaSelections.cxx</a> </div><div>for examples<div>

<br></div><div>Picking is, with the exception of picking multiple actors, more useful for identifying the one thing underneath one pixel.</div><div><br></div><div>Selection is more useful for picking multiple things (both under multiple pixels and deeper underneath them). </div>

<div><br></div><div>Note you can select points directly and then turn on a flag to include the cells that contain those points. Also note that the filter behind FrustumSelection is defined in world space, not screen space and works on cells or points directly, so there shouldn&#39;t be any need to make cells to represent edges or vertices. Lastly note that you can manipulate the frustum however you like to be more selective about what is chosen.</div>

<div><br clear="all">David E DeMarle<br>Kitware, Inc.<br>R&amp;D Engineer<br>21 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-881-4909<br>
<br><br><div class="gmail_quote">On Fri, Jan 13, 2012 at 4:40 PM, Stephen Langer <span dir="ltr">&lt;<a href="mailto:stephen.langer@nist.gov">stephen.langer@nist.gov</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi --<br>
<br>
My program displays a vtkUnstructuredGrid, along with other objects.<br>
I&#39;d like users to be able to pick nodes, edges, faces, and elements of<br>
the grid with mouse clicks.  The interior of the grid needs to be<br>
visible, and sometimes only a subset of the grid is displayed (ie,<br>
only elements meeting some user-specified criterion).  Currently I&#39;ve<br>
more or less figured out how to click on and select elements and<br>
nodes, but I&#39;m having some difficulties and would greatly appreciate<br>
some advice.<br>
<br>
If the vtkUnstructuredGrid contains only 3D (eg, tetrahedral) cells,<br>
then the internal edges aren&#39;t drawn in a wire frame representation,<br>
so to display the grid I&#39;m using the vtkExtractEdges filter.  If I<br>
only display the edges, then vtkCellPicker won&#39;t pick anything, so I<br>
add a second actor that displays the same grid using an almost<br>
completely transparent surface representation.  Then the picker can<br>
work on the second actor when choosing elements.  In both cases cells<br>
in the grid are created only for the subset that&#39;s being displayed.<br>
This works, but it seems inefficient.  Is there a better way?<br>
<br>
When picking nodes I&#39;d like to use a vtkPointPicker because then I<br>
don&#39;t have to explicitly create vertex cells in the grid. However,<br>
then the picker can pick points that aren&#39;t in the displayed subset of<br>
the grid.  How can I restrict the picker so that it only finds points<br>
that are in the displayed tets?  Do I have to make a new vtkPoints<br>
list?  I&#39;d rather not do that for memory reasons.  (I can&#39;t use a<br>
vtkCellPicker to pick a tet and then select the closest node of that<br>
tet, because I might be trying to pick a node that&#39;s visible through<br>
some number of intervening tets.)<br>
<br>
Is it possible to get the vtkPointPicker to return multiple points for<br>
one vtkActor?  If it returned all points within a tolerance of the<br>
ray, then I could choose the closest one that&#39;s in the displayed<br>
subset.  vtkPicker.GetPickedPositions returns a set of positions, but<br>
it seems to include just one per vtkActor, and all of my points are in<br>
the same vtkActor.  Is it necessary to create a separate vtkActor for<br>
each point?<br>
<br>
I tried creating a separate vtkUnstructuredGrid containing only vertex<br>
cells from the elements in the subset, but vtkCellPicker doesn&#39;t seem<br>
to work on vertices.  Is that correct?  Is there a way of picking<br>
cells from a grid that contains only vertices?<br>
<br>
In case it matters, I&#39;m not using a vtkRenderWindowInteractor.  I&#39;m<br>
using vtk inside a gtk program.  The vtk render window is redirected<br>
to a gtk drawing area, and the mouse click coordinates are returned<br>
from there.<br>
<br>
Thanks for any advice.  I hope my questions aren&#39;t too elementary.<br>
I&#39;ve looked for answers in the kitware books and online without much<br>
success.<br>
<br>
  -- Steve<br>
<br>
--<br>
-- EMail: <a href="mailto:stephen.langer@nist.gov">stephen.langer@nist.gov</a>                    Phone: <a href="tel:%28301%29%20975-5423" value="+13019755423">(301) 975-5423</a> --<br>
-- <a href="http://math.nist.gov/~SLanger/" target="_blank">http://math.nist.gov/~SLanger/</a>                      Fax: <a href="tel:%28301%29%20975-3553" value="+13019753553">(301) 975-3553</a> --<br>
-- Mail: NIST; 100 Bureau Drive -- Stop 8910; Gaithersburg, Md  20899-8910 --<br>
<br>
-- &quot;I don&#39;t think this will work.  That&#39;s why it&#39;s science.&quot;               --<br>
--                              Naomi Langer (age 6),  17 Feb 2003         --<br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br></div></div>