Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
    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)
Ejemplo n.º 3
0
Archivo: vis.py Proyecto: Nikea/VTTools
 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)
Ejemplo n.º 4
0
    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)
Ejemplo n.º 5
0
Archivo: vis.py Proyecto: Nikea/VTTools
 def updateContents(self, input_ports):
     dict_list, = input_ports
     layout = QtGui.QHBoxLayout()
     widg = displaydict.DisplayDict()
     widg.set_tree(dict_list)
     layout.addWidget(widg)
     self.setLayout(layout)
     QCellWidget.updateContents(self, input_ports)
Ejemplo n.º 6
0
 def updateContents(self, input_ports):
     dict_list, = input_ports
     layout = QtGui.QHBoxLayout()
     widg = displaydict.DisplayDict()
     widg.set_tree(dict_list)
     layout.addWidget(widg)
     self.setLayout(layout)
     QCellWidget.updateContents(self, input_ports)
Ejemplo n.º 7
0
 def __init__(self, parent=None):
     """ QGISCellWidget(parent: QWidget) -> QGISCellWidget
     Initialize the widget with its central layout
     
     """
     QCellWidget.__init__(self, parent)
     centralLayout = QtGui.QVBoxLayout()
     self.setLayout(centralLayout)
     centralLayout.setMargin(0)
     centralLayout.setSpacing(0)
Ejemplo n.º 8
0
    def deleteLater(self):
        """ deleteLater() -> None        
        Overriding PyQt deleteLater to free up resources
        
        """
        # Destroy the old one if possible
        if self.figure is not None:
            pylab.close(self.figure)

        QCellWidget.deleteLater(self)
Ejemplo n.º 9
0
 def __init__(self, parent=None):
     """ QGISCellWidget(parent: QWidget) -> QGISCellWidget
     Initialize the widget with its central layout
     
     """
     QCellWidget.__init__(self, parent)
     centralLayout = QtGui.QVBoxLayout()
     self.setLayout(centralLayout)
     centralLayout.setMargin(0)
     centralLayout.setSpacing(0)
Ejemplo n.º 10
0
    def deleteLater(self):
        """ deleteLater() -> None        
        Overriding PyQt deleteLater to free up resources
        
        """
        # Destroy the old one if possible
        if self.figure is not None:
            pylab.close(self.figure)

        QCellWidget.deleteLater(self)
Ejemplo n.º 11
0
 def __init__(self, parent=None):
     """ TextCellWidget(parent: QWidget) -> TextCellWidget
     Create a text cell without a toolbar and without editing capabilities
     
     """
     QCellWidget.__init__(self, parent)
     self.setLayout(QtGui.QVBoxLayout(self))
     self.browser = QtGui.QTextEdit()
     self.layout().addWidget(self.browser)
     self.browser.setReadOnly(True)
Ejemplo n.º 12
0
 def __init__(self, parent=None):
     """ WebViewCellWidget(parent: QWidget) -> WebViewCellWidget
     Create a rich text cell without a toolbar
     
     """
     QCellWidget.__init__(self, parent)
     self.setLayout(QtGui.QVBoxLayout(self))
     self.browser = QtWebKit.QWebView()
     self.layout().addWidget(self.browser)
     self.browser.setMouseTracking(True)
     self.urlSrc = None
Ejemplo n.º 13
0
 def dumpToFile(self, filename):
     """ dumpToFile(filename) -> None
     It will generate a screenshot of the cell contents and dump to filename.
     It will also create a copy of the original text file used with
     filename's basename and the original extension.
     """
     if self.html is not None:
         basename, ext = os.path.splitext(filename)
         with open(basename + '.html', 'wb') as fp:
             fp.write(self.html.encode('utf-8'))
     QCellWidget.dumpToFile(self,filename)
