Ok, I guess I wasn't clear. I am using CentOS 5.2 64-bit. Qt sdk 2009.02 (Qt v4.5.1). I've built VTK to include GUISupport and Qt support. I've tried to replicate the GUI4 example. Using the GUI 4 example I get all the correct behavior, including changing the background, but I can not see any 3D VTK objects(cone or sphere) in the RenderWindows. I've the relevent source files.<br>
<br>So, I was hoping for an example that actually worked or some advice as to what I have done incorrectly.<br><br> Regards,<br> -Joshua<br><br><br><div class="gmail_quote">On Thu, May 21, 2009 at 10:16 AM, Clinton Stimpson <span dir="ltr"><<a href="mailto:clinton@elemtech.com">clinton@elemtech.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
There are examples in VTK/Examples/GUI/Qt.<br>
Both SimpleView/ and Events/ have designer .ui files.<br>
<br>
Clint<br>
<br>
Joshua Pedrick wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
Does anyone have a working example using QVTK + QtDesigner on Linux that I could try to compare?<br>
<br></div><div><div></div><div class="h5">
On Tue, May 12, 2009 at 1:16 PM, Joshua Pedrick <<a href="mailto:jpedrick@gmail.com" target="_blank">jpedrick@gmail.com</a> <mailto:<a href="mailto:jpedrick@gmail.com" target="_blank">jpedrick@gmail.com</a>>> wrote:<br>
<br>
Hello again Leo,<br>
Here's my code once again, but distilled and reordered a bit.<br>
I removed all the Deletes and whatnot. I'm still not getting<br>
anything but the gradient background. Any clues?<br>
I downloaded and compiled VTK-5.4 with QVTK, using Qt version<br>
4.5.1 from Qt SDK 2009.02. Still no luck. So the latest VTK from<br>
CVS and version 5.4 aren't working. I can't be the only one using<br>
QVTK. I am not using cmake to build my project, could this be the<br>
problem? Are there some compiler flags I need to set for QVTK to<br>
work?<br>
<br>
<br>
Regards,<br>
-Joshua<br>
<br>
void MainWindow::SetupScene()<br>
{<br>
QVTKWidget* qvtkwidget = ui.qvtkWidget;<br>
<br>
qvtkwidget->GetRenderWindow()->DoubleBufferOff();<br>
<br>
<br>
//Put cone in window<br>
{<br>
vtkConeSource *cone = vtkConeSource::New();<br>
<br>
//Create Cone Mapper.<br>
vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New();<br>
coneMapper->SetInputConnection(cone->GetOutputPort());<br>
<br>
//Create Cone Actor<br>
<br>
vtkActor *coneActor = vtkActor::New();<br>
coneActor->SetMapper(coneMapper);<br>
<br>
//Create Cone Renderer<br>
vtkRenderer *ren = vtkRenderer::New();<br>
ren->SetBackground(0,0,0);<br>
ren->SetBackground2(1,1,1);<br>
ren->GradientBackgroundOn();<br>
<br>
ren->AddActor(coneActor);<br>
<br>
qvtkwidget->GetRenderWindow()->AddRenderer(ren);<br>
<br>
}<br>
<br>
}<br>
<br>
2009/5/12 L.J. van Ruijven <<a href="mailto:L.J.vanRuijven@amc.uva.nl" target="_blank">L.J.vanRuijven@amc.uva.nl</a><br></div></div>
<mailto:<a href="mailto:L.J.vanRuijven@amc.uva.nl" target="_blank">L.J.vanRuijven@amc.uva.nl</a>>><div class="im"><br>
<br>
Hi Joshua,<br>
<br>
I allready deleted your first mail, so I cannot check the code<br>
again, but I think here the background renderer is added. So<br>
that one is really drawn in the render window.<br>
But if I remember well, you created the pipeline for the cone<br>
in a separate fragment. And in the end of this fragment you<br>
deleted the cone renderer, but you never added it to the<br>
render window.<br>
<br>
regards,<br>
<br>
Leo.<br>
<br>
<br>
----- Original Message -----<br>
From: Joshua Pedrick <<a href="mailto:jpedrick@gmail.com" target="_blank">jpedrick@gmail.com</a><br></div><div class="im">
<mailto:<a href="mailto:jpedrick@gmail.com" target="_blank">jpedrick@gmail.com</a>>><br>
Date: Tuesday, May 12, 2009 3:36 pm<br>
Subject: Re: Trouble with QVTK<br></div><div class="im">
To: <a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a> <mailto:<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>><br>
Cc: "L.J. van Ruijven" <<a href="mailto:L.J.vanRuijven@amc.uva.nl" target="_blank">L.J.vanRuijven@amc.uva.nl</a><br></div><div><div></div><div class="h5">
<mailto:<a href="mailto:L.J.vanRuijven@amc.uva.nl" target="_blank">L.J.vanRuijven@amc.uva.nl</a>>><br>
<br>
<br>
> L.J. I think I do this in MainWindow::SetupScene() at the<br>
very end:<br>
><br>
> qvtkwidget->GetRenderWindow()->AddRenderer(ren);<br>
> qvtkwidget->GetRenderWindow()->BordersOn();<br>
><br>
> ren->Delete();<br>
><br>
> Is this not the correct way to add a renderer? I do get the<br>
lovely gradient<br>
> background I applied to the renderer, but no actors. The<br>
gradient background<br>
> makes me think the renderer is properly connected to the<br>
render window.<br>
><br>
> I'm going to compile the stable version of VTK today and<br>
see how it goes.<br>
> I'm really suspecting there is a bug in the CVS QVTK.<br>
><br>
> Regards<br>
> -Joshua<br>
><br>
> 2009/5/12 L.J. van Ruijven <<a href="mailto:L.J.vanRuijven@amc.uva.nl" target="_blank">L.J.vanRuijven@amc.uva.nl</a><br></div></div>
<mailto:<a href="mailto:L.J.vanRuijven@amc.uva.nl" target="_blank">L.J.vanRuijven@amc.uva.nl</a>>><div class="im"><br>
><br>
> > Hi Joshua,<br>
> ><br>
> > I think you forgot to connect the renderer to the<br>
renderwindow. Somewhere<br>
> > you should add the statement renWin->AddRenderer(ren).<br>
> ><br>
> > regards,<br>
> ><br>
> > Leo<br>
> ><br>
> ><br>
> ><br>
><br>
<br>
<br>
<br></div>
------------------------------------------------------------------------<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>
<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></div><br>