-
Notifications
You must be signed in to change notification settings - Fork 441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Left click to pick points #2266
Conversation
Added a left_clicking keyword to enable_point_picking.
Codecov Report
@@ Coverage Diff @@
## main #2266 +/- ##
==========================================
+ Coverage 93.40% 93.48% +0.07%
==========================================
Files 75 74 -1
Lines 15615 15728 +113
==========================================
+ Hits 14585 14703 +118
+ Misses 1030 1025 -5 |
This is a fantastic side effect! I'm liking the changes you have so far! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Note: for whatever reason LeftButtonPressEvent
isn’t being triggered despite simulating it. I skipped coverage of the function that would be triggered by this event. Since we have coverage of the rest of this feature, I’m fine with approving this. We can consider looking into this later.
Merging as there has been no additional feedback and it's time for a release. |
Hi, thanks for the reviews and for merging! Sorry for not getting back to you - I was away for a couple of weeks |
No problem at all! Thanks for adding this feature. |
Overview
Resolves #2193
Indirectly addresses: #1285 pyvista/pyvista-support#249
Hi, I've added the ability to pick points on a mesh by clicking the left mouse button.
Details
I've added an optional
left_clicking
keyword toenable_point_picking
. If set to True, an observer is added to the interactor that will launch a pick event when the left button is clicked.Because the pick event is not created using by pressing 'P', there is no red box around the picked point (I think the red box is generated by a
KeyReleaseEvent
associated withvtkRenderWindowInteractor
on the C++ side, and cannot be disabled from Python).I'm not sure this is the best way to go about adding this functionality, so I've not yet added tests. I've added a simple example to the end of
examples/02_plot/point_picking.py
.