Ejemplo n.º 14
0
    def __init__(self, parent=None):
        """ SVGCellWidget(parent: QWidget) -> SVGCellWidget
        Create a SVGCellWidget without any toolbar
        """
        QCellWidget.__init__(self, parent)        
        self.setLayout(QtGui.QVBoxLayout(self))

        self.svgWidget = QtSvg.QSvgWidget()
        self.layout().addWidget(self.svgWidget)
        
        self.controlBarType = None
        self.fileSrc = None
Ejemplo n.º 15
0
    def __init__(self, parent=None):
        """ SVGCellWidget(parent: QWidget) -> SVGCellWidget
        Create a SVGCellWidget without any toolbar
        """
        QCellWidget.__init__(self, parent)
        self.setLayout(QtGui.QVBoxLayout(self))

        self.svgWidget = QtSvg.QSvgWidget()
        self.layout().addWidget(self.svgWidget)

        self.controlBarType = None
        self.fileSrc = None
Ejemplo n.º 16
0
    def __init__(self, parent=None):
        """ RichTextCellWidget(parent: QWidget) -> RichTextCellWidget
        Create a rich text cell without a toolbar

        """
        QCellWidget.__init__(self, parent)
        self.setLayout(QtGui.QVBoxLayout(self))
        self.browser = QtGui.QTextBrowser()
        self.layout().addWidget(self.browser)
        self.browser.setMouseTracking(True)
        self.browser.controlBarType = None
        self.html = None
Ejemplo n.º 17
0
    def __init__(self, parent=None):
        """ RichTextCellWidget(parent: QWidget) -> RichTextCellWidget
        Create a rich text cell without a toolbar

        """
        QCellWidget.__init__(self, parent)
        self.setLayout(QtGui.QVBoxLayout(self))
        self.browser = QtGui.QTextBrowser()
        self.layout().addWidget(self.browser)
        self.browser.setMouseTracking(True)
        self.browser.controlBarType = None
        self.html = None
Ejemplo n.º 18
0
 def __init__(self, parent=None):
     """ WebViewCellWidget(parent: QWidget) -> WebViewCellWidget
     Create a rich text cell without a toolbar
     
     """
     QCellWidget.__init__(self, parent)
     self.setLayout(QtGui.QVBoxLayout(self))
     QtWebKit.QWebSettings.globalSettings().setAttribute(
         QtWebKit.QWebSettings.DeveloperExtrasEnabled, True)
     self.browser = QtWebKit.QWebView()
     self.layout().addWidget(self.browser)
     self.browser.setMouseTracking(True)
     self.urlSrc = None
Ejemplo n.º 19
0
 def deleteLater(self):
     """ deleteLater() -> None        
     Make sure to free render window resource when
     deallocating. Overriding PyQt deleteLater to free up
     resources
     
     """
     self.renderer_maps = {}
     for ren in self.getRendererList():
         self.mRenWin.RemoveRenderer(ren)
     self.removeObserversFromInteractorStyle()
     self.SetRenderWindow(None)
     QCellWidget.deleteLater(self)
Ejemplo n.º 20
0
 def deleteLater(self):
     """ deleteLater() -> None        
     Make sure to free render window resource when
     deallocating. Overriding PyQt deleteLater to free up
     resources
     
     """
     self.renderer_maps = {}
     for ren in self.getRendererList():
         self.mRenWin.RemoveRenderer(ren)
     self.removeObserversFromInteractorStyle()
     self.SetRenderWindow(None)
     QCellWidget.deleteLater(self)
Ejemplo n.º 21
0
 def __init__(self, parent=None):
     """ WebViewCellWidget(parent: QWidget) -> WebViewCellWidget
     Create a rich text cell without a toolbar
     
     """
     QCellWidget.__init__(self, parent)
     self.setLayout(QtGui.QVBoxLayout(self))
     QtWebKit.QWebSettings.globalSettings().setAttribute(
         QtWebKit.QWebSettings.DeveloperExtrasEnabled, True)
     self.browser = QtWebKit.QWebView()
     self.layout().addWidget(self.browser)
     self.browser.setMouseTracking(True)
     self.urlSrc = None
