[vtkusers] picking faces, edges, vertices

Affolter Martin martin.affolter at ntb.ch
Fri Apr 27 02:33:51 EDT 2012


Hi Bryn,

thanks a lot for your suggestions. Here are my thoughts:

1.
I have looked into the vtkCellPicker code and there doesn't seem to be a possibility to priorize edges over triangles. So even if I use two pickers, I will only pick the edge occasionally.

2.
What you are describing here is a reimplementation of the actual picking, right?. This could indeed be a possible way to go. I would then inherit from vtkCellPicker (or its superclass) and change the actual picking according to my needs.

3.
For this to work I'd have to get neighbouring lines (explizitly created polylines) of the picked triangle (not its edges) and also determine the distance from the pick-position to the cell's barycenter as well as to the line. Have you done this before? If so, could you name the needed classes and methods? Maybe the term "edges" is a somewhat misleading. By edges I don't mean the triangles boundaries but the polylines I create that visualize the cubes edges.

Any further suggestions are very welcome.

Regards,
Martin

-----Ursprüngliche Nachricht-----
Von: Bryn Lloyd [mailto:bryn.lloyd at gmail.com] 
Gesendet: Mittwoch, 25. April 2012 08:06
An: Affolter Martin
Betreff: Re: [vtkusers] picking faces, edges, vertices

Hi Martin,

1.
One possible way might be the following:
- Use two cell pickers, one for triangles, one for edges.
- Give the picker for edges higher priority

2.
I am not sure if this can be done. But maybe you could get the pick ray from the picker, and use a vtkCellLocator to intersect your edge mesh with the pick ray.
If you find an edge, then return it. Else return the picked triangle...

3.
Another possibility might be to pick only the triangles, but if the pick position is close to an edge (one of the barycentric coordinates close to 0), or close to a point (one of the barycentric coordinates close 1) then return the corresponding edge or point.

Falls Du ein Lösung findest, wäre ich daran interessiert ...

Danke & Gruss
Bryn



More information about the vtkusers mailing list