def SetRenderWindow(self,w):
        """ SetRenderWindow(w: vtkRenderWindow)        
        Set a new render window to QVTKViewWidget and initialize the
        interactor as well
        
        """
        if w == self.mRenWin:
            return
        
        if self.mRenWin:
            if self.mRenWin.GetMapped():
                self.mRenWin.Finalize()
                
        self.mRenWin = w
        
        if self.mRenWin:
            self.mRenWin.Register(None)
            if system.systemType=='Linux':
                try:
                    vp = '_%s_void_p' % (hex(int(QtGui.QX11Info.display()))[2:])
                except __HOLE__:
                    #This was change for PyQt4.2
                    if isinstance(QtGui.QX11Info.display(),QtGui.Display):
                        display = sip.unwrapinstance(QtGui.QX11Info.display())
                        vp = '_%s_void_p' % (hex(display)[2:])
                self.mRenWin.SetDisplayId(vp)
                if not self.mRenWin.GetMapped():
                    self.mRenWin.GetInteractor().Initialize()
                    system.XDestroyWindow(self.mRenWin.GetGenericDisplayId(),
                                          self.mRenWin.GetGenericWindowId())
                    self.mRenWin.Finalize()
                self.mRenWin.SetWindowInfo(str(int(self.winId())))
            else:
                self.mRenWin.SetWindowInfo(str(int(self.winId())))                
            if self.isVisible():
                self.mRenWin.Start()
dataset/ETHPy150Open VisTrails/VisTrails/contrib/titan/vtkviewcell.py/QVTKViewWidget.SetRenderWindow