[vtkusers] InfoVis: vtkGraphLayoutView in QVTK Widget

Eric E. Monson emonson at cs.duke.edu
Mon Jun 29 10:44:39 EDT 2009


Hey again,

I just tried to follow the Cxx EasyView and it still opens another  
render window with all of my graph stuff in it, and the QVTK widget  
just shows garbage from the last application that I ran (which here  
happens to be another PyQt4 app showing a cylinder that worked just  
fine -- screen shot attached).

class SimpleView(QtGui.QMainWindow):

     def __init__(self, parent = None):

         QtGui.QMainWindow.__init__(self, parent)
         self.ui = Ui_MainWindow()
         self.ui.setupUi(self)

         self.view = vtk.vtkGraphLayoutView()
         self.ui.vtkWidget.SetRenderWindow(self.view.GetRenderWindow())


I'm using OS X 10.5.7, Qt 4.4.3, VTK CVS from June 18th, Python 2.5.

Thanks,
-Eric

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ExtraRenWin.jpg
Type: image/jpeg
Size: 50156 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090629/4d80e81e/attachment.jpg>
-------------- next part --------------



On Jun 29, 2009, at 9:59 AM, Eric E. Monson wrote:

> Hello,
>
> I have a little Python/PyQt4 app that I made about six months ago to  
> view graphs using the Titan classes. A vtkGraphLayoutView should  
> show up in a QVTK Widget which I placed using Designer, but now with  
> CVS VTK I get a separate RenderWindow popping up showing my graph...
>
> vtkGraphLayoutView used to have a SetupRenderWindow() method, so I  
> used to set things up by:
>
>        QtGui.QMainWindow.__init__(self, parent)
>        self.ui = Ui_MainWindow()
>        self.ui.setupUi(self)
>
>        self.ren = vtk.vtkRenderer()
>        self.ui.vtkWidget.GetRenderWindow().AddRenderer(self.ren)
>
>        [...]
>
>        self.view = vtk.vtkGraphLayoutView()
>        win = self.ren.GetRenderWindow()
>        self.view.SetupRenderWindow(win)
>
> Now if I just take out the view.SetupRenderWindow(win) call, I get a  
> separate RenderWindow popping up and the QVTK widget is all black. I  
> tried reordering the calls to something like this:
>
>        self.view = vtk.vtkGraphLayoutView()
>        self.ren = self.view.GetRenderer()
>        self.ui.vtkWidget.GetRenderWindow().AddRenderer(self.ren)
>        self.win = self.ui.vtkWidget.GetRenderWindow()
>
> Then the graph shows up in BOTH the extra window and my QVTK Widget.
>
> I know I'm just ignorant about the correct method -- can anybody  
> help me set up a vtkGraphLayoutView in a QVTK Widget properly?
>
> Thanks a lot,
> -Eric
>
> ------------------------------------------------------
> Eric E Monson
> Duke Visualization Technology Group
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers



More information about the vtkusers mailing list