示例#1
0
    def initialize(self):
        # Bring used components
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebStartupRemoteConnection(
                _FileOpener.dsHost, _FileOpener.dsPort, _FileOpener.rsHost,
                _FileOpener.rsPort))
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebFileListing(_FileOpener.pathToList,
                                                "Home"))
        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())

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

        # Create default pipeline
        if _FileOpener.fileToLoad:
            _FileOpener.reader = simple.OpenDataFile(_FileOpener.fileToLoad)
            simple.Show()

            _FileOpener.view = simple.Render()
            _FileOpener.view.ViewSize = [800, 800]
            # If this is running on a Mac DO NOT use Offscreen Rendering
            #view.UseOffscreenRendering = 1
            simple.ResetCamera()
        else:
            _FileOpener.view = simple.GetRenderView()
            simple.Render()
            _FileOpener.view.ViewSize = [800, 800]
        simple.SetActiveView(_FileOpener.view)
示例#2
0
    def initialize(self):
        # Bring used components
        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.ParaViewWebPipelineManager(baseDir=_TestApp.dataDir))
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebProxyManager(
                allowedProxiesFile=_TestApp.proxyFile,
                baseDir=_TestApp.dataDir,
                allowUnconfiguredReaders=True))
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebColorManager(
                pathToColorMaps=_TestApp.colorMapsPath))
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebFileManager(_TestApp.dataDir))
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebRemoteConnection())
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebStartupRemoteConnection())
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebStateLoader())
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebTestProtocols())

        # Update authentication key to use
        self.updateSecret(_TestApp.authKey)
示例#3
0
    def initialize(self):
        from paraview import simple
        from paraview.web import protocols as pv_protocols

        # Bring used components
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebFileListing(TestProtocol.dataDir, "Home",
                                                TestProtocol.excludeRegex,
                                                TestProtocol.groupRegex))
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebPipelineManager(TestProtocol.dataDir,
                                                    TestProtocol.fileToLoad))
        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.ParaViewWebRemoteConnection())
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebFileManager(TestProtocol.dataDir))

        # Update authentication key to use
        self.updateSecret(TestProtocol.authKey)
示例#4
0
    def initialize(self):
        # Bring used components
        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(_VisualizerServer.viewportScale, _VisualizerServer.viewportMaxWidth, _VisualizerServer.viewportMaxHeight))
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebViewPortImageDelivery())
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebLocalRendering())
        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
        simple.GetRenderView().Background = [0,0,0]

        # Update interaction mode
        pxm = simple.servermanager.ProxyManager()
        interactionProxy = pxm.GetProxy('settings', 'RenderViewInteractionSettings')
        interactionProxy.Camera3DManipulators = ['Rotate', 'Pan', 'Zoom', 'Pan', 'Roll', 'Pan', 'Zoom', 'Rotate', 'Zoom']
示例#5
0
    def initialize(self):
        from paraview import simple
        from paraview.web import protocols as pv_protocols

        # Make sure ParaView is initialized
        if not simple.servermanager.ActiveConnection:
            simple.Connect()

        if not IPythonProtocol.producer:
            IPythonProtocol.producer = simple.DistributedTrivialProducer()
            IPythonProtocol.ActivateDataSet('iPython-demo')
            simple.Show(IPythonProtocol.producer)
            simple.Render()

        # Bring used components
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebFileListing(IPythonProtocol.dataDir, "Home", IPythonProtocol.excludeRegex, IPythonProtocol.groupRegex))
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebPipelineManager(IPythonProtocol.dataDir, IPythonProtocol.fileToLoad))
        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.ParaViewWebRemoteConnection())
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebFileManager(IPythonProtocol.dataDir))

        # Update authentication key to use
        self.updateSecret(IPythonProtocol.authKey)
