Exemple #1
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)
Exemple #2
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)
Exemple #3
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)
    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.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
        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']
    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)
Exemple #6
0
    def initialize(self):
        global directoryToList
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebMouseHandler())
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebViewPort())
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebViewPortImageDelivery())
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebViewPortGeometryDelivery())

        # Update authentication key to use
        self.updateSecret(_DataProber.authKey)
Exemple #7
0
    def initialize(self):
        global authKey

        # Bring used components
        self.registerVtkWebProtocol(protocols.ParaViewWebMouseHandler())
        self.registerVtkWebProtocol(protocols.ParaViewWebViewPort())
        self.registerVtkWebProtocol(
            protocols.ParaViewWebViewPortImageDelivery())
        self.registerVtkWebProtocol(
            protocols.ParaViewWebViewPortGeometryDelivery())

        # Update authentication key to use
        self.updateSecret(authKey)
Exemple #8
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)
Exemple #9
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)
Exemple #10
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)
Exemple #11
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)
    def initialize(self):
        # Bring used components
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebStartupPluginLoader(
                _PVCatalystManager.plugins))
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebMouseHandler())
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebViewPort())
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebViewPortImageDelivery())
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebViewPortGeometryDelivery())

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

        view = simple.GetRenderView()
        view.Background = [1, 1, 1]
Exemple #13
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
 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,
             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'
     ]
Exemple #15
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)
Exemple #16
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)
Exemple #17
0
    def initialize(self):
        global renderer, renderWindow, renderWindowInteractor, cone, mapper, actor

        # Bring used components
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebMouseHandler())
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebViewPort())
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebViewPortImageDelivery())
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebViewPortGeometryDelivery())

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

        # Create default pipeline (Only once for all the session)
        if not _WebCone.view:
            m000_ = GenericIOReader(FileName=self.fileName)

            m000_.xAxis = 'x'
            m000_.yAxis = 'y'
            m000_.zAxis = 'z'
            m000_.PointArrayStatus = ['vx', 'vy', 'vz', 'id', 'fof_halo_tag']

            self.view = GetRenderView()
            DataRepresentation1 = Show()
            DataRepresentation1.ScaleFactor = 12.799999237060547
            DataRepresentation1.ScalarOpacityUnitDistance = 1.7320512506334491
            DataRepresentation1.SelectionPointFieldDataArrayName = 'fof_halo_tag'
            DataRepresentation1.EdgeColor = [0.0, 0.0, 0.50000762951094835]

            self.view.CenterOfRotation = [
                63.999996662139893, 63.999996185302734, 63.999996185302734
            ]

            Calculator1 = Calculator()

            self.view.CameraPosition = [
                63.999996662139893, 63.999996185302734, 492.29631710692331
            ]
            self.view.CameraFocalPoint = [
                63.999996662139893, 63.999996185302734, 63.999996185302734
            ]
            self.view.CameraClippingRange = [
                296.65336530365192, 595.04075617962826
            ]
            self.view.CameraParallelScale = 110.85124480185661

            DataRepresentation2 = Show()
            DataRepresentation2.ScaleFactor = 12.799999237060547
            DataRepresentation2.ScalarOpacityUnitDistance = 1.7320512506334491
            DataRepresentation2.SelectionPointFieldDataArrayName = 'fof_halo_tag'
            DataRepresentation2.EdgeColor = [0.0, 0.0, 0.50000762951094835]

            DataRepresentation1.Visibility = 0

            Calculator1.Function = 'iHat*vx + jHat*vy + kHat*vz'
            Calculator1.ResultArrayName = 'velocity'

            self.view.Background2 = [0.0, 0.0, 0.16470588235294117]
            self.view.Background = [0.0, 0.0, 0.0]
            self.view.CenterAxesVisibility = 0

            a3_velocity_PVLookupTable = GetLookupTableForArray(
                "velocity",
                3,
                RGBPoints=[
                    22.220290592721472, 0.27843099999999998,
                    0.27843099999999998, 0.85882400000000003,
                    2772.329145661583, 0.0, 0.0, 0.36078399999999999,
                    5503.2064702754178, 0.0, 1.0, 1.0, 8272.5468557993063, 0.0,
                    0.50196099999999999, 0.0, 11003.42418041314, 1.0, 1.0, 0.0,
                    13753.533035482002, 1.0, 0.38039200000000001, 0.0,
                    16503.641890550865, 0.41960799999999998, 0.0, 0.0,
                    19253.750745619727, 0.87843099999999996,
                    0.30196099999999998, 0.30196099999999998
                ],
                VectorMode='Magnitude',
                NanColor=[1.0, 1.0, 0.0],
                ColorSpace='RGB',
                ScalarRangeInitialized=1.0)
            a3_velocity_PiecewiseFunction = CreatePiecewiseFunction(Points=[
                22.220290592721472, 0.0, 0.5, 0.0, 19253.750745619727, 1.0,
                0.5, 0.0
            ])
            ScalarBarWidgetRepresentation1 = CreateScalarBar(
                ComponentTitle='Magnitude',
                Title='velocity',
                Enabled=1,
                LabelFontSize=8,
                TitleFontSize=8)
            ScalarBarWidgetRepresentation1.LookupTable = a3_velocity_PVLookupTable
            self.view.Representations.append(ScalarBarWidgetRepresentation1)

            DataRepresentation2.ScalarOpacityFunction = a3_velocity_PiecewiseFunction
            DataRepresentation2.ColorArrayName = ('POINT_DATA', 'velocity')
            DataRepresentation2.PointSize = 1.0
            DataRepresentation2.LookupTable = a3_velocity_PVLookupTable

            a3_velocity_PVLookupTable.ScalarOpacityFunction = a3_velocity_PiecewiseFunction

            Render()

            # Fix lookup table range
            data = Calculator1.GetPointDataInformation()
            (minValue, maxValue) = data.GetArray('velocity').GetRange(-1)
            rgbPoints = a3_velocity_PVLookupTable.RGBPoints
            rgbPointsMod = []
            for i in range(8):
                alpha = i / 7.0
                rgbPointsMod.append((1 - alpha) * minValue + alpha * maxValue)
                rgbPointsMod.append(rgbPoints[4 * i + 1])
                rgbPointsMod.append(rgbPoints[4 * i + 2])
                rgbPointsMod.append(rgbPoints[4 * i + 3])
            a3_velocity_PVLookupTable.RGBPoints = rgbPointsMod

            Render()