Hi to all,<br><br>I would like to be able to pick the points drawn by vtkPointSpriteMapper.<br><br>I can currently use the vtkCellPicker, with tolerance, but ideally I would like the picker to take into account the "radius" of each point, and the distance scaling (which may be off). Note that there may be several vtkPointSpriteMappers that all need to be considered during the pick.<br>
<br>I have been hacking through the code, looking for ways to make this happen.<br>So far I have subclassed vtkPolyData to add the radius to the edge of the bounds after ComputerBounds() (which seems to work well),<br><br>
but the next step seems more difficult. The key point seems to be the line in vtkCellPicker.cxx:89<br> if ( this->Cell->IntersectWithLine(p1, p2, tol, t, x, pcoords, subId) <br><br>The 'Cell' is a vtkGenericCell, created by the picker.<br>
<br>The options I see are:<br>a - Hack/subclass vtkCellPicker so that it will call Cell->IntersectWithLine() with an adjusted tolerance.<br>b - Hack/subclass vtkCellPicker so that it will use MyHackedGenericCell which can deal with the radius within IntersectWithLine()<br>
c - Write my own vtkPointSpritePicker.<br><br>a and b have extra problems because I need to somehow transfer the radius and distance scaling from the dataset into the Cell for computation.<br><br>c is an good option (I think?), but then I see the problem that if I want to consider not just PointSprite data, but also normal cell data (eg polygons etc), then I may be in trouble.<br>
<br>Maybe I could figure out the best pointsprite candidate, and then run a CellPicker pick to check whether it was 'beaten' by another cell+data... but I don't think CellPicker will give me details on how "good" (or close, or how close to the ray) its pick was...<br>
<br>its a bit late so i'm not sure if the above makes sense... i'd really appreciate some pointers, I'm still new to VTK.<br><br>thanks<br>Paul<br><br>