Пример #1
0
 def initialize(self):
     self.registerVtkWebProtocol(pv_protocols.ParaViewWebMouseHandler())
     self.registerVtkWebProtocol(pv_protocols.ParaViewWebViewPort())
     self.registerVtkWebProtocol(
         pv_protocols.ParaViewWebViewPortImageDelivery())
     self.registerVtkWebProtocol(DICOMRenderManagerProtocol())
     self.updateSecret(RemoteVisualizerServerProtocol.authKey)
Пример #2
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)
Пример #3
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)
Пример #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

        # 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)
Пример #6
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)
Пример #7
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)
Пример #8
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)
Пример #9
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)
Пример #10
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)
Пример #11
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)
Пример #12
0
    def initialize(self):
        # Bring used components
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebMouseHandler())
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebViewPort())
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebViewPortImageDelivery())

        colorManager = pv_protocols.ParaViewWebColorManager()
        self.registerVtkWebProtocol(colorManager)

        dataProtocol = DivvyProtocol(_DivvyServer.fileToLoad)
        self.registerVtkWebProtocol(dataProtocol)
        self.registerVtkWebProtocol(
            ScatterPlotProtocol(dataProtocol, colorManager))
        self.updateSecret(_DivvyServer.authKey)
Пример #13
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)
Пример #14
0
    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]
    def initialize(self):
        # Bring used components
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebMouseHandler())
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebViewPort())
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebViewPortImageDelivery())

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

        # Process file only once
        if not _MeshViewer.faces:
            try:
                self.processFile()
            except Exception as inst:
                print "Caught exception processing file:"
                print inst
Пример #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())
        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
Пример #17
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'
     ]
Пример #18
0
    def initialize(self):
        # Bring used components
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebMouseHandler())
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebViewPort())
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebViewPortImageDelivery())

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

        _MeshViewer.meshFile = None
        # Process file onlu once
        if not _MeshViewer.faces:
            try:
                self.processFile()
            except:
                if _MeshViewer.meshFile:
                    os.remove(_MeshViewer.meshFile)
                raise
Пример #19
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)
Пример #20
0
    def initialize(self):

        # Register the built-in protocols: MouseHandler, ViewPort and
        # ViewPortImageDelivery.  (You can see these over on the client
        # in the createClient call)
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebMouseHandler())
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebViewPort(PVWSDServer.viewportScale,
                                             PVWSDServer.viewportMaxWidth,
                                             PVWSDServer.viewportMaxHeight))
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebViewPortImageDelivery())

        # Instantiate an object with the custom protocols...
        PVWSDTest = PVWSDProtocols.PVWSDTest()

        #                                      ... and register them, too.
        self.registerVtkWebProtocol(PVWSDTest)

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

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

        # Initialize our scene.
        PVWSDTest.drawCone()

        # Update interaction mode
        pxm = simple.servermanager.ProxyManager()
        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 = 102400
Пример #21
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)
Пример #22
0
    def initialize(self):
        # Bring used components
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebMouseHandler())
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebViewPort())
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebViewPortImageDelivery())
        self.updateSecret(_DemoServer.authKey)

        # Disable interactor-based render calls
        simple.GetRenderView().EnableRenderOnInteraction = 0
        simple.GetRenderView().Background = [0, 0, 0]
        cone = simple.Cone()
        simple.Show(cone)
        simple.Render()
        # Update interaction mode
        pxm = simple.servermanager.ProxyManager()
        interactionProxy = pxm.GetProxy('settings',
                                        'RenderViewInteractionSettings')
        interactionProxy.Camera3DManipulators = [
            'Rotate', 'Pan', 'Zoom', 'Pan', 'Roll', 'Pan', 'Zoom', 'Rotate',
            'Zoom'
        ]
