pcl
pcl copied to clipboard
PCLVisualizer: make coordinate system actor unpickable
When adding a coordinate system to the visualizer, it tends to capture f key events. The user wants to fly to the point under the cursor, but gets teleported to the coordinate axes instead for some reason. Usually I have to switch to point-based rendering (p) to get this to stop.
I think it would make sense to make all annotations (text, lines, etc.) also unpickable.
Can you make a video to show what happens? I can't seem to reproduce it. But the point that is under the cursor gets moved to the center of screen, which seems unintuitive to me. I can't reproduce directly that it turns towards the coordinatesystem.
On the below image, it "hits" the coordinate system points, no matter if in surface or point rendering mode, rather then actual points, which is "far" behind the coordinatesystem.
Anyways, I would probably opt for a parameter, to set whether the actor should be pickable or not, rather than forcing either.
I tried capturing the problem here. I hover over a point, and press f repeatedly to fly to it. Left is with my changes – i eventually arrive. Right is current state – the coordinate actor attracts the view and I converge to it instead of my target.
Here it looks rather benign, but I often have cases where i even move the axes out of the viewport, and they still capture my focus and turn around the view completely.
Yeah, so same experience that I have. That you try to target points behind the coordinate actor, but its "in the way".
Visually, it isn't so I would consider this unexpected behaviour, but I don't know how the point picking works exactly.
this happens also at times when you fly to a point far away from the axes by the way. i used something close in the example for no reason.
If I were to add a parameter, can the unpickable case be the default?
I think this does not only apply to the coordinate system, but also other shapes. I often use spheres and lines and they likewise disable f behaviour. It seems to me that either we have to add the pickable parameter for each add*() function, or we just make them unpickable by default.
@larshg Could you share your opinions on the previous few comments? Then I could move this forward.
Yeah, I think I would opt for the paramter for each add* method. I would keep it pickable as it is today as default though.
Alternatively we add a getCoordinateActorMap. Then you can use that one and getShapeActorMap and iterate through those and set them all to unpickable.
Another approach could be to add a getActor/Prop (string id), which then returned the actor / Prop type, where you could set pickable?