# FourPaneViewer (now in WASM)

**URL:** https://discourse.vtk.org/t/fourpaneviewer-now-in-wasm/14306
**Category:** Development
**Tags:** vtkwasm
**Created:** [July 27, 2024, 9:42am UTC](https://discourse.vtk.org/t/fourpaneviewer-now-in-wasm/14306 "2024-07-27T09:42:19Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Jens\_Munk\_Hansen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jens_munk_hansen/32/1215_2.png) [@Jens\_Munk\_Hansen](https://discourse.vtk.org/u/Jens_Munk_Hansen)
#### Post date: [July 27, 2024, 9:42am UTC](https://discourse.vtk.org/t/fourpaneviewer-now-in-wasm/14306/1 "2024-07-27T09:42:19Z")

</div>

Hi Guys

Working on a good way to wrap VTK to WASM. Right now, I am facing a problem that I had earlier with the FourPaneViewer after updating to VTK 9, the cursor actors disappears. My old fix, which works for OpenGL was to use `SetRepresentationToWireframe()` on the center line property.

I know @jaswantp worked on a systematic wrapping using Emscripten a year ago. I made some improvements, e.g. found a number of issues with overloads being wrapped such that they shadow each other, e.g. for `AddObserver` JavaScript cannot distinguish an `unsigned long` and a `std::string` in overloads. Also, the classes exposing vector properties can be wrapped using a small adapter trick.

Is this work on Emscripten wrapper stalled or is there any way to contribute on this?

Thanks in advance  
Jens

 ![Screenshot from 2024-07-27 11-31-53](https://discourse.vtk.org/uploads/default/original/2X/0/03aa94b2714679b3625daafa0bc42b6676c49918.jpeg)

---

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [July 27, 2024, 11:10pm UTC](https://discourse.vtk.org/t/fourpaneviewer-now-in-wasm/14306/2 "2024-07-27T23:10:47Z")

</div>

I don´t know if this will help [ShareCamera](https://examples.vtk.org/site/Cxx/Utilities/ShareCamera/) and [MultipleViewports](https://examples.vtk.org/site/Cxx/Visualization/MultipleViewports/). In both of these, the mouse cursor is visible when running in WASM.

---

<div class="post-metadata">

### Author: ![Jens\_Munk\_Hansen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jens_munk_hansen/32/1215_2.png) [@Jens\_Munk\_Hansen](https://discourse.vtk.org/u/Jens_Munk_Hansen)
#### Post date: [July 28, 2024, 11:41am UTC](https://discourse.vtk.org/t/fourpaneviewer-now-in-wasm/14306/3 "2024-07-28T11:41:50Z")

</div>

Not really. It is the cursor widget (the line), which is supposed to be rendered on top of the `vtkImageViewer`. I could imagine that I could play with the topological ordering on the mapper (need to expose some stuff for this, but since it wasm I’m compiling anyway). I will also double check and see if I have wrapped all the necessary classes. I did everything using @jaswantp 's JavaScript wrappers.

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [July 28, 2024, 4:01pm UTC](https://discourse.vtk.org/t/fourpaneviewer-now-in-wasm/14306/4 "2024-07-28T16:01:13Z")

</div>

> [@Jens\_Munk\_Hansen](#):
>
> Is this work on Emscripten wrapper stalled or is there any way to contribute on this?

Yea, it has pretty much stalled. But contributions are welcome. Just like most open source projects, VTK has a “Git feature branch workflow”. Developers typically fork VTK, push commits to a new branch and then create a merge request to the VTK project. After a review, approval and clean dashboards, it will be merged.

Please refer to our [contribution guide](https://docs.vtk.org/en/latest/developers_guide/index.html)!

---

<div class="post-metadata">

### Author: ![Jens\_Munk\_Hansen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jens_munk_hansen/32/1215_2.png) [@Jens\_Munk\_Hansen](https://discourse.vtk.org/u/Jens_Munk_Hansen)
#### Post date: [July 28, 2024, 7:15pm UTC](https://discourse.vtk.org/t/fourpaneviewer-now-in-wasm/14306/5 "2024-07-28T19:15:20Z")

</div>

I know that.

I am just thinking whether it is also possible to contribute on a stalled feature branch. A lot of wotk is needed to get to master. Yet alone in the Emscripten wrappers there is a lot work that is needed.

Keep up the good work.

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [July 29, 2024, 1:48pm UTC](https://discourse.vtk.org/t/fourpaneviewer-now-in-wasm/14306/6 "2024-07-29T13:48:20Z")

</div>

ah, if it is easier to create a new MR from scratch, that would be better.