Ejemplo n.º 22
0
    def __init__(self, parent=None):
        QCellWidget.__init__(self, parent)

        layout = QtGui.QVBoxLayout()

        self.table = QtGui.QTableWidget()

        scrollarea = QtGui.QScrollArea(self)
        scrollarea.setWidgetResizable(True)
        scrollarea.setWidget(self.table)
        layout.addWidget(scrollarea)

        self.setLayout(layout)
Ejemplo n.º 23
0
 def __init__(self, parent=None):
     """ IECellWidget(parent: QWidget) -> IECellWidget
     Create a ActiveX Container pointing to the IE Cell
     
     """
     QCellWidget.__init__(self, parent)
     vbox = QtGui.QVBoxLayout(self)
     vbox.setMargin(0)
     self.setLayout(vbox)
     self.browser = QAxContainer.QAxWidget(self)
     self.browser.setFocusPolicy(QtCore.Qt.StrongFocus)
     self.browser.setControl("{8856F961-340A-11D0-A96B-00C04FD705A2}")
     vbox.addWidget(self.browser)
     self.urlSrc = None
Ejemplo n.º 24
0
    def __init__(self, parent=None):
        QCellWidget.__init__(self, parent)

        layout = QtGui.QVBoxLayout()
        layout.setContentsMargins(0, 0, 0, 0)

        self.table = QtGui.QTableWidget()

        scrollarea = QtGui.QScrollArea(self)
        scrollarea.setWidgetResizable(True)
        scrollarea.setWidget(self.table)
        layout.addWidget(scrollarea)

        self.setLayout(layout)
Ejemplo n.º 25
0
 def __init__(self, parent=None):
     """ IECellWidget(parent: QWidget) -> IECellWidget
     Create a ActiveX Container pointing to the IE Cell
     
     """
     QCellWidget.__init__(self, parent)
     vbox = QtGui.QVBoxLayout(self)
     vbox.setMargin(0)
     self.setLayout(vbox)
     self.browser = QAxContainer.QAxWidget(self)
     self.browser.setFocusPolicy(QtCore.Qt.StrongFocus)
     self.browser.setControl("{8856F961-340A-11D0-A96B-00C04FD705A2}")
     vbox.addWidget(self.browser)
     self.urlSrc = None
Ejemplo n.º 26
0
    def __init__(self, parent=None):
        QCellWidget.__init__(self, parent)

        self.sync_changes = "all"

        centralLayout = QtGui.QVBoxLayout()
        self.setLayout(centralLayout)
        centralLayout.setMargin(0)
        centralLayout.setSpacing(0)

        self.Frame = QtGui.QFrame()
        self.ui = Ui_Frame()
        self.ui.setupUi(self.Frame)

        self.gs_crv_graph = QtGui.QGraphicsScene()
        self.ui.gv_crv.setScene(self.gs_crv_graph)
        QtCore.QObject.connect(self.ui.crv_combobox, QtCore.SIGNAL("currentIndexChanged(QString)"), self.changeResponseCurve)
        self.gs_crv_graph.wheelEvent = self.wheel_event_crv

        self.gs_auc_graph = QtGui.QGraphicsScene()
        self.ui.gv_auc.setScene(self.gs_auc_graph)
        self.gs_auc_graph.wheelEvent = self.wheel_event_auc

        self.gs_calibration_graph = QtGui.QGraphicsScene()
        self.ui.gv_calibration.setScene(self.gs_calibration_graph)
        self.gs_calibration_graph.wheelEvent = self.wheel_event_calibration

        self.gs_confusion_graph = QtGui.QGraphicsScene()
        self.ui.gv_confusion.setScene(self.gs_confusion_graph)
        self.gs_confusion_graph.wheelEvent = self.wheel_event_confusion

        self.gs_residuals_graph = QtGui.QGraphicsScene()
        self.ui.gv_residuals.setScene(self.gs_residuals_graph)
        self.gs_residuals_graph.wheelEvent = self.wheel_event_residuals

        self.gs_variable_graph = QtGui.QGraphicsScene()
        self.ui.gv_variable.setScene(self.gs_variable_graph)
        self.gs_variable_graph.wheelEvent = self.wheel_event_variable

        self.text_browser = QtWebKit.QWebView()
        self.text_browser.setMouseTracking(True)
        self.ui.text_output_layout.addWidget(self.text_browser)

        self.text_urlSrc = None


        self.connect(self.ui.tabWidget, QtCore.SIGNAL('currentChanged(int)'), self.tabChanged)

        self.layout().addWidget(self.Frame)