Пример #23
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()
Пример #24
0
    def initialize(self):

        # Bring used components
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebMouseHandler())
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebViewPort())
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebViewPortImageDelivery())
        self.registerVtkWebProtocol(amsProtocol())
        self.updateSecret(_DemoServer.authKey)

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

        # create a new 'EnSight Reader'

        #### disable automatic camera reset on 'Show'
        #paraview.simple._DisableFirstRenderCameraReset()

        # create a new 'EnSight Reader'
        matvizmofTFF90L91lpm100rpmcase = simple.EnSightReader(
            CaseFileName=
            '/Users/tomfool/tech/18/amgen/ams-102-AgileViz/EnSight/mat-viz-mofTFF-90L-9.1lpm-100rpm/mat-viz-mofTFF-90L-9.1lpm-100rpm.case'
        )
        matvizmofTFF90L91lpm100rpmcase.PointArrays = [
            'pressure', 'pressure_coefficient', 'dynamic_pressure',
            'absolute_pressure', 'total_pressure', 'rel_total_pressure',
            'density', 'density_all', 'velocity_magnitude', 'x_velocity',
            'y_velocity', 'z_velocity', 'axial_velocity', 'radial_velocity',
            'tangential_velocity', 'rel_velocity_magnitude',
            'relative_x_velocity', 'relative_y_velocity',
            'relative_z_velocity', 'rel_tangential_velocity',
            'mesh_x_velocity', 'mesh_y_velocity', 'mesh_z_velocity',
            'velocity_angle', 'relative_velocity_angle', 'vorticity_mag',
            'helicity', 'x_vorticity', 'y_vorticity', 'z_vorticity',
            'cell_reynolds_number', 'turb_kinetic_energy', 'turb_intensity',
            'turb_diss_rate', 'production_of_k', 'viscosity_turb',
            'viscosity_eff', 'viscosity_ratio', 'y_star', 'y_plus',
            'uds_0_scalar', 'uds_0_diff_scalar', 'viscosity_lam', 'wall_shear',
            'x_wall_shear', 'y_wall_shear', 'z_wall_shear',
            'skin_friction_coef', 'cell_partition_active',
            'cell_partition_stored', 'cell_id', 'cell_element_type',
            'cell_type', 'cell_zone', 'partition_neighbors', 'cell_weight',
            'x_coordinate', 'y_coordinate', 'z_coordinate', 'axial_coordinate',
            'angular_coordinate', 'abs_angular_coordinate',
            'radial_coordinate', 'face_area_magnitude', 'x_face_area',
            'y_face_area', 'z_face_area', 'cell_volume', 'orthogonal_quality',
            'cell_equiangle_skew', 'cell_equivolume_skew', 'face_handedness',
            'mark_poor_elememts', 'interface_overlap_fraction',
            'cell_wall_distance', 'adaption_function', 'adaption_curvature',
            'adaption_space_gradient', 'adaption_iso_value',
            'boundary_cell_dist', 'boundary_normal_dist', 'cell_volume_change',
            'cell_surface_area', 'cell_warp', 'cell_children',
            'cell_refine_level', 'mass_imbalance', 'strain_rate_mag',
            'dx_velocity_dx', 'dy_velocity_dx', 'dz_velocity_dx',
            'dx_velocity_dy', 'dy_velocity_dy', 'dz_velocity_dy',
            'dx_velocity_dz', 'dy_velocity_dz', 'dz_velocity_dz', 'dp_dx',
            'dp_dy', 'dp_dz', 'velocity'
        ]

        # get active view
        renderView1 = simple.GetActiveViewOrCreate('RenderView')
        # uncomment following to set a specific view size
        # renderView1.ViewSize = [1638, 1076]

        # show data in view
        matvizmofTFF90L91lpm100rpmcaseDisplay = simple.Show(
            matvizmofTFF90L91lpm100rpmcase, renderView1)

        # get color transfer function/color map for 'pressure'
        pressureLUT = simple.GetColorTransferFunction('pressure')

        # get opacity transfer function/opacity map for 'pressure'
        pressurePWF = simple.GetOpacityTransferFunction('pressure')

        # trace defaults for the display properties.
        matvizmofTFF90L91lpm100rpmcaseDisplay.Representation = 'Surface'
        matvizmofTFF90L91lpm100rpmcaseDisplay.ColorArrayName = [
            'POINTS', 'pressure'
        ]
        matvizmofTFF90L91lpm100rpmcaseDisplay.LookupTable = pressureLUT
        matvizmofTFF90L91lpm100rpmcaseDisplay.OSPRayScaleArray = 'pressure'
        matvizmofTFF90L91lpm100rpmcaseDisplay.OSPRayScaleFunction = 'PiecewiseFunction'
        matvizmofTFF90L91lpm100rpmcaseDisplay.SelectOrientationVectors = 'velocity'
        matvizmofTFF90L91lpm100rpmcaseDisplay.ScaleFactor = 0.07445502169430256
        matvizmofTFF90L91lpm100rpmcaseDisplay.SelectScaleArray = 'pressure'
        matvizmofTFF90L91lpm100rpmcaseDisplay.GlyphType = 'Arrow'
        matvizmofTFF90L91lpm100rpmcaseDisplay.GlyphTableIndexArray = 'pressure'
        matvizmofTFF90L91lpm100rpmcaseDisplay.GaussianRadius = 0.03722751084715128
        matvizmofTFF90L91lpm100rpmcaseDisplay.SetScaleArray = [
            'POINTS', 'pressure'
        ]
        matvizmofTFF90L91lpm100rpmcaseDisplay.ScaleTransferFunction = 'PiecewiseFunction'
        matvizmofTFF90L91lpm100rpmcaseDisplay.OpacityArray = [
            'POINTS', 'pressure'
        ]
        matvizmofTFF90L91lpm100rpmcaseDisplay.OpacityTransferFunction = 'PiecewiseFunction'
        matvizmofTFF90L91lpm100rpmcaseDisplay.DataAxesGrid = 'GridAxesRepresentation'
        matvizmofTFF90L91lpm100rpmcaseDisplay.SelectionCellLabelFontFile = ''
        matvizmofTFF90L91lpm100rpmcaseDisplay.SelectionPointLabelFontFile = ''
        matvizmofTFF90L91lpm100rpmcaseDisplay.PolarAxes = 'PolarAxesRepresentation'
        matvizmofTFF90L91lpm100rpmcaseDisplay.ScalarOpacityFunction = pressurePWF
        matvizmofTFF90L91lpm100rpmcaseDisplay.ScalarOpacityUnitDistance = 0.007476863260594431

        # init the 'PiecewiseFunction' selected for 'ScaleTransferFunction'
        matvizmofTFF90L91lpm100rpmcaseDisplay.ScaleTransferFunction.Points = [
            -152.6022491455078, 0.0, 0.5, 0.0, 144.73870849609375, 1.0, 0.5,
            0.0
        ]

        # init the 'PiecewiseFunction' selected for 'OpacityTransferFunction'
        matvizmofTFF90L91lpm100rpmcaseDisplay.OpacityTransferFunction.Points = [
            -152.6022491455078, 0.0, 0.5, 0.0, 144.73870849609375, 1.0, 0.5,
            0.0
        ]

        # init the 'GridAxesRepresentation' selected for 'DataAxesGrid'
        matvizmofTFF90L91lpm100rpmcaseDisplay.DataAxesGrid.XTitleFontFile = ''
        matvizmofTFF90L91lpm100rpmcaseDisplay.DataAxesGrid.YTitleFontFile = ''
        matvizmofTFF90L91lpm100rpmcaseDisplay.DataAxesGrid.ZTitleFontFile = ''
        matvizmofTFF90L91lpm100rpmcaseDisplay.DataAxesGrid.XLabelFontFile = ''
        matvizmofTFF90L91lpm100rpmcaseDisplay.DataAxesGrid.YLabelFontFile = ''
        matvizmofTFF90L91lpm100rpmcaseDisplay.DataAxesGrid.ZLabelFontFile = ''

        # init the 'PolarAxesRepresentation' selected for 'PolarAxes'
        matvizmofTFF90L91lpm100rpmcaseDisplay.PolarAxes.PolarAxisTitleFontFile = ''
        matvizmofTFF90L91lpm100rpmcaseDisplay.PolarAxes.PolarAxisLabelFontFile = ''
        matvizmofTFF90L91lpm100rpmcaseDisplay.PolarAxes.LastRadialAxisTextFontFile = ''
        matvizmofTFF90L91lpm100rpmcaseDisplay.PolarAxes.SecondaryRadialAxesTextFontFile = ''

        # reset view to fit data
        renderView1.ResetCamera()

        # show color bar/color legend
        matvizmofTFF90L91lpm100rpmcaseDisplay.SetScalarBarVisibility(
            renderView1, True)

        # update the view to ensure updated data information
        renderView1.Update()

        # hide data in view
        simple.Hide(matvizmofTFF90L91lpm100rpmcase, renderView1)

        # create a new 'Contour'
        contour1 = simple.Contour(Input=matvizmofTFF90L91lpm100rpmcase)
        contour1.ContourBy = ['POINTS', 'pressure']
        contour1.Isosurfaces = [-3.9317703247070312]
        contour1.PointMergeMethod = 'Uniform Binning'

        # Properties modified on contour1
        contour1.ContourBy = ['POINTS', 'uds_0_scalar']
        contour1.Isosurfaces = [480.0, 570.0]

        # show data in view
        contour1Display = simple.Show(contour1, renderView1)

        # trace defaults for the display properties.
        contour1Display.Representation = 'Surface'
        contour1Display.ColorArrayName = ['POINTS', 'pressure']
        contour1Display.LookupTable = pressureLUT
        contour1Display.OSPRayScaleArray = 'Normals'
        contour1Display.OSPRayScaleFunction = 'PiecewiseFunction'
        contour1Display.SelectOrientationVectors = 'velocity'
        contour1Display.ScaleFactor = 0.07228952534496784
        contour1Display.SelectScaleArray = 'None'
        contour1Display.GlyphType = 'Arrow'
        contour1Display.GlyphTableIndexArray = 'None'
        contour1Display.GaussianRadius = 0.03614476267248392
        contour1Display.SetScaleArray = ['POINTS', 'Normals']
        contour1Display.ScaleTransferFunction = 'PiecewiseFunction'
        contour1Display.OpacityArray = ['POINTS', 'Normals']
        contour1Display.OpacityTransferFunction = 'PiecewiseFunction'
        contour1Display.DataAxesGrid = 'GridAxesRepresentation'
        contour1Display.SelectionCellLabelFontFile = ''
        contour1Display.SelectionPointLabelFontFile = ''
        contour1Display.PolarAxes = 'PolarAxesRepresentation'

        # init the 'PiecewiseFunction' selected for 'ScaleTransferFunction'
        contour1Display.ScaleTransferFunction.Points = [
            -0.9995924830436707, 0.0, 0.5, 0.0, 0.9998393058776855, 1.0, 0.5,
            0.0
        ]

        # init the 'PiecewiseFunction' selected for 'OpacityTransferFunction'
        contour1Display.OpacityTransferFunction.Points = [
            -0.9995924830436707, 0.0, 0.5, 0.0, 0.9998393058776855, 1.0, 0.5,
            0.0
        ]

        # init the 'GridAxesRepresentation' selected for 'DataAxesGrid'
        contour1Display.DataAxesGrid.XTitleFontFile = ''
        contour1Display.DataAxesGrid.YTitleFontFile = ''
        contour1Display.DataAxesGrid.ZTitleFontFile = ''
        contour1Display.DataAxesGrid.XLabelFontFile = ''
        contour1Display.DataAxesGrid.YLabelFontFile = ''
        contour1Display.DataAxesGrid.ZLabelFontFile = ''

        # init the 'PolarAxesRepresentation' selected for 'PolarAxes'
        contour1Display.PolarAxes.PolarAxisTitleFontFile = ''
        contour1Display.PolarAxes.PolarAxisLabelFontFile = ''
        contour1Display.PolarAxes.LastRadialAxisTextFontFile = ''
        contour1Display.PolarAxes.SecondaryRadialAxesTextFontFile = ''

        # reset view to fit data
        renderView1.ResetCamera()

        # hide data in view
        simple.Hide(matvizmofTFF90L91lpm100rpmcase, renderView1)

        # show color bar/color legend
        contour1Display.SetScalarBarVisibility(renderView1, True)

        # update the view to ensure updated data information
        renderView1.Update()

        # set scalar coloring
        simple.ColorBy(contour1Display, ('POINTS', 'velocity_magnitude'))

        # rescale color and/or opacity maps used to include current data range
        contour1Display.RescaleTransferFunctionToDataRange(True, False)

        # show color bar/color legend
        contour1Display.SetScalarBarVisibility(renderView1, True)

        # get color transfer function/color map for 'velocity_magnitude'
        velocity_magnitudeLUT = simple.GetColorTransferFunction(
            'velocity_magnitude')

        #### saving camera placements for all active views

        # current camera placement for renderView1
        renderView1.CameraPosition = [
            1.3051878628081257, -1.32358496378265, -0.017141331493847792
        ]
        renderView1.CameraFocalPoint = [
            -0.052487090229988105, 0.03264869749546056, -0.3026974257081747
        ]
        renderView1.CameraViewUp = [
            -0.5051031518286454, -0.33848038039346323, 0.7939155106820026
        ]
        renderView1.CameraParallelScale = 0.5021485229089222

        #### uncomment the following to render all views
        # RenderAllViews()
        # alternatively, if you want to write images, you can use SaveScreenshot(...).

        ### OLD FOLLOWS

        simple.Render()

        # Update interaction mode
        pxm = simple.servermanager.ProxyManager()
        interactionProxy = pxm.GetProxy('settings',
                                        'RenderViewInteractionSettings')
        print(dir(interactionProxy))

        interactionProxy.Camera3DManipulators = [
            'Rotate', 'Pan', 'Zoom', 'Pan', 'Roll', 'Pan', 'Zoom', 'Rotate',
            'Zoom'
        ]

        print("done with initialize()")
Пример #25
0
 def __init__(self, config):
     wamp.ServerProtocol.__init__(self, config)
     wamp.imageCapture = pv_protocols.ParaViewWebViewPortImageDelivery()
     wamp.imageCapture.setApplication(self.Application)