示例#6
0
    def initialize(self):
        self._headers = {'Girder-Token': _ResultViewer.token}

        # Make sure we have a dataDir
        if not _ResultViewer.dataDir:
            _ResultViewer.dataDir = tempfile.mkdtemp()

        # Bring used components
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebFileListing(_ResultViewer.dataDir, "Home", _ResultViewer.excludeRegex, _ResultViewer.groupRegex))
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebProxyManager(allowedProxiesFile=_ResultViewer.proxies, baseDir=_ResultViewer.dataDir, allowUnconfiguredReaders=True))
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebColorManager(pathToColorMaps=_ResultViewer.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())

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

        # Download item if any
        if _ResultViewer.itemId:
            item_id = _ResultViewer.itemId
            item_files_url = '%s/item/%s/files' % (_ResultViewer.url, item_id)
            r = requests.get(item_files_url, headers=self._headers)
            self._check_status(r)

            files = r.json()

            if len(files) == 1:
                item_url = '%s/item/%s/download' % (_ResultViewer.url, item_id)
                r = requests.get(item_url, headers=self._headers)
                self._check_status(r)
                dest_path = os.path.join(_ResultViewer.dataDir, files[0]['name'])
                try:
                    os.makedirs(os.path.dirname(dest_path))
                except:
                    pass
                with open(dest_path, 'w') as fp:
                    fp.write(r.content)
            elif len(files) > 1:
                # Download the item in zip format
                item_url = '%s/item/%s/download' % (_ResultViewer.url, item_id)
                r = requests.get(item_url, headers=self._headers)
                self._check_status(r)
                files = zipfile.ZipFile(io.BytesIO(r.content))
                dest_path = os.path.join(_ResultViewer.dataDir)
                files.extractall(dest_path)
示例#7
0
    def initialize(self):
        # Bring used components
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebStartupRemoteConnection(
                _FileOpener.dsHost, _FileOpener.dsPort, _FileOpener.rsHost,
                _FileOpener.rsPort))
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebFileListing(_FileOpener.pathToList,
                                                "Home"))
        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())

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

        # Create default pipeline
        if _FileOpener.fileToLoad:
            _FileOpener.reader = simple.OpenDataFile(_FileOpener.fileToLoad)
            simple.Show()

            _FileOpener.view = simple.Render()
            _FileOpener.view.ViewSize = [800, 800]
            # If this is running on a Mac DO NOT use Offscreen Rendering
            #view.UseOffscreenRendering = 1
            simple.ResetCamera()
        else:
            _FileOpener.view = simple.GetRenderView()
            simple.Render()
            _FileOpener.view.ViewSize = [800, 800]

            # test to prove server's working
            # independently from the web components
            #c = simple.Cone()
            #c.Resolution = 128
            #simple.Hide(c)
            #p = simple.ProcessIdScalars()
            #r = simple.Show(p)
            #a = p.PointData.GetArray('ProcessId')
            #r.ColorArrayName = 'ProcessId'
            #simple.AssignLookupTable(a,'Cool to Warm')
            #simple.Render()
            #simple.SaveScreenshot('/usr/common/graphics/ParaView/4.2.0-PDACS/data/test.png')

        simple.SetActiveView(_FileOpener.view)
