Closed jourdain closed 5 months ago
Side note, how do we do a screenshot from the WASM rendering?
If something can be done, we may want to add a captureImage(format="image/png", opts={})
method at some point too.
Also I'm not sure what it would mean if we want to swap to a different view? Should we clear the state and remap the listening to a different instance of vtkRenderWindow. But in the vtk.js version of the widget, we have some mechanism to show a different view.
It might be possible to do with the current API, but I don't know what is required. Ideally, I should add a test and implement the correct flow on the WASM side...
The fact that the vue component only has a handle on the render window object limits the possibilities.
Here are some questions that need answers,
GetCameraState
to return the states of all cameras in each renderer of the render window? Or is it just the first renderer?resetCamera(renderWindowId)
reset the camera of all renderers inside the window or just the first renderer?It seems like you'd want to have a handle on the renderer as well. I wish there was a way to trigger
a named method on a wasm instance. Could the C++ -> JS wrapping help? It was completed 10 months ago - https://gitlab.kitware.com/vtk/vtk/-/merge_requests/10282
What if bool resetCamera(vtkTypeUInt32 identifier)
could accept the following set of ids:
Then getCameraState() could take either a RenderWindow id or a Renderer id but the exported state should contain the ids info as well. So the when called with a RenderWindow id, you actually capture all the renderers camera state. While when you provide a renderer id, you get only one state in it.
And then on the server side, when we call SetCameraState(..), the msg/state should contains all the info with the corresponding ids. So that is self contained. For the GetCameraState(renderWindow/renderer) it should do the same as the client side and gather all that camera states with their ids so it is self contained again.
What if bool resetCamera(vtkTypeUInt32 identifier) could accept the following set of ids: RenderWindow => resetCamera on FirstRenderer() Renderer => resetCamera on that renderer
That is fine.
the exported state should contain the ids
exported state always contains the IDs, so it's okay to assume this.
Let's chat a little more about the camera state API and on which class it goes. The vtkObjectManager
cannot have camera stuff.
bool resetCamera(vtkTypeUInt32 identifier) # <= ID from Renderer
This function is now implemented in https://gitlab.kitware.com/vtk/vtk/-/merge_requests/11110
vue component needs updating.
Available in 0.3.3
vtkObjectManager
vtkWASMSceneObjectManager