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


Python QCellWidget.updateContents方法代码示例

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


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

示例1: updateContents

# 需要导入模块: from vistrails.packages.spreadsheet.spreadsheet_cell import QCellWidget [as 别名]
# 或者: from vistrails.packages.spreadsheet.spreadsheet_cell.QCellWidget import updateContents [as 别名]
 def updateContents(self, input_ports):
     (data,keys) = input_ports
     layout = QtGui.QHBoxLayout()
     widg = Stack1DMainWindow(data_list=data, key_list=keys)
     layout.addWidget(widg)
     self.setLayout(layout)
     QCellWidget.updateContents(self, input_ports)
开发者ID:Nikea,项目名称:VTTools,代码行数:9,代码来源:vis.py

示例2: updateContents

# 需要导入模块: from vistrails.packages.spreadsheet.spreadsheet_cell import QCellWidget [as 别名]
# 或者: from vistrails.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:pombredanne,项目名称:VisTrails,代码行数:29,代码来源:vtkviewcell.py

示例3: updateContents

# 需要导入模块: from vistrails.packages.spreadsheet.spreadsheet_cell import QCellWidget [as 别名]
# 或者: from vistrails.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:AnyarInc,项目名称:VisTrails,代码行数:19,代码来源:imageviewer.py

示例4: updateContents

# 需要导入模块: from vistrails.packages.spreadsheet.spreadsheet_cell import QCellWidget [as 别名]
# 或者: from vistrails.packages.spreadsheet.spreadsheet_cell.QCellWidget import updateContents [as 别名]
    def updateContents(self, inputPorts, cameralist = None):
        """ 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 = {}
        self.usecameras = False
        if cameralist != None and len(cameralist) == len(renderers):
            self.usecameras = True
        j = 0
        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 self.usecameras:
                    vtkInstance.SetActiveCamera(cameralist[j])
                    j = j + 1
                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:lumig242,项目名称:VisTrailsRecommendation,代码行数:67,代码来源:vtkcell.py


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