示例#8
0
    def initialize(self):
        # Bring used components
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebFileListing(LightVizServer.data, "Home",
                                                LightVizServer.excludeRegex,
                                                LightVizServer.groupRegex))
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebColorManager())
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebMouseHandler())
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebTimeHandler())
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebViewPort())

        # self.registerVtkWebProtocol(lv_protocols.LightVizViewportSize())
        self.registerVtkWebProtocol(
            lv_protocols.LightVizConfig(LightVizServer.config,
                                        LightVizServer.profile))
        datasetManager = lv_protocols.LightVizDatasets(
            LightVizServer.data, 1 if LightVizServer.offscreen else 0)
        clipManager = lv_protocols.LightVizClip(datasetManager)
        self.registerVtkWebProtocol(datasetManager)
        self.registerVtkWebProtocol(clipManager)
        self.registerVtkWebProtocol(
            lv_protocols.LightVizContour(datasetManager, clipManager))
        self.registerVtkWebProtocol(
            lv_protocols.LightVizSlice(datasetManager, clipManager))
        self.registerVtkWebProtocol(
            lv_protocols.LightVizMultiSlice(datasetManager, clipManager))
        self.registerVtkWebProtocol(
            lv_protocols.LightVizStreamline(datasetManager))
        self.registerVtkWebProtocol(
            lv_protocols.LightVizThreshold(datasetManager, clipManager))
        self.registerVtkWebProtocol(
            lv_protocols.LightVizVolume(datasetManager, clipManager))

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

        # Disable interactor-based render calls
        simple.GetRenderView().EnableRenderOnInteraction = 0
        simple.GetRenderView().Background = [0, 0, 0]
        simple.GetRenderView().Background2 = [0, 0, 0]

        # Update interaction mode
        pxm = simple.servermanager.ProxyManager()
        interactionProxy = pxm.GetProxy('settings',
                                        'RenderViewInteractionSettings')
        interactionProxy.Camera3DManipulators = [
            'Rotate', 'Pan', 'Zoom', 'Pan', 'Roll', 'Pan', 'Zoom', 'Rotate',
            'Zoom'
        ]
示例#9
0
    def initialize(self):
        # Bring used components
        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.ParaViewWebPipelineManager())
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebFileManager(_TestApp.dataDir))
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebRemoteConnection())
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebStartupRemoteConnection())
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebStateLoader())

        # Update authentication key to use
        self.updateSecret(_TestApp.authKey)
示例#10
0
    def initialize(self):
        # Bring used components
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebStartupRemoteConnection(
                _TestServer.dsHost,
                _TestServer.dsPort,
                _TestServer.rsHost,
                _TestServer.rsPort,
                _TestServer.rcPort,
            ))
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebStartupPluginLoader(_TestServer.plugins))
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebFileListing(
                _TestServer.dataDir,
                "Home",
                _TestServer.excludeRegex,
                _TestServer.groupRegex,
            ))
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebProxyManager(
                allowedProxiesFile=_TestServer.proxies,
                baseDir=_TestServer.dataDir,
                fileToLoad=_TestServer.fileToLoad,
                allowUnconfiguredReaders=_TestServer.allReaders,
            ))
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebColorManager(
                pathToColorMaps=_TestServer.colorPalette))
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebMouseHandler())
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebViewPort()
        )  # _TestServer.viewportScale, _TestServer.viewportMaxWidth, _TestServer.viewportMaxHeight
        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=_TestServer.saveDataDir))

        # Update authentication key to use
        self.updateSecret(_TestServer.authKey)
示例#11
0
    def initialize(self):
        # Bring used components
        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.ParaViewWebStateLoader(_VisualizerServer.fileToLoad))
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebFileListing(_VisualizerServer.dataDir,
                                                "Home",
                                                _VisualizerServer.excludeRegex,
                                                _VisualizerServer.groupRegex))
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebProxyManager(
                allowedProxiesFile=_VisualizerServer.proxies,
                baseDir=_VisualizerServer.dataDir,
                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
示例#12
0
 def initialize(self):
     # Bring used components
     self.registerVtkWebProtocol(
         pv_protocols.ParaViewWebFileListing(
             _VisualizerServer.dataDir, "Home",
             _VisualizerServer.excludeRegex,
             _VisualizerServer.groupRegex))
     self.registerVtkWebProtocol(
         pv_protocols.ParaViewWebProxyManager(
             baseDir=_VisualizerServer.dataDir,
             allowedProxiesFile=_VisualizerServer.proxies,
             allowUnconfiguredReaders=_VisualizerServer.allReaders))
     self.registerVtkWebProtocol(pv_protocols.ParaViewWebColorManager())
     self.registerVtkWebProtocol(pv_protocols.ParaViewWebMouseHandler())
     self.registerVtkWebProtocol(
         pv_protocols.ParaViewWebViewPort(
             _VisualizerServer.viewportScale,
             _VisualizerServer.viewportMaxWidth,
             _VisualizerServer.viewportMaxHeight))
     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.dataDir))
     # Disable interactor-based render calls
     simple.GetRenderView().EnableRenderOnInteraction = 0
     simple.GetRenderView().Background = [0, 0, 0]
     # Update interaction mode
     pxm = simple.servermanager.ProxyManager()
     interactionProxy = pxm.GetProxy('settings',
                                     'RenderViewInteractionSettings')
     interactionProxy.Camera3DManipulators = [
         'Rotate', 'Pan', 'Zoom', 'Pan', 'Roll', 'Pan', 'Zoom',
         'Rotate', 'Zoom'
     ]
