当前位置: 首页>>代码示例>>Python>>正文


Python QCellWidget.updateContents方法代码示例

本文整理汇总了Python中packages.spreadsheet.spreadsheet_cell.QCellWidget.updateContents方法的典型用法代码示例。如果您正苦于以下问题:Python QCellWidget.updateContents方法的具体用法?Python QCellWidget.updateContents怎么用?Python QCellWidget.updateContents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在packages.spreadsheet.spreadsheet_cell.QCellWidget的用法示例。


在下文中一共展示了QCellWidget.updateContents方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: updateContents

# 需要导入模块: from packages.spreadsheet.spreadsheet_cell import QCellWidget [as 别名]
# 或者: from packages.spreadsheet.spreadsheet_cell.QCellWidget import updateContents [as 别名]
    def updateContents(self, inputPorts):
        """ updateContents(inputPorts: tuple)
        Updates the cell contents with new vtkRenderer
        
        """
        (renderView, ) = inputPorts
        renWin = renderView.vtkInstance.GetRenderWindow()
        renWin.DoubleBufferOn()
        self.SetRenderWindow(renWin)
        renderView.vtkInstance.ResetCamera()
        self.addObserversToInteractorStyle()
        
#        renWin = self.GetRenderWindow()
#        renderers = [renderView.vtkInstance.GetRenderer()]
#        iren = renWin.GetInteractor()
        # Update interactor style
#         self.removeObserversFromInteractorStyle()
#         if renderView==None:
#             if iStyle==None:
#                 iStyleInstance = vtk.vtkInteractorStyleTrackballCamera()
#             else:
#                 iStyleInstance = iStyle.vtkInstance
#             iren.SetInteractorStyle(iStyleInstance)
#         self.addObserversToInteractorStyle()
        # Capture window into history for playback
        # Call this at the end to capture the image after rendering
        QCellWidget.updateContents(self, inputPorts)
开发者ID:CMUSV-VisTrails,项目名称:WorkflowRecommendation,代码行数:29,代码来源:vtkviewcell.py

示例2: updateContents

# 需要导入模块: from packages.spreadsheet.spreadsheet_cell import QCellWidget [as 别名]
# 或者: from packages.spreadsheet.spreadsheet_cell.QCellWidget import updateContents [as 别名]
    def updateContents(self, inputPorts):
        if self.view==None:
            self.view = pvsp.CreateRenderView()
            renWin = self.view.GetRenderWindow()
            self.SetRenderWindow(renWin)
            iren = renWin.GetInteractor()
            iren.SetNonInteractiveRenderDelay(0)
            iren.SetInteractorStyle(vtk.vtkInteractorStyleTrackballCamera())

        del self.view.Representations[:]

        # Fetch variables from the input port
        (location, representations) = inputPorts
        
        for rep in representations:
            rep.set_view(self.view)
            rep.execute()

        # Set view specific properties
        self.view.CenterAxesVisibility = 0
        self.view.Background = [0.5, 0.5, 0.5]

        self.view.ResetCamera()
        self.view.StillRender()

        QCellWidget.updateContents(self, inputPorts)
开发者ID:imclab,项目名称:vistrails,代码行数:28,代码来源:pvgenericcell.py

示例3: updateContents

