Try the following, it should work. This is the result of some major view/representation refactoring that has taken place in VTK CVS. I'd like to avoid the need for the SetInteractor() call in the future, but currently it's necessary to avoid the popout on some systems.<div>
<br></div><div><span class="Apple-style-span" style="border-collapse: collapse; ">vtkRenderViewPtr-><span class="il" style="background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: rgb(255, 255, 204); background-position: initial initial; ">SetInteractor</span>(qvtkWidget->GetInteractor());<br>
qvtkWidget->SetRenderWindow(vtkRenderViewPtr->GetRenderWindow());<br></span><br></div><div>If you're interested in some discussion of the refactoring, look here</div><div><br></div><div><a href="https://www.kitware.com/InfovisWiki/index.php/View_Representation_Refactoring">https://www.kitware.com/InfovisWiki/index.php/View_Representation_Refactoring</a></div>
<div><br></div><div>Jeff</div><div><br><div class="gmail_quote">On Mon, Jun 29, 2009 at 10:44 AM, Eric E. Monson <span dir="ltr"><<a href="mailto:emonson@cs.duke.edu">emonson@cs.duke.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hey again,<br>
<br>
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).<br>
<br>
class SimpleView(QtGui.QMainWindow):<br>
<br>
def __init__(self, parent = None):<div class="im"><br>
<br>
QtGui.QMainWindow.__init__(self, parent)<br>
self.ui = Ui_MainWindow()<br>
self.ui.setupUi(self)<br>
<br></div>
self.view = vtk.vtkGraphLayoutView()<br>
self.ui.vtkWidget.SetRenderWindow(self.view.GetRenderWindow())<br>
<br>
<br>
I'm using OS X 10.5.7, Qt 4.4.3, VTK CVS from June 18th, Python 2.5.<br>
<br>
Thanks,<br><font color="#888888">
-Eric<br>
<br>
</font><br><br>
<br>
<br>
On Jun 29, 2009, at 9:59 AM, Eric E. Monson wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br>
<br>
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...<br>
<br>
vtkGraphLayoutView used to have a SetupRenderWindow() method, so I used to set things up by:<br>
<br>
QtGui.QMainWindow.__init__(self, parent)<br>
self.ui = Ui_MainWindow()<br>
self.ui.setupUi(self)<br>
<br>
self.ren = vtk.vtkRenderer()<br>
self.ui.vtkWidget.GetRenderWindow().AddRenderer(self.ren)<br>
<br>
[...]<br>
<br>
self.view = vtk.vtkGraphLayoutView()<br>
win = self.ren.GetRenderWindow()<br>
self.view.SetupRenderWindow(win)<br>
<br>
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:<br>
<br>
self.view = vtk.vtkGraphLayoutView()<br>
self.ren = self.view.GetRenderer()<br>
self.ui.vtkWidget.GetRenderWindow().AddRenderer(self.ren)<br>
self.win = self.ui.vtkWidget.GetRenderWindow()<br>
<br>
Then the graph shows up in BOTH the extra window and my QVTK Widget.<br>
<br>
I know I'm just ignorant about the correct method -- can anybody help me set up a vtkGraphLayoutView in a QVTK Widget properly?<br>
<br>
Thanks a lot,<br>
-Eric<br>
<br>
------------------------------------------------------<br>
Eric E Monson<br>
Duke Visualization Technology Group<br>
<br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote>
<br>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Jeff Baumes, Ph.D.<br>R&D Engineer, Kitware Inc.<br>(518) 881-4932<br><a href="mailto:jeff.baumes@kitware.com">jeff.baumes@kitware.com</a><br>
</div>