-
Notifications
You must be signed in to change notification settings - Fork 14
Mask manager dialog #1870
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
Mask manager dialog #1870
Conversation
5bb5eaf to
d7e1d4a
Compare
|
Two issue I found:
The polygon filling of the mask feels a little laggy currently. It'd be a great improvement if we can improve that aspect as well. |
d7e1d4a to
7e52028
Compare
d989601 to
6f5a9e3
Compare
|
Remaining issues:
|
6f5a9e3 to
a2d497f
Compare
a2d497f to
bef41f9
Compare
saransh13
left a comment
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. Will wait for Patrick to have the final approval before merge.
|
Looks like there's a merge conflict. @bnmajor can you resolve that? I'm going to take a look over the code now... |
bef41f9 to
4776e50
Compare
hexrdgui/hexrd_config.py
Outdated
| continue | ||
|
|
||
| if not mask.visible and not mask.show_border: | ||
| if not mask.visible and not mask.show_border and not mask.highlight: |
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.
This means that highlighted masks will affect the azimuthal lineout, even if the masks are not "visible" or the border is not shown. I think that's probably not what we want. We probably want to keep it the way it was before (only affect the azimuthal lineout if the mask is visible or the border is shown).
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.
So I'd recommend just removing this change.
hexrdgui/masking/mask_manager.py
Outdated
| mode=None, | ||
| xray_source=None | ||
| xray_source=None, | ||
| highlight=False |
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.
| highlight=False | |
| highlight=False, |
I'd recommend including a , at the end of all final arguments. The reason is that, without it, a new change is necessary in the changelog to add a comma to the previous one (as is the case here for xray_source=None). This can cause confusion as to who authored that line and why it was authored.
| self._mask_boundary_artists.clear() | ||
|
|
||
| def draw_mask_boundaries(self, axis, det=None): | ||
| def update_mask_highlights(self, axis): |
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.
I think we need a new signal/slot mechanism that, when the user's selection changes, it only triggers highlight artist updates (and doesn't retrigger all the polar mask logic).
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.
This would make highlight selections much faster.
2573d14 to
5a14e78
Compare
5a14e78 to
2573d14
Compare
hexrdgui/image_canvas.py
Outdated
|
|
||
| if self.mode in (ViewType.polar, ViewType.stereo): | ||
| self.update_mask_highlights(self.axis) | ||
| self.draw_idle() |
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.
So, the purpose of using the blit manager (and the animation features) is to avoid calling self.draw() and self.draw_idle(), because those can be expensive calls when you need faster speeds for things like animations. Instead, self.blit_manager.update() is all you need.
And, it looks like the highlight_masks() function already calls self.blit_manager.update(), so you can safely remove both calls to self.draw_idle() above.
After you remove these, you might also no longer need the debouncer in the mask manager dialog, because the updates should be much faster. But I'll leave it up to you whether to keep the debouncer or not.
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.
By the way, the calls to self.draw_idle() are most time-consuming when the polar view has a very high resolution (small tth and eta pixel size). So you may not notice the performance impact much unless you switch to higher resolutions.
However, our users do typically work with high resolution polar views.
Signed-off-by: Brianna Major <[email protected]>
Signed-off-by: Brianna Major <[email protected]>
Signed-off-by: Brianna Major <[email protected]>
Signed-off-by: Brianna Major <[email protected]>
All updates are now immediate again. Signed-off-by: Brianna Major <[email protected]>
Signed-off-by: Brianna Major <[email protected]>
Signed-off-by: Brianna Major <[email protected]>
Signed-off-by: Brianna Major <[email protected]>
Signed-off-by: Brianna Major <[email protected]>
Signed-off-by: Brianna Major <[email protected]>
Signed-off-by: Patrick Avery <[email protected]>
Signed-off-by: Brianna Major <[email protected]>
caaff32 to
d950beb
Compare
|
LGTM |
Relies on #1849