Ejemplo n.º 27
0
 def __init__(self, parent=None):
     """ MplFigureCellWidget(parent: QWidget) -> MplFigureCellWidget
     Initialize the widget with its central layout
     
     """
     QCellWidget.__init__(self, parent)
     self.setFocusPolicy(QtCore.Qt.StrongFocus)
     centralLayout = QtGui.QVBoxLayout()
     self.setLayout(centralLayout)
     centralLayout.setMargin(0)
     centralLayout.setSpacing(0)
     self.canvas = None
     self.figure = None
     self.figManager = None
     self.toolBarType = MplFigureCellToolBar
     self.mplToolbar = None
Ejemplo n.º 28
0
 def __init__(self, parent=None):
     """ MplFigureCellWidget(parent: QWidget) -> MplFigureCellWidget
     Initialize the widget with its central layout
     
     """
     QCellWidget.__init__(self, parent)
     self.setFocusPolicy(QtCore.Qt.StrongFocus)
     centralLayout = QtGui.QVBoxLayout()
     self.setLayout(centralLayout)
     centralLayout.setMargin(0)
     centralLayout.setSpacing(0)
     self.canvas = None
     self.figure = None
     self.figManager = None
     self.toolBarType = MplFigureCellToolBar
     self.mplToolbar = None
Ejemplo n.º 29
0
 def dumpToFile(self, filename):
     """ dumpToFile(filename) -> None
     It will generate a screenshot of the cell contents and dump to filename.
     It will also create a copy of the original text file used with
     filename's basename and the original extension.
     """
     if self.html is not None:
         basename, ext = os.path.splitext(filename)
         with open(basename + '.html', 'wb') as fp:
             if isinstance(self.html, bytes):
                 fp.write(self.html)
             else:
                 codec = QtCore.QTextCodec.codecForHtml(
                         self.html.encode('utf-8'),
                         QtCore.QTextCodec.codecForName('UTF-8'))
                 fp.write(codec.fromUnicode(self.html))
     QCellWidget.dumpToFile(self,filename)
Ejemplo n.º 30
0
    def __init__(self, parent=None, f=QtCore.Qt.WindowFlags()):
        """ QVTKViewWidget(parent: QWidget, f: WindowFlags) -> QVTKViewWidget
        Initialize QVTKViewWidget with a toolbar with its own device
        context
        
        """
        QCellWidget.__init__(self, parent, f | QtCore.Qt.MSWindowsOwnDC)

        self.interacting = None
        self.mRenWin = None
        self.setAttribute(QtCore.Qt.WA_OpaquePaintEvent)
        self.setAttribute(QtCore.Qt.WA_PaintOnScreen)
        self.setMouseTracking(True)
        self.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.setSizePolicy(QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding))
        self.toolBarType = QVTKViewWidgetToolBar
        self.setAnimationEnabled(True)
Ejemplo n.º 31
0
    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)
Ejemplo n.º 32
0
    def __init__(self, parent=None, f=QtCore.Qt.WindowFlags()):
        """ QVTKViewWidget(parent: QWidget, f: WindowFlags) -> QVTKViewWidget
        Initialize QVTKViewWidget with a toolbar with its own device
        context
        
        """
        QCellWidget.__init__(self, parent, f | QtCore.Qt.MSWindowsOwnDC)

        self.interacting = None
        self.mRenWin = None
        self.setAttribute(QtCore.Qt.WA_OpaquePaintEvent)
        self.setAttribute(QtCore.Qt.WA_PaintOnScreen)
        self.setMouseTracking(True)
        self.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.setSizePolicy(QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                             QtGui.QSizePolicy.Expanding))
        self.toolBarType = QVTKViewWidgetToolBar
        self.setAnimationEnabled(True)
