I want to detect user clicks on a polygon mesh I've drawn using patch(), and determine which polygon was clicked in. Although Matlab must have computed that information in order to detect the mouse click, I can't find it in the arguments passed to the ButtonDownFcn that I install into the patch handle. The arguments are a handle to the patch and a Hit structure that includes the IntersectionPoint but nothing else of much use.
In principle I can calculate which polygon contains that point, but I would just be repeating work that Matlab has presumably done already. Can I get it directly?
The same question applies to clicks on line objects.