本文整理汇总了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)
示例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)
示例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)
示例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)