Ejemplo n.º 33
0
 def paintEngine(self):
     """ paintEngine() -> QPaintEngine
     On Windows, this has to return None to fully disable
     double-buffer (we let vtkRenderWindow handle this instead).
     
     """
     if system.systemType in ['Windows', 'Microsoft']:
         return None
     else:
         return QCellWidget.paintEngine(self)
Ejemplo n.º 34
0
 def paintEngine(self):
     """ paintEngine() -> QPaintEngine
     On Windows, this has to return None to fully disable
     double-buffer (we let vtkRenderWindow handle this instead).
     
     """
     if system.systemType in ['Windows', 'Microsoft']:
         return None
     else:
         return QCellWidget.paintEngine(self)
Ejemplo n.º 35
0
 def __init__(self, parent=None):
     """ ImageViewerCellWidget(parent: QWidget) -> ImageViewerCellWidget
     Initialize the widget with its toolbar type and aligment
     
     """
     QCellWidget.__init__(self, parent)
     self.setLayout(QtGui.QVBoxLayout(self))
     self.setAnimationEnabled(True)
     
     self.label = QtGui.QLabel()
     self.layout().addWidget(self.label)
     
     self.label.setAutoFillBackground(True)
     self.label.palette().setColor(QtGui.QPalette.Window, QtCore.Qt.white)
     self.label.setMouseTracking(False)
     self.label.setAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter)
     self.label.setScaledContents(False)
     self.toolBarType = ImageViewerToolBar
     self.originalPix = None
     self.setMinimumSize(1, 1)
Ejemplo n.º 36
0
 def deleteLater(self):
     """ deleteLater() -> None        
     Overriding PyQt deleteLater to free up resources
     
     """
     # Destroy the old one if possible
     if self.figure is not None:
         # self.getFigManager().window.deleteLater()
         print "pylab:", pylab
         print "self.figure:", self.figure
         pylab.close(self.figure)
         
     # if self.figManager:
         
     #     try:                    
     #         pylab.close(self.figManager.canvas.figure)
     #     # There is a bug in Matplotlib backend_qt4. It is a
     #     # wrong command for Qt4. Just ignore it and continue
     #     # to destroy the widget
     #     except:
     #         pass
         
     #     self.figManager.window.deleteLater()
     QCellWidget.deleteLater(self)
Ejemplo n.º 37
0
    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)
Ejemplo n.º 38
0
    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.SetRenderWindow(renWin)
            renderView.vtkInstance.ResetCamera()
            self.addObserversToInteractorStyle()
            renderers = [renderView.vtkInstance.GetRenderer()]
        self.renderer_maps = {}
        self.usecameras = False
        if cameralist is not None and len(cameralist) == len(renderers):
            self.usecameras = True
        j = 0
        for renderer in renderers:
            if renderView == None:
                vtkInstance = renderer
                # Check deprecated vtkInstance
                if hasattr(renderer, 'vtkInstance'):
                    vtkInstance = renderer.vtkInstance
                    # Old scripts may call this without setting module_id
                    if hasattr(renderer, 'module_id'):
                        self.renderer_maps[id(
                            vtkInstance)] = renderer.module_id
                renWin.AddRenderer(vtkInstance)
            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:
            if hasattr(picker, 'vtkInstance'):
                picker = picker.vtkInstance
            iren.SetPicker(picker)

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

        for i in xrange(len(self.iHandlers)):
            iHandler = self.iHandlers[i]
            if hasattr(iHandler, 'vtkInstance'):
                iHandler = iHandler.vtkInstance
                self.iHandler[i] = iHandler
            if iHandler.observer:
                observer = iHandler.observer
                if hasattr(observer, 'vtkInstance'):
                    observer = observer.vtkInstance
                observer.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)