Exemplo n.º 1
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']
Exemplo n.º 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)
Exemplo n.º 3
0
    def initialize(self):
        # Bring used components from ParaView
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebMouseHandler())
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebViewPort(_Server.viewportScale,
                                             _Server.viewportMaxWidth,
                                             _Server.viewportMaxHeight))
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebPublishImageDelivery(decode=False))

        # Bring used components from ParaView Lite
        self.registerVtkWebProtocol(
            flow_protocols.FlowProtocol(filepath=_Server.dataset))

        # 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)

        # ProxyManager helper
        pxm = simple.servermanager.ProxyManager()
        renderingSettings = pxm.GetProxy('settings', 'RenderViewSettings')
        renderingSettings.LODThreshold = _Server.settingsLODThreshold
        interactionProxy = pxm.GetProxy('settings',
                                        'RenderViewInteractionSettings')
        interactionProxy.Camera3DManipulators = [
            'Rotate', 'Pan', 'Zoom', 'Pan', 'Roll', 'Pan', 'Zoom', 'Rotate',
            'Zoom'
        ]
Exemplo n.º 4
0
    def initialize(self):
        # Bring used components from ParaView
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebMouseHandler())
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebViewPort(_Server.viewportScale, _Server.viewportMaxWidth, _Server.viewportMaxHeight))
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebPublishImageDelivery(decode=False))

        # Bring used components from ParaView Lite
        self.registerVtkWebProtocol(local_protocol.ParaViewCone())

        # 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.OrientationAxesVisibility = 0
        view.Background = [0.5, 0.5, 0.5]

        # 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
Exemplo n.º 5
0
    def initialize(self):
        # Bring used components
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebMouseHandler())
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebViewPort())
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebPublishImageDelivery(decode=False))
        self.updateSecret(_DemoServer.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]
        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'
        ]
Exemplo n.º 6
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)
Exemplo n.º 7
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)
Exemplo n.º 8
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)
Exemplo n.º 9
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)
Exemplo n.º 10
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)
Exemplo n.º 11
0
    def initialize(self):

        # Bring used components
#        self.registerVtkWebProtocol(pv_protocols.ParaViewWebFileListing(AMSServer.data, "Home", AMSServer.excludeRegex, AMSServer.groupRegex))
#        self.registerVtkWebProtocol(pv_protocols.ParaViewWebColorManager())
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebMouseHandler())
#        self.registerVtkWebProtocol(pv_protocols.ParaViewWebTimeHandler())
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebViewPort(AMSServer.viewportScale, AMSServer.viewportMaxWidth, AMSServer.viewportMaxHeight))
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebPublishImageDelivery(decode=False))
#        self.registerVtkWebProtocol(pv_protocols.ParaViewWebViewPortImageDelivery())
#        self.registerVtkWebProtocol(pv_protocols.ParaViewPublishImageDelivery())

        amstest = AMSProtocols.AMSTest(AMSServer.config, AMSServer.profile)

        ## Register the AMS components
        self.registerVtkWebProtocol(amstest)

        # Update authentication key to use
        self.updateSecret(AMSServer.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]
        simple.GetRenderView().Background2 = [0,0,0]

        if self.dataConfig:
            amstest.initializeData( self.dataConfig["dataCatalog"] )
        else:
            amstest.initializeData( ["/Users/tomfool/tech/18/amgen/ams-102-AgileViz/EnSight/mat-viz-mofTFF-90L-9.1lpm-100rpm/mat-viz-mofTFF-90L-9.1lpm-100rpm.case", "/Users/tomfool/tech/18/amgen/ams-102-AgileViz/EnSight/mat-viz-mofTFF-90L-9.1lpm-250rpm/mat-viz-mofTFF-90L-9.1lpm-250rpm.case" ])

         # 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 = AMSServer.settingsLODThreshold
Exemplo n.º 12
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)
Exemplo n.º 13
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)
Exemplo n.º 14
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)
Exemplo n.º 15
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'
        ]
Exemplo n.º 16
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)
Exemplo n.º 17
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)
Exemplo n.º 18
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.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
Exemplo n.º 20
0
    def initialize(self):
        # Bring used components
        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.ParaViewWebLocalRendering())

        # 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.BackgroundColorMode = "Gradient"
        view.Background = [0, 0, 0]
        view.Background2 = [0.5, 0.5, 0.5]

        # 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

        # Put something in the scene
        simple.Cone()
        rep = simple.Show()
        rep.Representation = 'Surface With Edges'
        rep.LineWidth = 2

        simple.Render()
Exemplo n.º 21
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]
Exemplo n.º 22
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
Exemplo n.º 23
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'
     ]
Exemplo n.º 24
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
Exemplo n.º 25
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)
Exemplo n.º 26
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
Exemplo n.º 27
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)
Exemplo n.º 28
0
    def initialize(self):
        # Bring used components
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebMouseHandler())
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebViewPort(
                MultiViewServer.viewportScale,
                MultiViewServer.viewportMaxWidth,
                MultiViewServer.viewportMaxHeight))
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebPublishImageDelivery(decode=False))

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

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

        # Create of 2 views with different content
        self.registerVtkWebProtocol(
            UserProtocol(
                [self.addView(simple.Cone()),
                 self.addView(simple.Sphere())]))
Exemplo n.º 29
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'
        ]
Exemplo n.º 30
0
    def initialize(self):
        # Bring used components
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebMouseHandler())
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebViewPort(_DivvyServer.viewportScale,
                                             _DivvyServer.viewportMaxWidth,
                                             _DivvyServer.viewportMaxHeight))
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebPublishImageDelivery(decode=False))

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

        dataProtocol = DivvyProtocol(_DivvyServer.fileToLoad)
        self.registerVtkWebProtocol(dataProtocol)
        scatterplot = ScatterPlotProtocol(dataProtocol, colorManager)
        self.registerVtkWebProtocol(scatterplot)
        dataProtocol.setScatterPlot(scatterplot)
        scatterplot.attachListeners()

        self.updateSecret(_DivvyServer.authKey)

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