コード例 #1
0
ファイル: protocols.py プロジェクト: adammoon/ParaView
    def updateDisplayProperty(self, options):
        proxy = helper.idToProxy(options['proxy_id']);
        rep = simple.GetDisplayProperties(proxy)
        helper.updateProxyProperties(rep, options)

        # Try to bind the proper lookup table if need be
        if options.has_key('ColorArrayName') and len(options['ColorArrayName']) > 0:
            name = options['ColorArrayName']
            type = options['ColorAttributeType']
            nbComp = 1

            if type == 'POINT_DATA':
                data = rep.GetRepresentedDataInformation().GetPointDataInformation()
                for i in range(data.GetNumberOfArrays()):
                    array = data.GetArrayInformation(i)
                    if array.GetName() == name:
                        nbComp = array.GetNumberOfComponents()
            elif type == 'CELL_DATA':
                data = rep.GetRepresentedDataInformation().GetCellDataInformation()
                for i in range(data.GetNumberOfArrays()):
                    array = data.GetArrayInformation(i)
                    if array.GetName() == name:
                        nbComp = array.GetNumberOfComponents()
            lut = self.lutManager.getLookupTable(name, nbComp)
            rep.LookupTable = lut

        simple.Render()
コード例 #2
0
ファイル: protocols.py プロジェクト: worst-nick-ever/ParaView
    def updateDisplayProperty(self, options):
        proxy = helper.idToProxy(options['proxy_id'])
        rep = simple.GetDisplayProperties(proxy)
        helper.updateProxyProperties(rep, options)

        # Try to bind the proper lookup table if need be
        if options.has_key('ColorArrayName') and len(
                options['ColorArrayName']) > 0:
            name = options['ColorArrayName']
            type = options['ColorAttributeType']
            nbComp = 1

            if type == 'POINT_DATA':
                data = rep.GetRepresentedDataInformation(
                ).GetPointDataInformation()
                for i in range(data.GetNumberOfArrays()):
                    array = data.GetArrayInformation(i)
                    if array.GetName() == name:
                        nbComp = array.GetNumberOfComponents()
            elif type == 'CELL_DATA':
                data = rep.GetRepresentedDataInformation(
                ).GetCellDataInformation()
                for i in range(data.GetNumberOfArrays()):
                    array = data.GetArrayInformation(i)
                    if array.GetName() == name:
                        nbComp = array.GetNumberOfComponents()
            lut = self.lutManager.getLookupTable(name, nbComp)
            rep.LookupTable = lut

        simple.Render()
コード例 #3
0
ファイル: protocols.py プロジェクト: worst-nick-ever/ParaView
    def addSource(self, algo_name, parent):
        pid = str(parent)
        parentProxy = helper.idToProxy(parent)
        if parentProxy:
            simple.SetActiveSource(parentProxy)
        else:
            pid = '0'

        # Create new source/filter
        cmdLine = 'simple.' + algo_name + '()'
        newProxy = eval(cmdLine)

        # Create its representation and render
        simple.Show()
        simple.Render()
        simple.ResetCamera()

        # Add node to pipeline
        self.pipeline.addNode(pid, newProxy.GetGlobalIDAsString())

        # Handle domains
        helper.apply_domains(parentProxy, newProxy.GetGlobalIDAsString())

        # Create LUT if need be
        if pid == '0':
            self.lutManager.registerFieldData(
                newProxy.GetPointDataInformation())
            self.lutManager.registerFieldData(
                newProxy.GetCellDataInformation())

        # Return the newly created proxy pipeline node
        return helper.getProxyAsPipelineNode(newProxy.GetGlobalIDAsString(),
                                             self.lutManager)
コード例 #4
0
ファイル: protocols.py プロジェクト: adammoon/ParaView
    def addSource(self, algo_name, parent):
        pid = str(parent)
        parentProxy = helper.idToProxy(parent)
        if parentProxy:
            simple.SetActiveSource(parentProxy)
        else:
            pid = '0'

        # Create new source/filter
        cmdLine = 'simple.' + algo_name + '()'
        newProxy = eval(cmdLine)

        # Create its representation and render
        simple.Show()
        simple.Render()
        simple.ResetCamera()

        # Add node to pipeline
        self.pipeline.addNode(pid, newProxy.GetGlobalIDAsString())

        # Handle domains
        helper.apply_domains(parentProxy, newProxy.GetGlobalIDAsString())

        # Create LUT if need be
        if pid == '0':
            self.lutManager.registerFieldData(newProxy.GetPointDataInformation())
            self.lutManager.registerFieldData(newProxy.GetCellDataInformation())

        # Return the newly created proxy pipeline node
        return helper.getProxyAsPipelineNode(newProxy.GetGlobalIDAsString(), self.lutManager)
