Skip to content

feat: add Cross-Section Slice Plane (Feature 10) + Measurement Tool fixes (Feature 9)#20

Merged
kraulerson merged 16 commits intomainfrom
feat/slice-plane
Apr 9, 2026
Merged

feat: add Cross-Section Slice Plane (Feature 10) + Measurement Tool fixes (Feature 9)#20
kraulerson merged 16 commits intomainfrom
feat/slice-plane

Conversation

@kraulerson
Copy link
Copy Markdown
Owner

@kraulerson kraulerson commented Apr 9, 2026

Summary

  • Feature 10 — Cross-Section Slice Plane: Interactive clipping plane with vtkImplicitPlaneWidget2, floating overlay with X/Y/Z presets and Reset, terracotta interior fill, C key toggle
  • Feature 9 — Measurement Tool fixes: Left-click now consumed in measure mode (prevents VTK orbit), isinstance type narrowing for mypy, overlay sizing fixes
  • UAT Session 5: 28/28 scenarios passing across both features

Feature 10 Implementation

  • SlicePlaneManager — VTK clipping pipeline with vtkClipClosedSurface + vtkClipPolyData fallback
  • SliceOverlayWidget — floating Qt panel with preset buttons and dark theme
  • SceneManager — delegation methods for activate/deactivate/preset/reset/update
  • MainWindow — C key toggle, Escape via QShortcut, overlay signals, mesh update hooks
  • PROJECT_BIBLE.md — added --include-module=vtkmodules.vtkInteractionWidgets

Feature 9 Fixes (from UAT testing)

  • eventFilter consumes left press/move/release to prevent VTK orbit in measure mode
  • isinstance(event, QMouseEvent) type narrowing for mypy
  • Right-click drag and scroll still work for navigation

Test plan

  • 549 tests pass (56 new), 0 failures
  • UAT Session 5: 28/28 scenarios passing
  • Manual test: measurement tool click-to-place works without orbit
  • Manual test: slice plane activates, presets work, overlay visible
  • Manual test: Escape exits slice mode

🤖 Generated with Claude Code

Karl Raulerson and others added 15 commits April 8, 2026 18:05
…ing pipeline

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…anager

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…positioning

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…pdate hooks to MainWindow

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Bug 1: In measure mode, left-click was passed to VTK interactor which
started orbit rotation. Fix: consume left press/move/release in measure
mode so VTK never sees the events. Right-click and scroll still work.

Bug 2: Slice plane interactor was obtained via roundabout chain
(GetRenderWindow().GetInteractor()) which may return wrong object.
Fix: pass QVTKRenderWindowInteractor directly since it IS the interactor.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… fixes

- test_event_filter_consumes_left_press: verifies left-click is consumed in measure mode
- test_event_filter_passes_right_press: verifies right-click passes through to VTK
- test_slice_activates_with_loaded_mesh: verifies slice plane activates with direct interactor
- test_slice_deactivates_on_uncheck: verifies clean deactivation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
28 scenarios: 17 for Measurement Tool, 11 for Cross-Section Slice Plane.
Covers point placement, FIFO, navigation in measure mode, clearing,
invalidation, slice presets, drag/rotate, persistence, and edge cases.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… render)

UAT5-016: Add vtk_render() call after measurement invalidation so
          cleared measurements disappear visually on undo.
UAT5-020: Increase plane widget handle size (SetHandleSize 15.0) and
          PlaceFactor (1.25) for easier grabbing.
UAT5-022/023/024/025: Fix remaining GetRenderWindow().GetInteractor()
          calls in undo/redo/repair/transform handlers — pass
          vtk_interactor directly. Fix InsideOut on fallback clipper.
UAT5-026: Replace keyPressEvent with window-level QShortcut for Escape
          so it works regardless of which widget has focus.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
UAT5-020/022-025: Overlay was compressed to invisible size. Increased
width (110->130), added minHeight(100), enlarged button padding and
font size, removed debug prints.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All scenarios for Features 9 (Measurement Tool) and 10 (Cross-Section
Slice Plane) passing. No open bugs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@kraulerson kraulerson changed the title feat: add Cross-Section Slice Plane (Feature 10) feat: add Cross-Section Slice Plane (Feature 10) + Measurement Tool fixes (Feature 9) Apr 9, 2026
- Use Any type for _widget (VTK widget lacks mypy stubs)
- Cast AddObserver event name via Any to satisfy arg-type check
- Add no-any-return ignore for vtkClipPolyData.GetOutput()

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@kraulerson kraulerson merged commit 7ab5449 into main Apr 9, 2026
2 of 5 checks passed
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.

1 participant