示例#13
0
    def initialize(self):
        # Bring used components
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebStartupRemoteConnection(_PipelineManager.dsHost, _PipelineManager.dsPort, _PipelineManager.rsHost, _PipelineManager.rsPort))
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebStartupPluginLoader(_PipelineManager.plugins))
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebStateLoader(_PipelineManager.fileToLoad))
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebFileListing(_PipelineManager.dataDir, "Home", _PipelineManager.excludeRegex, _PipelineManager.groupRegex))
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebPipelineManager(_PipelineManager.dataDir, _PipelineManager.fileToLoad))
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebFilterList(_PipelineManager.filterFile))
        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.ParaViewWebRemoteConnection())
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebFileManager(_PipelineManager.dataDir))
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebSelectionHandler())

        # Update authentication key to use
        self.updateSecret(_PipelineManager.authKey)
示例#14
0
    def initialize(self):
        # Bring used components
        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.ParaViewWebStateLoader(_VisualizerServer.fileToLoad))
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebFileListing(_VisualizerServer.dataDir,
                                                "Home",
                                                _VisualizerServer.excludeRegex,
                                                _VisualizerServer.groupRegex))
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebProxyManager(
                allowedProxiesFile=_VisualizerServer.proxies,
                baseDir=_VisualizerServer.dataDir,
                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())

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

        # do custom processing
        if _VisualizerServer.pdacsFile:
            customStartupProcessing(_VisualizerServer.pdacsFile)
示例#15
0
    def initialize(self):
        # Bring used components from ParaView
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebStartupRemoteConnection(
                _Server.dsHost, _Server.dsPort, _Server.rsHost, _Server.rsPort,
                _Server.rcPort))
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebStartupPluginLoader(_Server.plugins))
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebFileListing(_Server.dataDir, "Home",
                                                _Server.excludeRegex,
                                                _Server.groupRegex))
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebProxyManager(
                allowedProxiesFile=_Server.proxies,
                baseDir=_Server.dataDir,
                fileToLoad=_Server.fileToLoad,
                allowUnconfiguredReaders=_Server.allReaders))
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebColorManager(
                pathToColorMaps=_Server.colorPalette,
                showBuiltin=_Server.showBuiltin))
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebMouseHandler())
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebViewPort(_Server.viewportScale,
                                             _Server.viewportMaxWidth,
                                             _Server.viewportMaxHeight))
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebPublishImageDelivery(decode=False))
        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=_Server.saveDataDir))

        # Bring used components from ParaView Lite
        self.registerVtkWebProtocol(local_protocols.ParaViewLite())

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

        # tell the C++ web app to use no encoding. ParaViewWebPublishImageDelivery must be set to decode=False to match.
        self.getApplication().SetImageEncoding(0)

        # Disable interactor-based render calls
        view = simple.GetRenderView()
        view.EnableRenderOnInteraction = 0
        view.Background = [
            0.4470588235294118, 0.4470588235294118, 0.4470588235294118
        ]
        view.Background2 = [
            0.2235294117647059, 0.2235294117647059, 0.2235294117647059
        ]
        view.UseGradientBackground = 1
        view.OrientationAxesVisibility = 0

        # ProxyManager helper
        pxm = simple.servermanager.ProxyManager()

        # Update interaction mode
        interactionProxy = pxm.GetProxy('settings',
                                        'RenderViewInteractionSettings')
        interactionProxy.Camera3DManipulators = [
            'Rotate', 'Pan', 'Zoom', 'Pan', 'Roll', 'Pan', 'Zoom', 'Rotate',
            'Zoom'
        ]

        # Custom rendering settings
        renderingSettings = pxm.GetProxy('settings', 'RenderViewSettings')
        renderingSettings.LODThreshold = _Server.settingsLODThreshold