コード例 #5
0
ファイル: protocols.py プロジェクト: adammoon/ParaView
 def pushState(self, state):
     for proxy_id in state:
         if proxy_id == 'proxy':
             continue
         proxy = helper.idToProxy(proxy_id);
         helper.updateProxyProperties(proxy, state[proxy_id])
         simple.Render()
     return helper.getProxyAsPipelineNode(state['proxy'], self.lutManager)
コード例 #6
0
 def pushState(self, state):
     for proxy_id in state:
         if proxy_id == 'proxy':
             continue
         proxy = helper.idToProxy(proxy_id);
         helper.updateProxyProperties(proxy, state[proxy_id])
         simple.Render()
     return helper.getProxyAsPipelineNode(state['proxy'], self.lutManager)
コード例 #7
0
ファイル: protocols.py プロジェクト: worst-nick-ever/ParaView
    def reloadPipeline(self):
        self.pipeline.clear()
        pxm = simple.servermanager.ProxyManager()

        # Fill tree structure (order-less)
        for proxyInfo in pxm.GetProxiesInGroup("sources"):
            id = str(proxyInfo[1])
            proxy = helper.idToProxy(id)
            parentId = helper.getParentProxyId(proxy)
            self.pipeline.addNode(parentId, id)

        return self.pipeline.getRootNode(self.lutManager)
コード例 #8
0
ファイル: protocols.py プロジェクト: adammoon/ParaView
    def reloadPipeline(self):
        self.pipeline.clear()
        pxm = simple.servermanager.ProxyManager()

        # Fill tree structure (order-less)
        for proxyInfo in pxm.GetProxiesInGroup("sources"):
            id = str(proxyInfo[1])
            proxy = helper.idToProxy(id)
            parentId = helper.getParentProxyId(proxy)
            self.pipeline.addNode(parentId, id)

        return self.pipeline.getRootNode(self.lutManager)
コード例 #9
0
ファイル: protocols.py プロジェクト: mathstuf/ParaView
    def pushState(self, state):
        proxy_type = None
        for proxy_id in state:
            if proxy_id in ['proxy', 'widget_source']:
                proxy_type = proxy_id
                continue
            proxy = helper.idToProxy(proxy_id);
            helper.updateProxyProperties(proxy, state[proxy_id])
            simple.Render()

        if proxy_type == 'proxy':
            return helper.getProxyAsPipelineNode(state['proxy'], self.lutManager)
        elif proxy_type == 'widget_source':
            proxy.UpdateWidget(proxy.Observed)
コード例 #10
0
ファイル: protocols.py プロジェクト: worst-nick-ever/ParaView
    def pushState(self, state):
        proxy_type = None
        for proxy_id in state:
            if proxy_id in ['proxy', 'widget_source']:
                proxy_type = proxy_id
                continue
            proxy = helper.idToProxy(proxy_id)
            helper.updateProxyProperties(proxy, state[proxy_id])
            simple.Render()

        if proxy_type == 'proxy':
            return helper.getProxyAsPipelineNode(state['proxy'],
                                                 self.lutManager)
        elif proxy_type == 'widget_source':
            proxy.UpdateWidget(proxy.Observed)
コード例 #11
0
ファイル: protocols.py プロジェクト: worst-nick-ever/ParaView
 def deleteSource(self, proxy_id):
     self.pipeline.removeNode(proxy_id)
     proxy = helper.idToProxy(proxy_id)
     simple.Delete(proxy)
     simple.Render()
コード例 #12
0
ファイル: protocols.py プロジェクト: adammoon/ParaView
 def deleteSource(self, proxy_id):
     self.pipeline.removeNode(proxy_id)
     proxy = helper.idToProxy(proxy_id)
     simple.Delete(proxy)
     simple.Render()