Skip to content

feat: [Remote rendering 3.3d] sync camera to server on orientation widget - #143

Open
LKasianAnsys wants to merge 6 commits into
feat/3.3c-server-authoritative-cross-section-planefrom
feat/3.3d-sync-orientation-widget-to-server
Open

LKasianAnsys wants to merge 6 commits into
feat/3.3c-server-authoritative-cross-section-planefrom
feat/3.3d-sync-orientation-widget-to-server

Conversation

@LKasianAnsys

@LKasianAnsys LKasianAnsys commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

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_camera trigger, and the server drops any report whose origin is not gesture. CameraGestureTracker sets that origin: a camera change counts as a user input only when it follows a mouse drag, a wheel event, or a z / r keydown. Everything else is programmatic, 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 programmatic and was dropped. The widget animates the camera inside wasm, outside the input the tracker watched.

Change:

  • WasmRenderer observes the widget's EndInteractionEvent and calls CameraGestureTracker.noteWidgetGesture(), which opens the same 300ms input window as a wheel event or a z/r keydown.
  • Client-side only; the report still goes through sync_camera.

Requires a VTK upgrade to 9.7.0

This PR should be merged after VTK is bumped to 9.7.0, in #146.

On VTK 9.6.1 (current), proxying the widget to observe it breaks add_dataset: the client allocates ids that collide with the next dataset's, so the new dataset does not render until a reload. This was encountered previously in VISOR, and resulted in a fix, available in 9.7.0.

  • Kitware issue: #86
  • Upstream fix: VTK MR

Copilot summary

This pull request adds support for attributing camera moves triggered by the orientation widget as user gestures, ensuring these actions are recognized and sent to the server rather than being dropped as programmatic moves. This is achieved by explicitly marking orientation widget interactions and updating the relevant gesture tracking and renderer logic. The changes also include comprehensive tests to verify the new behavior and clarify documentation.

Orientation widget gesture attribution:

  • Added a new noteWidgetGesture method to CameraGestureTracker that marks orientation widget interactions as user gestures, reusing the same timing and retroactive logic as other input types.
  • Exposed a passthrough method noteWidgetGesture in VtkScene so that the renderer can trigger gesture marking from widget events.
  • In WasmRenderer, registered an observer on the orientation widget's EndInteractionEvent to call noteWidgetGesture, ensuring face clicks are correctly attributed to the user.

Testing updates:

  • Added and updated tests to verify that orientation widget interactions are observed, correctly mark gestures, and do not trigger unintended reports. [1] [2] [3] [4] [5]

@LKasianAnsys LKasianAnsys self-assigned this Sep 24, 2026
@github-actions github-actions Bot added added enhancement New feature or request labels Sep 24, 2026
@LKasianAnsys LKasianAnsys changed the title sync camera to server on orientation widget feat: [Remote rendering 3.3d] sync camera to server on orientation widget Sep 24, 2026
@LKasianAnsys
LKasianAnsys changed the base branch from feat/3.3c-server-authoritative-cross-section-plane to main September 24, 2026 15:53
@github-actions github-actions Bot added the test Work associated with testing label Sep 24, 2026
@LKasianAnsys
LKasianAnsys changed the base branch from main to feat/3.3c-server-authoritative-cross-section-plane September 24, 2026 16:18
@github-actions github-actions Bot removed the test Work associated with testing label Sep 24, 2026
@LKasianAnsys
LKasianAnsys marked this pull request as ready for review September 24, 2026 16:19
@LKasianAnsys
LKasianAnsys force-pushed the feat/3.3c-server-authoritative-cross-section-plane branch from bba6e39 to 1b79275 Compare September 24, 2026 18:05
@LKasianAnsys
LKasianAnsys force-pushed the feat/3.3d-sync-orientation-widget-to-server branch from ce20712 to a7e8afe Compare September 24, 2026 18:06
@LKasianAnsys
LKasianAnsys force-pushed the feat/3.3c-server-authoritative-cross-section-plane branch from 1b79275 to 7ee86d1 Compare September 24, 2026 18:12
@LKasianAnsys
LKasianAnsys force-pushed the feat/3.3d-sync-orientation-widget-to-server branch from a7e8afe to 38505b5 Compare September 24, 2026 18:14
@LKasianAnsys
LKasianAnsys force-pushed the feat/3.3c-server-authoritative-cross-section-plane branch from b87c85f to b9222fd Compare September 28, 2026 17:09
@LKasianAnsys
LKasianAnsys force-pushed the feat/3.3d-sync-orientation-widget-to-server branch from 57b3a41 to 9065b20 Compare September 28, 2026 17:09
@LKasianAnsys
LKasianAnsys force-pushed the feat/3.3d-sync-orientation-widget-to-server branch from 9065b20 to 009f75f Compare September 29, 2026 18:49

This branch has not been deployed

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

Labels

added enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Remote rendering 3.3] Server-authoritative widget state

2 participants