Skip to content

feat: Remote rendering 4.5: Record camera and cross section drags in SERVER mode - #190

Open
LKasianAnsys wants to merge 6 commits into
feat/4.6-fit-view-to-canvasfrom
feat/4.5-record-camera-and-cross-section-drags
Open

LKasianAnsys wants to merge 6 commits into
feat/4.6-fit-view-to-canvasfrom
feat/4.5-record-camera-and-cross-section-drags

Conversation

@LKasianAnsys

@LKasianAnsys LKasianAnsys commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Issue

Resolves #30

Context

Until now, a mouse drag in server mode moved the server's camera or cross-section widget, but the save_state API would keep the last synced camera, and dragging the cross-section plane did not actually move the clipping plane.

In this PR, the server now detects the end of a gesture from the forwarded release or wheel event, and records the camera through the same code path used by the CLIENT mode sync_camera.

Manual check: start VISOR in SERVER mode.

  • Camera: Drag the camera to new position. Save the state, and load it in a new session. The loaded session should reflect the new camera position (not the default camera).
  • Cross-section plane: Turn on the cross-section widget, and move the clipping plane through a part of the dataset; you should see the part clipped by the plane as expected. Save state. Load the state in a new remote session. The clipping plane and clipped dataset should both be present.

Copilot summary

This pull request introduces a robust mechanism for recording and publishing camera and cross-section plane states at the end of user gestures (such as mouse drags and wheel events) in SERVER mode, ensuring accurate state synchronization after interactive changes. The changes span the renderer, window, widget, and test layers, with new hooks and logic to capture and publish state only when gestures complete, and comprehensive tests to verify the behavior.

Key changes grouped by theme:

