Add SliceControl and ClipControl widgets#28
Open
Jo-Byr wants to merge 2 commits into
Open
Conversation
Contributor
Author
ada7636 to
3b6fb3a
Compare
luciemac
reviewed
Jun 18, 2026
| self.source = None | ||
| self.pv_filter = pv_filter | ||
| self.title = title | ||
| self.show_key = f"{namespace}_show" |
Contributor
There was a problem hiding this comment.
show_key -> visibility_key?
Comment on lines
+129
to
+161
| with ( | ||
| vuetify.VTooltip("Normal to X", location="bottom"), | ||
| vuetify.Template(v_slot_activator="{ props }"), | ||
| ): | ||
| vuetify.VBtn( | ||
| "X", | ||
| click=self._normal_to_x, | ||
| style="margin: 4px;", | ||
| density="comfortable", | ||
| v_bind="props", | ||
| ) | ||
| with ( | ||
| vuetify.VTooltip("Normal to Y", location="bottom"), | ||
| vuetify.Template(v_slot_activator="{ props }"), | ||
| ): | ||
| vuetify.VBtn( | ||
| "Y", | ||
| click=self._normal_to_y, | ||
| style="margin: 4px;", | ||
| density="comfortable", | ||
| v_bind="props", | ||
| ) | ||
| with ( | ||
| vuetify.VTooltip("Normal to Z", location="bottom"), | ||
| vuetify.Template(v_slot_activator="{ props }"), | ||
| ): | ||
| vuetify.VBtn( | ||
| "Z", | ||
| click=self._normal_to_z, | ||
| style="margin: 4px;", | ||
| density="comfortable", | ||
| v_bind="props", | ||
| ) |
Contributor
There was a problem hiding this comment.
Can you factorized this by defining one component to reuse for X, Y and Z?
| v_bind="props", | ||
| ), | ||
| ): | ||
| vuetify.VIcon("mdi-camera") |
| self.plane_representation.DrawPlaneOff() | ||
|
|
||
| self._build_ui() | ||
| self.plane_representation.normal = self.normal_editor.value |
Contributor
There was a problem hiding this comment.
Don't you need the origin as well?
|
|
||
|
|
||
| class PlaneWidgetEditor(html.Div): | ||
| def __init__(self, pv_filter, title: str, namespace: str = ""): |
Comment on lines
+195
to
+197
| self.plane_widget = vtk.vtkImplicitPlaneWidget2( | ||
| representation=self.plane_representation, interactor=iren | ||
| ) |
Contributor
There was a problem hiding this comment.
Should be initialized only once
Comment on lines
+13
to
+14
| if any(not isinstance(v, float) for v in origin): | ||
| return |
Contributor
There was a problem hiding this comment.
Should handle integers as well
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.