Exemple #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']
Exemple #2
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()
Exemple #3
0
    def initialize(self):
        # Bring used components
        self.registerVtkWebProtocol(
            paraViewWebProtocols.ParaViewWebStartupRemoteConnection(
                RenderingServer.dsHost, RenderingServer.dsPort,
                RenderingServer.rsHost, RenderingServer.rsPort,
                RenderingServer.rcPort))
        self.registerVtkWebProtocol(
            paraViewWebProtocols.ParaViewWebStartupPluginLoader(
                RenderingServer.plugins))
        self.registerVtkWebProtocol(
            paraViewWebProtocols.ParaViewWebProxyManager(
                allowedProxiesFile=RenderingServer.proxies,
                baseDir=RenderingServer.dataDirectoryPath,
                fileToLoad=RenderingServer.fileToLoad,
                allowUnconfiguredReaders=RenderingServer.allReaders))
        self.registerVtkWebProtocol(
            paraViewWebProtocols.ParaViewWebMouseHandler())
        self.registerVtkWebProtocol(
            paraViewWebProtocols.ParaViewWebViewPort(
                RenderingServer.viewportScale,
                RenderingServer.viewportMaxWidth,
                RenderingServer.viewportMaxHeight))
        self.registerVtkWebProtocol(
            paraViewWebProtocols.ParaViewWebPublishImageDelivery(decode=False))
        self.registerVtkWebProtocol(
            paraViewWebProtocols.ParaViewWebLocalRendering())
        self.registerVtkWebProtocol(
            paraViewWebProtocols.ParaViewWebTimeHandler())
        self.registerVtkWebProtocol(
            paraViewWebProtocols.ParaViewWebSelectionHandler())
        self.registerVtkWebProtocol(
            paraViewWebProtocols.ParaViewWebWidgetManager())
        self.registerVtkWebProtocol(
            paraViewWebProtocols.ParaViewWebKeyValuePairStore())
        # self.registerVtkWebProtocol(paraViewWebProtocols.ParaViewWebSaveData(baseSavePath=RenderingServer.saveDataDir)) # Disabled
        # self.registerVtkWebProtocol(paraViewWebProtocols.ParaViewWebProgressUpdate()) # Not fully working yet

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

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

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

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

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

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

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

        print('-------')
Exemple #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,
                showBuiltin=_VisualizerServer.showBuiltin))
        self.registerVtkWebProtocol(pv_protocols.ParaViewWebMouseHandler())
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebViewPort(
                _VisualizerServer.viewportScale,
                _VisualizerServer.viewportMaxWidth,
                _VisualizerServer.viewportMaxHeight))
        self.registerVtkWebProtocol(
            pv_protocols.ParaViewWebPublishImageDelivery(decode=False))
        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))
        # self.registerVtkWebProtocol(pv_protocols.ParaViewWebProgressUpdate()) # Not fully working yet

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

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

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

        # ProxyManager helper
        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 = _VisualizerServer.settingsLODThreshold