ParaViewWeb Manta setting

From KitwarePublic
Jump to: navigation, search



Manta is a RayTracer engine which has been integrated as a plugin in Paraview. To make Manta available for ParaViewWeb, you will have to customize the setting of the PWServer executable to start a pvserver at the same time as the PWServer.

Configure the Web server

To do so, you will need to edit your file and replace the default one or create a new one like we did with the manta keyword.


So to use this configuration, the web developer will need to create the Paraview object as follow.

 var paraview = new Paraview("manta session", "sample code to start a manta session", "manta")

Starting scripts

As you will need to encapsulate in a single call the start of the pvserver and PWServer which act as a client against the pvserver, you will need to write a script like the following one. The limitation with the following one, is that only one server can run at a time since the default 11111 port will be used by the pvserver.

 # file:
 .../ParaView-build/bin/pvserver &
 .../ParaViewWeb-build/ParaViewAdapter/PWServer --server-hostname=localhost --server-port=11111 --batch-file=.../ $1 $2 $3 $4 $5 $6 $7

Moreover, in order to create a manta view, we have to load the plugin and create it from a server side python script which can also be inside a plugin. But what we provide here, is an automatic setting with no plugin involved.

 # file:
 import paraview
 buildDir = '.../ParaView-build/bin'
 paraview.simple.LoadPlugin(buildDir+"/", False)
 paraview.simple.LoadPlugin(buildDir+"/", True)
 paraview.simple.active_objects.view = paraview.simple._create_view("MantaIceTDesktopRenderView")
 paraview.simple.active_objects.view.Threads = 8
 paraview.simple.active_objects.view.ViewSize = [300,300]

Scripts to find free port

The following script return an available network port that can be used by pvserver in a given range.

 # FileName:
 for port in {11111..11211}
   result=`netstat -vatn | grep ":$port " | wc -l`
   if [ $result == 0 ]
       echo "$port"
       exit 0

The start script with findPort

 .../ParaView-build/bin/pvserver --server-port=$port &
 .../ParaViewWeb-build/ParaViewAdapter/PWServer --server-hostname=localhost --server-port=$port --batch-file=.../ $1 $2 $3 $4 $5 $6 $7