Closed clavicule closed 7 years ago
Hello Claude,
I'm glad you managed to do quite a lot on your own.
Let me try to answer you questions:
The command line for ParaView with be something along those lines:
"cmd": [
"mpirun", [...], "${pvbatch_exec}", "./server/pvw-visualizer.py",
"--port", "${port}", "-f", "--authKey", "${secret}"
"--data", "/path/to/data/dir", "--load-file", "${data}"
]
But you will need an extra environment variable (PV_ALLOW_BATCH_INTERACTION=1) and ParaView/master or 5.3 which is not out yet.
For VTK, that's another story you will be missing all the MPI controller infrastructure initialization which is given with ParaView. So it is still possible but much more cumbersome.
Correct, that will mean rewriting ParaView without the MPI capability since ParaView is based on VTK.
Maybe, but you will have to write a lot of code while in ParaView it is more likely that piece already exist and the deal is to figure out how to do it.
For example, if you look at the server side of the cone example for VTKWeb here would be the ParaView side of it.
simple.Cone()
simple.Show()
simple.Render()
vs
if not _WebCone.view:
# VTK specific code
renderer = vtk.vtkRenderer()
renderWindow = vtk.vtkRenderWindow()
renderWindow.AddRenderer(renderer)
renderWindowInteractor = vtk.vtkRenderWindowInteractor()
renderWindowInteractor.SetRenderWindow(renderWindow)
renderWindowInteractor.GetInteractorStyle().SetCurrentStyleToTrackballCamera()
cone = vtk.vtkConeSource()
mapper = vtk.vtkPolyDataMapper()
actor = vtk.vtkActor()
mapper.SetInputConnection(cone.GetOutputPort())
actor.SetMapper(mapper)
renderer.AddActor(actor)
renderer.ResetCamera()
renderWindow.Render()
# VTK Web application specific
_WebCone.view = renderWindow
self.Application.GetObjectIdMap().SetActiveObject("VIEW", renderWindow)
Much much smaller...
Yes we base all our code on ParaView hence that's the one that get all the work...
Not really, ParaView rely on VTK for everything and add the distribution and parallelism infrastructure. It is even possible to write pure VTK python code within a ParaViewWeb application.
The hard part is to understand the proxy abstraction that ParaView brings. Otherwise, everything is VTK.
Moreover, VTK is a library while ParaView is an application+framework+library.
I hope that give you some ideas on what to do. But I would definitely use ParaView and maybe create some programmable source to load your custom data. And if you want to do some C++, just create a plugin for ParaView (pure VTK code) to load your data and then you will be all set.
And thanks for your kind words...
BTW, for the example you followed for vtkWeb to work with the launcher you just need to edit the line
const config = { sessionURL: 'ws://localhost:1234/ws' };
And replace it by:
const config = { application: 'NameOfYourAppInYourLauncherConfig' };
Hello Sebastien!
Thank you very much for your quick reply and the detailed explanations, it makes things a lot clearer (my brain is starting to make the right connection now)!
For some reasons I was picturing VTK and ParaView as 2 "parallel branches", I was definitely wrong on that one. Based on the invaluable information you provided it indeed looks like I should stick with ParaView framework (and optionally write a plugin for I/O), especially if future plans include using mpi for rendering big datasets.
I will also need to get a closer look at paraview.simple
I must have missed a lot to think it didn't give as much capabilities as lower level VTK code.
It's true the proxy abstraction is not easy to grasp, I am not fully sure I understood everything but it will come with playing more with it for sure.
Well, the kind words are the least I can tell you, your work is just brilliant and the results are incredible. Thank you a lot!
Glad to help... ;-)
FYI - it is indeed as simple as const config = { application: 'my_app' };
it makes so much sense, I can't believed I missed that. Still learning :)
As for the VTK webcone code in Paraview (somehow I missed the VTK code snippet the first time I read your answer), it's hard to beat 3 lines of code. For some reason the VTK code is still more clear to me and I want to dig into Cone()
and Show()
, something is wrong with me for sure :)
Thanks a lot! cheers
Hello and Happy New Year!
I just started to tour ParaviewWeb, VTK, Visualizer and Light-Viz as well as its documentation so I apologize in advance if my question sounds stupid.
Here is a bit of background for you to understand where my question is coming from
(feel free to skip to here is the real question section below) I got to a point where I can render a display in the web browser Visualizer from a PV server (which happen to be both on my local machine for now). I followed the documented steps on Apache Front End + Python Launcher and everything seems to work just fine:
launcher.config
is pointing to PV Visualizerhttp://localhost:8080
, which triggers the graphic display rendered and the Visualizer web app to show in the browser: beautiful (thank you by the way)dist/index.html
to have extra keys so that data are loaded at the time the visualizer shows up in the browser. I launch the webapp withhttp://localhost:8080/?data=my_data
and here is mylauncher.config
apps section:Once again, it works beautifully (so thank you again for making it available).
In the meantime, I was successfully playing with the VTK remote rendering example (e.g. the Webcone one), so I figured, well I just need to add an app to my
launcher.config
and plug it to Visualizer. Of course that didn't work for many good reasons and I'll probably need to get my head around between the client connection and the server (the example hardcodes that connection). But one thing stroke me:here is now the real question :)
Should we be using VTK or PV server? From what I understood and figured out on my own (please correct me if I am wrong):
I am going to start developing a small custom web viewer app that will deal with custom data format, so I am preparing and welcoming any recommendations/opinions before I do.
Thanks a lot and apologies for this long block of text. cheers claude