feat: [Remote rendering 3.3d] sync camera to server on orientation widget - #143
Open
LKasianAnsys wants to merge 5 commits into
Conversation
LKasianAnsys
changed the base branch from
feat/3.3c-server-authoritative-cross-section-plane
to
main
September 24, 2026 15:53
LKasianAnsys
changed the base branch from
main
to
feat/3.3c-server-authoritative-cross-section-plane
September 24, 2026 16:18
LKasianAnsys
marked this pull request as ready for review
September 24, 2026 16:19
LKasianAnsys
force-pushed
the
feat/3.3c-server-authoritative-cross-section-plane
branch
from
September 24, 2026 18:05
bba6e39 to
1b79275
Compare
LKasianAnsys
force-pushed
the
feat/3.3d-sync-orientation-widget-to-server
branch
from
September 24, 2026 18:06
ce20712 to
a7e8afe
Compare
LKasianAnsys
force-pushed
the
feat/3.3c-server-authoritative-cross-section-plane
branch
from
September 24, 2026 18:12
1b79275 to
7ee86d1
Compare
LKasianAnsys
force-pushed
the
feat/3.3d-sync-orientation-widget-to-server
branch
from
September 24, 2026 18:14
a7e8afe to
38505b5
Compare
This branch has not been deployed
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.
Issue
Resolves #21
Context
This is the last PR of 4 to move ownership of widget state from the client to the server.
Camera sync-back reports the settled browser camera to the server through the
sync_cameratrigger, and the server drops any report whose origin is notgesture.CameraGestureTrackersets that origin: a camera change counts as a user input only when it follows a mouse drag, a wheel event, or az/rkeydown. Everything else isprogrammatic, which is what stops a server-pushed camera from echoing back.Problem: clicking an orientation cube face moved the camera, but the report arrived as
programmaticand was dropped. The widget animates the camera after the release, outside the input the tracker watched.Change:
mouseupon the canvas opens the same 300ms input window as a wheel event or az/rkeydown.sync_camera.Preferred approach, after a VTK upgrade
The approach in this PR was written after a first approach was tested and introduced a regression, due to a known upstream issue that has been fixed in a newer version of VTK.
The initial implementation observed the widget's
EndInteractionEventin theWasmRendererconstructor and marked the gesture from there, which is the more precise signal: it fires once per widget interaction and makes no timing assumption.However, setting up the observer requires calling
getVtkObject, which breaksadd_dataseton VTK 9.6.1. Proxying the widget makes the client allocate ids that collide with the next dataset's, so the new dataset does not render until a reload.This is the same bug as an existing TODO in
VisorFrontend.tsx, which was previously reported as an issue to Kitware. The bug has a fix, and a test of VTK 9.7.0 confirms it resolves the issue encountered here. Once we upgrade to 9.7.0, we can restore the observer implementation. If the VTK bump lands first, we can revert it here; otherwise if the workaround lands first, a comment in theWasmRendererconstructor includes what to restore.Kitware issue: #86
Upstream fix: VTK MR
Copilot summary
This pull request adds support for correctly attributing camera movements made via the orientation widget as user gestures, ensuring these interactions are properly recognized and synchronized with the server. This addresses a gap where orientation widget actions were previously classified as programmatic, causing them to be ignored by the server. The implementation includes new methods, updated event observers, and expanded test coverage to verify the behavior.
Orientation widget gesture attribution:
noteWidgetGesturetoCameraGestureTrackerthat marks orientation widget interactions as user gestures, using the same logic as DOM-based gestures to ensure correct attribution even if the event order varies.noteWidgetGestureinVtkSceneto allowWasmRendererto mark gestures on behalf of the orientation widget, since the underlying tracker is private.WasmRendererto observe the orientation widget'sEndInteractionEventand callnoteWidgetGesture, ensuring camera moves initiated by the widget are marked as user gestures.Test enhancements:
WasmRendererWidgetTriggers.test.tsxto support orientation widget gesture tracking and validation. [1] [2] [3]CameraGestureTracker.test.jsandWasmRendererWidgetTriggers.test.tsxto verify that orientation widget interactions are correctly observed and attributed as gestures. [1] [2]