[Paraview] ParaviewWeb - Python Script

Sebastien Jourdain sebastien.jourdain at kitware.com
Wed Dec 30 15:40:39 EST 2015


It will be ParaView/Python inside .../pv_web_visualizer.py

[...]

class _VisualizerServer(pv_wamp.PVServerProtocol):


    @staticmethod
    def add_arguments(parser):
       [...]
       # Add your extra arg here

    @staticmethod
    def configure(args):
        [...]
        # Extract your arg here

    def initialize(self):
        [...]
        # If script arg has content


self.registerVtkWebProtocol(pv_protocols.ParaViewWebStartupRemoteConnection(_VisualizerServer.dsHost,
_VisualizerServer.dsPort, _VisualizerServer.rsHost,
_VisualizerServer.rsPort, _VisualizerServer.rcPort))

self.registerVtkWebProtocol(pv_protocols.ParaViewWebStartupPluginLoader(_VisualizerServer.plugins))

self.registerVtkWebProtocol(pv_protocols.ParaViewWebFileListing(_VisualizerServer.dataDir,
"Home", _VisualizerServer.excludeRegex, _VisualizerServer.groupRegex))

self.registerVtkWebProtocol(pv_protocols.ParaViewWebProxyManager(allowedProxiesFile=_VisualizerServer.proxies,
baseDir=_VisualizerServer.dataDir, fileToLoad=_VisualizerServer.fileToLoad,
allowUnconfiguredReaders=_VisualizerServer.allReaders))

self.registerVtkWebProtocol(pv_protocols.ParaViewWebColorManager(pathToColorMaps=_VisualizerServer.colorPalette))
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebMouseHandler())
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebViewPort())

self.registerVtkWebProtocol(pv_protocols.ParaViewWebViewPortImageDelivery())

self.registerVtkWebProtocol(pv_protocols.ParaViewWebViewPortGeometryDelivery())
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebTimeHandler())

self.registerVtkWebProtocol(pv_protocols.ParaViewWebSelectionHandler())
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebWidgetManager())

self.registerVtkWebProtocol(pv_protocols.ParaViewWebKeyValuePairStore())

self.registerVtkWebProtocol(pv_protocols.ParaViewWebSaveData(baseSavePath=_VisualizerServer.saveDataDir))

        # Update authentication key to use
        self.updateSecret(_VisualizerServer.authKey)

        # Disable interactor-based render calls
        simple.GetRenderView().EnableRenderOnInteraction = 0

On Wed, Dec 30, 2015 at 12:24 PM, Ruggiero Guida <ruggiero.guida at gmail.com>
wrote:

> Thanks Sebastian,
>
> Sorry for the silly question, but I am not sure how I can run a script on
> the server once it has been initiated with
>
> server.start_webserver(options=args, protocol=_VisualizerServer)
>
> I am not very familiar with VTK programming.
>
> Thanks
> Ruggiero
>
>
>
> On 30 December 2015 at 19:18, Sebastien Jourdain <
> sebastien.jourdain at kitware.com> wrote:
>
>> Hi Ruggiero,
>>
>> It is definitely possible with ParaViewWeb. Either you embedded your
>> initialization code within the Python Script that define the ParaViewWeb
>> server or you can extend the pv_web_visualizer.py one to add a new argument
>> which could be the path to the script you want to run at initialization
>> time and then you make sure you process that arg and run that script before
>> starting the Web server.
>>
>> If you think that feature should be part of the Visualizer application,
>> then you can submit a pull request on our gitlab and assign me as reviewer.
>>
>> Happy new year!
>>
>> Seb
>>
>> On Wed, Dec 30, 2015 at 9:35 AM, Ruggiero Guida <ruggiero.guida at gmail.com
>> > wrote:
>>
>>> Hi,
>>>
>>> I use a Python script to run Paraview with predefined settings and
>>> automatically load files that are generated by an external application. At
>>> the moment I use the '--script' option so that the script is loaded when
>>> Paraview is launched.
>>>
>>> I would like to do something similar with ParaviewWeb. Is this possible?
>>> Do I need to modify one of the predefined examples directly to include this
>>> feature?
>>>
>>> Thanks and Happy New Year!
>>> Ruggiero
>>>
>>>
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the ParaView Wiki at:
>>> http://paraview.org/Wiki/ParaView
>>>
>>> Search the list archives at: http://markmail.org/search/?q=ParaView
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://public.kitware.com/mailman/listinfo/paraview
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20151230/846093cc/attachment.html>


More information about the ParaView mailing list