Repository navigation
feat: Pick and highlight geometry through the server in client mode - #204
Conversation
d97531c to
fbff12e
Compare
942f749 to
3a5657a
Compare
d7ea751 to
272b7b8
Compare
272b7b8 to
affc2d1
Compare
fc6bbfd to
21e2076
Compare
21e2076 to
3a76795
Compare
ansBAkula
left a comment
There was a problem hiding this comment.
@LKasianAnsys Tested and works as expected on the defined workflows. However, when I tried remove dataset on SERVER mode the server crashes. This is not related to this branch, and is reproducible on the main branch too. With the CLIENT mode it works just fine.
Server starting...
Server started and ready on http://localhost:51205
INFO: 127.0.0.1:36656 - "POST /start HTTP/1.1" 200 OK
INFO: 127.0.0.1:55610 - "GET /health HTTP/1.1" 200 OK
INFO: 127.0.0.1:55620 - "POST /add_dataset HTTP/1.1" 200 OK
INFO: 127.0.0.1:48960 - "GET /health HTTP/1.1" 200 OK
INFO: 127.0.0.1:48962 - "POST /remove_dataset HTTP/1.1" 200 OK
X Error of failed request: BadAccess (attempt to access private resource denied)
Major opcode of failed request: 148 (GLX)
Minor opcode of failed request: 5 (X_GLXMakeCurrent)
Serial number of failed request: 362
Current serial number in output stream: 362
|
@ansBAkula thanks for testing, and reporting the |
Issue
Addresses #192
Summary
Until now, geometry picking has had two separate implementations: client mode picked in WASM and drew the highlight on a narrow canvas overlay, and server mode picked and highlighted on the server. This PR moves client mode onto the server-mode implementation. It also fixes a VTK object id clash between the browser and the server in client mode.
Changes
pixel_scalepayload). The highlight then matches server mode in size.VtkScene.js, LocalRendererandLocalScene.GetActor) instead of a property read.RemoteVtkScenenow registers onevtkPointsat id2 ** 30(then unregisters its state). Registering at an explicit id raises the counter, and it never falls, so every id the browser allocates afterwards lands above the server's range.Tests Unit and Jest tests are updated or added for the new flow. Tests for the removed WASM picking code are deleted. A new Jest test (
RemoteVtkSceneIdFloor) pins that the id registration at1073741824is the first wasm call after load.Manual testing
The client and server rendering modes now share a geometry picking and highlight mechanism. Test in both modes and they should look and behave the same way.
Id clash check (client mode): Load the viewer with the browser console open at the default level. Pick geometry repeatedly, and call scene-modifying APIs such as
add_datasetbetween picks. Expect no crash and no wrong-object updates, and no console warning starting withError in WebAssembly moduleorCould not reserve the browser id range.