# 需要导入模块: from packages.spreadsheet.spreadsheet_cell import QCellWidget [as 别名]
# 或者: from packages.spreadsheet.spreadsheet_cell.QCellWidget import updateContents [as 别名]
    def updateContents(self, inputPorts):
        """ updateContents(inputPorts: tuple)
        Updates the cell contents with new vtkRenderer
        
        """
        renWin = self.GetRenderWindow()
        for iHandler in self.iHandlers:
            if iHandler.observer:
                iHandler.observer.vtkInstance.SetInteractor(None)
            iHandler.clear()

        # Remove old renderers first
        oldRenderers = self.getRendererList()
        for renderer in oldRenderers:
            renWin.RemoveRenderer(renderer)
            renderer.SetRenderWindow(None)
        del oldRenderers

        (renderers, renderView, self.iHandlers, iStyle, picker) = inputPorts
        if renderView:
            renderView.vtkInstance.SetupRenderWindow(renWin)
            renderers = [renderView.vtkInstance.GetRenderer()]
        self.renderer_maps = {}
        for renderer in renderers:
            if renderView == None:
                vtkInstance = renderer.vtkInstance
                renWin.AddRenderer(vtkInstance)
                self.renderer_maps[vtkInstance] = renderer.moduleInfo["moduleId"]
            else:
                vtkInstance = renderer
            if hasattr(vtkInstance, "IsActiveCameraCreated"):
                if not vtkInstance.IsActiveCameraCreated():
                    vtkInstance.ResetCamera()
                else:
                    vtkInstance.ResetCameraClippingRange()

        iren = renWin.GetInteractor()
        if picker:
            iren.SetPicker(picker.vtkInstance)

        # Update interactor style
        self.removeObserversFromInteractorStyle()
        if renderView == None:
            if iStyle == None:
                iStyleInstance = vtk.vtkInteractorStyleTrackballCamera()
            else:
                iStyleInstance = iStyle.vtkInstance
            iren.SetInteractorStyle(iStyleInstance)
        self.addObserversToInteractorStyle()

        for iHandler in self.iHandlers:
            if iHandler.observer:
                iHandler.observer.vtkInstance.SetInteractor(iren)
        renWin.Render()

        # Capture window into history for playback
        # Call this at the end to capture the image after rendering
        QCellWidget.updateContents(self, inputPorts)
开发者ID:VisTrails,项目名称:vistrails-contrib-legacy,代码行数:60,代码来源:vtkcell.py

示例4: updateContents

# 需要导入模块: from packages.spreadsheet.spreadsheet_cell import QCellWidget [as 别名]
# 或者: from packages.spreadsheet.spreadsheet_cell.QCellWidget import updateContents [as 别名]
 def updateContents(self, inputPorts):
     (self.coord, matrix) = inputPorts 
     if self.coord is not None: self.coord.register(self)
 
     self.createTable(matrix)
     self.widget.Initialize()
     
     # Capture window into history for playback
     # Call this at the end to capture the image after rendering
     QCellWidget.updateContents(self, inputPorts)
开发者ID:imclab,项目名称:vistrails,代码行数:12,代码来源:plots.py

示例5: updateContents

# 需要导入模块: from packages.spreadsheet.spreadsheet_cell import QCellWidget [as 别名]
# 或者: from packages.spreadsheet.spreadsheet_cell.QCellWidget import updateContents [as 别名]
    def updateContents(self, inputPorts):
        """ updateContents(inputPorts: tuple) -> None
        Update the widget contents based on the input data
        
        """
        (fileValue, ) = inputPorts
        if fileValue:
            img = QtGui.QImage()
            if img.load(fileValue.name):
                self.originalPix = QtGui.QPixmap.fromImage(img)
                self.label.setPixmap(self.originalPix.scaled(self.label.size(),
                                                         QtCore.Qt.KeepAspectRatio,
                                                         QtCore.Qt.SmoothTransformation))
            else:
                self.label.setText("Invalid image file!")

        QCellWidget.updateContents(self, inputPorts)
开发者ID:CMUSV-VisTrails,项目名称:WorkflowRecommendation,代码行数:19,代码来源:imageviewer.py

示例6: updateContents

