-
Hi! New to working with Trame, and it seems fantastic so far with a few caveats. A big issue we have run into with Trame is that it swallows events. We have 2 viewers that work as a normal python VTK application. One is for 2D slices and one is for 3D slices. In both cases, we have an issue where many events never end up triggering either an observer added to the Example for observers (this just does nothing on trame but in a normal application it works):
Example for
This gives the error in the command line:
Then when taking it out of the list:
I get the following errors in the terminal, and nothing occurs when I do the events:
I have a couple of questions with regards to this:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Hi @Pasarus, First, thanks for trying trame with VTK. Let me try to answer the various questions you have.
So the issue here is the way we are mapping "web events" to "vtk events". Basically we are using the original implementation of VTK/ParaView Web which only forward Mouse[Press/Move/Up] and fake the wheel into mouse move. Updating that mapping would be great assuming we can better represent web-event to vtk-event with as little conversion as possible. And by doing so, the interactor style will then became aware of them and you will be able to observe them. I've create an issue to track that as it will indeed be great to support such use case. Doing so should represent a couple days of creating a new server side protocol along with the matching code on the JS. If you feel like contributing I can try to guide you on how to do it. Thinking more about it, it may require some C++ fix in VTK as well but nothing really bad or difficult.
I think the second And looking at the code, it should work but I guess I will have to try it myself to see what might be going wrong. Also I would think you would need to do the following to get the info you need within your method.
Anyhow, I will need to test it myself and report back to either fix it or guide you on how to do it. |
Beta Was this translation helpful? Give feedback.
-
So it won't be exactly what you were hoping for as I did not fixed the VTK/C++ side of things. But the trame part of all the VtkXxxView should work as expected. I've updated that example to illustrate what you can get as events and related payload. Also you will need to run |
Beta Was this translation helpful? Give feedback.
-
For anyone reading this, the updated example link is |
Beta Was this translation helpful? Give feedback.
So it won't be exactly what you were hoping for as I did not fixed the VTK/C++ side of things. But the trame part of all the VtkXxxView should work as expected.
I've updated that example to illustrate what you can get as events and related payload.
Also you will need to run
pip install -U pywebvue trame