Hello again Leo,<br> Here's my code once again, but distilled and reordered a bit. I removed all the Deletes and whatnot. I'm still not getting anything but the gradient background. Any clues? <br> I downloaded and compiled VTK-5.4 with QVTK, using Qt version 4.5.1 from Qt SDK 2009.02. Still no luck. So the latest VTK from CVS and version 5.4 aren't working. I can't be the only one using QVTK. I am not using cmake to build my project, could this be the problem? Are there some compiler flags I need to set for QVTK to work?<br>
<br> Regards,<br> -Joshua<br><br>void MainWindow::SetupScene()<br>{<br> QVTKWidget* qvtkwidget = ui.qvtkWidget;<br><br> qvtkwidget->GetRenderWindow()->DoubleBufferOff();<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> 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><div class="gmail_quote">2009/5/12 L.J. van Ruijven <span dir="ltr"><<a href="mailto:L.J.vanRuijven@amc.uva.nl">L.J.vanRuijven@amc.uva.nl</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Joshua,<br>
<br>
I allready deleted your first mail, so I cannot check the code again, but I think here the background renderer is added. So that one is really drawn in the render window.<br>
But if I remember well, you created the pipeline for the cone in a separate fragment. And in the end of this fragment you deleted the cone renderer, but you never added it to the render window.<br>
<br>
regards,<br>
<br>
Leo.<br>
<div><div></div><div class="h5"><br>
<br>
----- Original Message -----<br>
From: Joshua Pedrick <<a href="mailto:jpedrick@gmail.com">jpedrick@gmail.com</a>><br>
Date: Tuesday, May 12, 2009 3:36 pm<br>
Subject: Re: Trouble with QVTK<br>
To: <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>
Cc: "L.J. van Ruijven" <<a href="mailto:L.J.vanRuijven@amc.uva.nl">L.J.vanRuijven@amc.uva.nl</a>><br>
<br>
<br>
> L.J. I think I do this in MainWindow::SetupScene() at the 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 lovely gradient<br>
> background I applied to the renderer, but no actors. The gradient background<br>
> makes me think the renderer is properly connected to the render window.<br>
><br>
> I'm going to compile the stable version of VTK today and 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">L.J.vanRuijven@amc.uva.nl</a>><br>
><br>
> > Hi Joshua,<br>
> ><br>
> > I think you forgot to connect the renderer to the renderwindow. Somewhere<br>
> > you should add the statement renWin->AddRenderer(ren).<br>
> ><br>
> > regards,<br>
> ><br>
> > Leo<br>
> ><br>
> ><br>
> ><br>
><br>
</div></div></blockquote></div><br>