# 需要导入模块: from packages.spreadsheet.spreadsheet_cell import QCellWidget [as 别名]
# 或者: from packages.spreadsheet.spreadsheet_cell.QCellWidget import updateContents [as 别名]
    def updateContents(self, inputPorts):
        if self.view == None:
            self.view = pvsp.CreateRenderView()
            renWin = self.view.GetRenderWindow()
            self.SetRenderWindow(renWin)
            iren = renWin.GetInteractor()
            iren.SetNonInteractiveRenderDelay(0)
            iren.SetInteractorStyle(vtk.vtkInteractorStyleTrackballCamera())

            # Load the uvcdat logo and use it for overlay
            logoPath = system.vistrails_root_directory() + "/gui/uvcdat/resources/images/uvcdat_logo_transparent.png"
            reader = vtk.vtkPNGReader()
            reader.SetFileName(logoPath)
            reader.Update()

            imageActor = vtk.vtkImageActor()
            imageActor.SetInput(reader.GetOutput())

            self.overlayRenderer = vtk.vtkRenderer()
            self.overlayRenderer.AddActor(imageActor)

            renWin.SetNumberOfLayers(renWin.GetNumberOfLayers() + 1)
            self.overlayRenderer.SetLayer(renWin.GetNumberOfLayers() - 1)
            renWin.AddRenderer(self.overlayRenderer)

            self.overlayRenderer.SetViewport(0.7, 0, 1.0, 0.3)

        del self.view.Representations[:]

        # Fetch variables from the input port
        (location, representations) = inputPorts

        for rep in representations:
            rep.set_view(self.view)
            rep.execute()

        # Set view specific properties
        self.view.CenterAxesVisibility = 0
        self.view.Background = [0.6, 0.6, 0.6]

        self.view.ResetCamera()
        self.view.StillRender()

        QCellWidget.updateContents(self, inputPorts)
开发者ID:painter1,项目名称:vistrails,代码行数:46,代码来源:pvgenericcell.py

示例7: updateVisIt

# 需要导入模块: from packages.spreadsheet.spreadsheet_cell import QCellWidget [as 别名]
# 或者: from packages.spreadsheet.spreadsheet_cell.QCellWidget import updateContents [as 别名]
    def updateVisIt(self, inputPorts):
        global viswin
        global viswinmapper
        global availWindows
        global VisItLaunched

        if VisItLaunched == False:
            LaunchVisIt()
            VisItLaunched = True

        (self.cdms_var,self.location,self.params) = inputPorts

        windowkey = self.getKey()
        windowid  = 0

        if self.view is None:
            a = set(viswin.GetRenderWindowIDs())
            if len(availWindows) > 0:
                (self.view,windowid) = availWindows[0]
                availWindows = availWindows[1:]
            else:
                a = set(viswin.GetRenderWindowIDs())
                visit.AddWindow()
                b = set(viswin.GetRenderWindowIDs())
                res = tuple(b - a)
                windowid = res[0]
                self.view = viswin.GetRenderWindow(windowid)  

            self.layout.addWidget(self.view)
            self.view.show()
            viswinmapper[windowkey] = windowid

        if "Pseudocolor" in self.params.renderType :
            self.LoadPseudocolorPlot()

        if "Contour" in self.params.renderType :
            self.LoadContourPlot()

        if "Extreme Value Analysis" in self.params.renderType :
            self.LoadExtremeValueAnalysisPlot()

        QCellWidget.updateContents(self, inputPorts)
开发者ID:imclab,项目名称:vistrails,代码行数:44,代码来源:visitcell.py

示例8: updateContents

# 需要导入模块: from packages.spreadsheet.spreadsheet_cell import QCellWidget [as 别名]
# 或者: from packages.spreadsheet.spreadsheet_cell.QCellWidget import updateContents [as 别名]
    def updateContents(self, inputPorts):

        if self.view==None:
            self.view = pvsp.CreateRenderView()
            renWin = self.view.GetRenderWindow()
            self.SetRenderWindow(renWin)
            iren = renWin.GetInteractor()
            print type(iren)
            iren.SetNonInteractiveRenderDelay(0)
            iren.SetInteractorStyle(vtk.vtkInteractorStyleTrackballCamera())

        (representations, ) = inputPorts
        self.view.Representations = []
        for r in representations:
            self.view.Representations.append(r.pvInstance)

        self.view.ResetCamera()
        self.view.StillRender()

        QCellWidget.updateContents(self, inputPorts)
开发者ID:cjh1,项目名称:VisTrails,代码行数:22,代码来源:pvcell.py


注:本文中的packages.spreadsheet.spreadsheet_cell.QCellWidget.updateContents方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。