Skip to content

feat: add pan and zoom toggle controls with full camera state save/restore#90

Closed
patrickoleary wants to merge 1 commit intomasterfrom
feature/pan-and-zoom
Closed

feat: add pan and zoom toggle controls with full camera state save/restore#90
patrickoleary wants to merge 1 commit intomasterfrom
feature/pan-and-zoom

Conversation

@patrickoleary
Copy link
Copy Markdown
Member

@patrickoleary patrickoleary commented May 4, 2026

Adds pan, zoom, and aspect ratio controls to the Viewport Layout toolbar as collapsible toggle groups, with full camera state persistence.

UI Changes

  • Aspect ratio toggle — reveals a slider (0–4, step 0.25) with tick marks
  • Zoom toggle — reveals zoom in/out buttons
  • Pan toggle — reveals up/down/left/right pan buttons
  • Reset view button resets camera to default
  • Toggles are mutually exclusive — activating one collapses the others
  • Active groups highlighted with a subtle background
  • Toolbar streamlined: removed "Viewport layout" label, grouped/uniform is now icon-only with tooltip, Size is icon-only with tooltip, hotkey badge removed
  • Keyboard shortcut z for reset and g for grouped still work

Everything collapses. I think the dimension sliders would look a lot better this way too.

viewport-toolbar

Camera State Save/Restore
State export now saves the full VTK camera configuration:

  • zoom (ParallelScale)
  • position (camera position)
  • focal_point (camera focal point)
  • view_up (camera up direction)
  • clipping_range (near/far clipping planes)

API Simplification

  • Replaced zoom_in/zoom_out with zoom(factor)
  • Replaced pan_up/pan_down/pan_left/pan_right with pan(dx, dy)
  • Button-specific logic (direction, factor) lives in toolbar lambdas

closes #80

…store

- Add zoom(factor) and pan(dx, dy) methods to both view managers
- Add aspect ratio, zoom, and pan toggle groups to Layout toolbar with background highlight
- Add reset view button with render fix
- Save/restore full camera state (zoom, position, focal point, view up, clipping range)
- Streamline toolbar: remove label, icon-only grouped/size buttons with tooltips
- Aspect ratio slider with 0.25 step ticks (0-4 range)
@patrickoleary patrickoleary force-pushed the feature/pan-and-zoom branch from a9fabcf to 22fec9d Compare May 4, 2026 16:36
@patrickoleary
Copy link
Copy Markdown
Member Author

done

@patrickoleary patrickoleary requested a review from jourdain May 4, 2026 17:17
@jourdain
Copy link
Copy Markdown
Collaborator

jourdain commented May 4, 2026

I has been processing for more than 30 minutes... So I can't merge it.

Screenshot 2026-05-04 at 11 47 27

I don't know if github is struggling, but it might be easier if you directly push a PR on this repo instead of your fork?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable view interaction and add zoom-in/out

3 participants