示例#16
0
    def initialize(self):
        # Bring used components
        self.registerVtkWebProtocol(
            paraViewWebProtocols.ParaViewWebStartupRemoteConnection(
                RenderingServer.dsHost, RenderingServer.dsPort,
                RenderingServer.rsHost, RenderingServer.rsPort,
                RenderingServer.rcPort))
        self.registerVtkWebProtocol(
            paraViewWebProtocols.ParaViewWebStartupPluginLoader(
                RenderingServer.plugins))
        self.registerVtkWebProtocol(
            paraViewWebProtocols.ParaViewWebProxyManager(
                allowedProxiesFile=RenderingServer.proxies,
                baseDir=RenderingServer.dataDirectoryPath,
                fileToLoad=RenderingServer.fileToLoad,
                allowUnconfiguredReaders=RenderingServer.allReaders))
        self.registerVtkWebProtocol(
            paraViewWebProtocols.ParaViewWebMouseHandler())
        self.registerVtkWebProtocol(
            paraViewWebProtocols.ParaViewWebViewPort(
                RenderingServer.viewportScale,
                RenderingServer.viewportMaxWidth,
                RenderingServer.viewportMaxHeight))
        self.registerVtkWebProtocol(
            paraViewWebProtocols.ParaViewWebPublishImageDelivery(decode=False))
        self.registerVtkWebProtocol(
            paraViewWebProtocols.ParaViewWebLocalRendering())
        self.registerVtkWebProtocol(
            paraViewWebProtocols.ParaViewWebTimeHandler())
        self.registerVtkWebProtocol(
            paraViewWebProtocols.ParaViewWebSelectionHandler())
        self.registerVtkWebProtocol(
            paraViewWebProtocols.ParaViewWebWidgetManager())
        self.registerVtkWebProtocol(
            paraViewWebProtocols.ParaViewWebKeyValuePairStore())
        # self.registerVtkWebProtocol(paraViewWebProtocols.ParaViewWebSaveData(baseSavePath=RenderingServer.saveDataDir)) # Disabled
        # self.registerVtkWebProtocol(paraViewWebProtocols.ParaViewWebProgressUpdate()) # Not fully working yet

        # Initialize Viewer protocols
        print('Initializing Viewer protocols')
        self.registerVtkWebProtocol(
            Viewer(self.dataDirectoryPath, self.dataLoadSignatureDecoder))

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

        # Tell the C++ web app to use no encoding. ParaViewWebPublishImageDelivery must be set to decode=False to match.
        self.getApplication().SetImageEncoding(0)

        # Disable interactor-based render calls
        simple.GetRenderView().EnableRenderOnInteraction = 0
        simple.GetRenderView().Background = [0, 0, 0]

        # ProxyManager helper
        proxyManager = simple.servermanager.ProxyManager()

        # Update interaction mode
        interactionProxy = proxyManager.GetProxy(
            'settings', 'RenderViewInteractionSettings')
        interactionProxy.Camera3DManipulators = [
            'Rotate', 'Pan', 'Zoom', 'Pan', 'Roll', 'Pan', 'Zoom', 'Rotate',
            'Zoom'
        ]

        # Custom rendering settings
        renderingSettings = proxyManager.GetProxy('settings',
                                                  'RenderViewSettings')
        renderingSettings.LODThreshold = RenderingServer.settingsLODThreshold

        print('-------')