Recording and Publishing State at Gesture End:

  • Added logic in server_window.py to detect the end of user gestures (mouse button release or wheel event) and trigger recording and publishing of the pipeline camera and cross-section plane states in a single, locked section. ([[1]](https://github.com/ansys/Visual-Interactive-Simulation-Object-Renderer/pull/190/files#diff-a39360576881e234c010ed98e5367fb7a7d1b387da52f55a42d1efcf30ba092aR13-R16), [[2]](https://github.com/ansys/Visual-Interactive-Simulation-Object-Renderer/pull/190/files#diff-a39360576881e234c010ed98e5367fb7a7d1b387da52f55a42d1efcf30ba092aR29-R37), [[3]](https://github.com/ansys/Visual-Interactive-Simulation-Object-Renderer/pull/190/files#diff-a39360576881e234c010ed98e5367fb7a7d1b387da52f55a42d1efcf30ba092aL91-R117))
  • Implemented record_pipeline_camera and record_cross_section_plane methods in ServerRenderer to handle state recording and publishing, ensuring no redundant frame requests and correct state capture only when necessary. ([src/ansys/visor/viewer/renderer/server_renderer.pyR93-R117](https://github.com/ansys/Visual-Interactive-Simulation-Object-Renderer/pull/190/files#diff-f2ab9442d7526c6bc406de355e3ce5fc287e09ff8c49b5d1efec698a93ab723dR93-R117))
  • Modified _publish_camera to separate camera record publishing from frame requests, introducing _publish_camera_record for clarity and correct sequencing. ([src/ansys/visor/viewer/renderer/server_renderer.pyL154-R185](https://github.com/ansys/Visual-Interactive-Simulation-Object-Renderer/pull/190/files#diff-f2ab9442d7526c6bc406de355e3ce5fc287e09ff8c49b5d1efec698a93ab723dL154-R185))

Widget Enhancements for Cross-Section Plane Tracking:

  • Added link_plane_to_handle and take_handle_moved methods to VisorCrossSectionWidget, enabling the widget to mark when the handle has been moved and to synchronize the clip plane with the handle at every drag step. ([[1]](https://github.com/ansys/Visual-Interactive-Simulation-Object-Renderer/pull/190/files#diff-b0fef21f1bcc21331db361eecdc8bb7fbe52d8da6c4e9f64556f890030dcacfcR37-R38), [[2]](https://github.com/ansys/Visual-Interactive-Simulation-Object-Renderer/pull/190/files#diff-b0fef21f1bcc21331db361eecdc8bb7fbe52d8da6c4e9f64556f890030dcacfcR67), [[3]](https://github.com/ansys/Visual-Interactive-Simulation-Object-Renderer/pull/190/files#diff-b0fef21f1bcc21331db361eecdc8bb7fbe52d8da6c4e9f64556f890030dcacfcR183-R198))
  • Ensured the cross-section widget links the plane to the handle upon initialization in ServerRenderer. ([src/ansys/visor/viewer/renderer/server_renderer.pyR66](https://github.com/ansys/Visual-Interactive-Simulation-Object-Renderer/pull/190/files#diff-f2ab9442d7526c6bc406de355e3ce5fc287e09ff8c49b5d1efec698a93ab723dR66))

Renderer Refactoring for State Recording:

  • Refactored sync_camera and sync_cross_section_plane in PipelineRenderer to delegate state recording and projection to new _write_camera and _write_cross_section helpers, clarifying responsibilities and supporting the new gesture-end recording logic. ([[1]](https://github.com/ansys/Visual-Interactive-Simulation-Object-Renderer/pull/190/files#diff-9199ec1a3522d373bbefbf5a83b3eff4045fda5f22969be86aaac1a946c694f5L292-L299), [[2]](https://github.com/ansys/Visual-Interactive-Simulation-Object-Renderer/pull/190/files#diff-9199ec1a3522d373bbefbf5a83b3eff4045fda5f22969be86aaac1a946c694f5L374-L386))

Testing and Validation:

  • Added comprehensive integration tests to verify that camera and cross-section plane states are recorded and published only at gesture end, and that no redundant frame requests are made. Tests cover wheel events, drags, orientation ball clicks, and cross-section handle movements. ([[1]](https://github.com/ansys/Visual-Interactive-Simulation-Object-Renderer/pull/190/files#diff-232814e2a82defe690b9c786f507c4d72bf3ff26707ef1adcc1c3da3b204213eR12-R19), [[2]](https://github.com/ansys/Visual-Interactive-Simulation-Object-Renderer/pull/190/files#diff-232814e2a82defe690b9c786f507c4d72bf3ff26707ef1adcc1c3da3b204213eR34-R43), [[3]](https://github.com/ansys/Visual-Interactive-Simulation-Object-Renderer/pull/190/files#diff-232814e2a82defe690b9c786f507c4d72bf3ff26707ef1adcc1c3da3b204213eR54-R204))
  • Introduced a unit test to ensure gesture-end recording only occurs under the correct lock, preventing race conditions. ([tests/unit/renderer/test_server_window.pyR202-R211](https://github.com/ansys/Visual-Interactive-Simulation-Object-Renderer/pull/190/files#diff-1d3469247a2b4faf2316bde832548716aa2a75bc1998ee07d58fec284f48bae3R202-R211))

Documentation and Changelog:

  • Updated the changelog to describe the new behavior for recording camera and cross-section drags in SERVER mode. ([doc/changelog.d/190.added.mdR1](https://github.com/ansys/Visual-Interactive-Simulation-Object-Renderer/pull/190/files#diff-83ff440840cf81f5cca748d99436963d52c68219d0d9d61057861937c8a45569R1))

These changes collectively ensure that interactive camera and cross-section manipulations are reliably and efficiently captured and published, improving the accuracy of remote rendering state synchronization.


References: [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16]

@github-actions github-actions Bot added test Work associated with testing added enhancement New feature or request labels Oct 22, 2026
@LKasianAnsys
LKasianAnsys force-pushed the feat/4.5-record-camera-and-cross-section-drags branch from 348572a to f5e6a7c Compare October 26, 2026 14:30
@LKasianAnsys
LKasianAnsys force-pushed the feat/4.5-record-camera-and-cross-section-drags branch from f5e6a7c to 0e80db3 Compare October 26, 2026 17:34
@LKasianAnsys
LKasianAnsys force-pushed the feat/4.5-record-camera-and-cross-section-drags branch from 0e80db3 to 63882ec Compare October 26, 2026 19:46
@LKasianAnsys LKasianAnsys self-assigned this Oct 26, 2026
@LKasianAnsys
LKasianAnsys marked this pull request as ready for review October 26, 2026 20:45
@LKasianAnsys LKasianAnsys linked an issue Oct 26, 2026 that may be closed by this pull request
@LKasianAnsys LKasianAnsys assigned margalva and ansBAkula and unassigned margalva and ansBAkula Oct 26, 2026
@LKasianAnsys
LKasianAnsys force-pushed the feat/4.5-record-camera-and-cross-section-drags branch from 624ebb7 to 476fc17 Compare October 28, 2026 14:10
@LKasianAnsys
LKasianAnsys force-pushed the feat/4.5-record-camera-and-cross-section-drags branch from 476fc17 to 4ceead7 Compare October 28, 2026 16:17
@LKasianAnsys
LKasianAnsys force-pushed the feat/4.5-record-camera-and-cross-section-drags branch from 4ceead7 to 206504f Compare October 28, 2026 16:31
@LKasianAnsys
LKasianAnsys added this pull request to stack #197 October 29, 2026 20:54
@LKasianAnsys
LKasianAnsys force-pushed the feat/4.5-record-camera-and-cross-section-drags branch from 206504f to 842eaf2 Compare October 29, 2026 21:55
@LKasianAnsys LKasianAnsys changed the title feat: [Remote rendering 4.5] Record camera and cross section drags in SERVER mode feat: Remote rendering 4.5: Record camera and cross section drags in SERVER mode Oct 29, 2026
@LKasianAnsys
LKasianAnsys force-pushed the feat/4.5-record-camera-and-cross-section-drags branch from 626a4db to 1741c9f Compare October 29, 2026 23:11
@LKasianAnsys
LKasianAnsys force-pushed the feat/4.5-record-camera-and-cross-section-drags branch from 1741c9f to 4497b72 Compare November 2, 2026 13:57
@LKasianAnsys
LKasianAnsys force-pushed the feat/4.5-record-camera-and-cross-section-drags branch from 4497b72 to bc019e7 Compare November 2, 2026 14:24

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 test Work associated with testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Remote rendering 4.5] Remote camera interaction end-to-end

4 participants