Example #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)
Example #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)
Example #3
0
File: vis.py Project: 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)
Example #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)
Example #5
0
File: vis.py Project: 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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
 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
Example #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)
Example #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
Example #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
Example #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
Example #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
Example #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
Example #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)
Example #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)
Example #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
    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)
Example #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
Example #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)
Example #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
Example #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)
Example #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
Example #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
 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)
Example #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)
Example #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)
Example #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)
 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)
Example #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)
Example #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)
Example #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)
    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)
Example #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)