[vtkusers] [QT+VTK] QVTKWidget x QVTKWidget2

Lays Rodrigues laysrodriguessilva at gmail.com
Tue Nov 3 17:47:19 EST 2015


Hi guys,
Yestarday i was able to get the code ReadSTL from VTK Wiki and convert to
use in my QtApp using QVTKWidget. But, this class is depreciade. So i'm
trying to use the QVTKWidget2.
Was told to me that i only need to this to make the code fom VTK Wiki works
on my code:

vtkRenderWindow* renderWindow = this->GetRenderWindow();

Using the class QVTKWidget the return of GetRenderWindow is the type
vtkRenderWindow, so its easy to solve. But in the QVTKWidget2, the return
type of the function is a vtkGenericOpenGLRenderWindow, so with a little
help for other guy i came to this:

vtkSmartPointer<vtkRenderer> renderer = vtkSmartPointer<vtkRenderer>::New();

vtkRenderWindowInteractor *r = this->GetRenderWindow()->GetInteractor();

vtkRenderWindow* renderWindow = vtkRenderWindow::New();

r->SetRenderWindow(renderWindow);

renderWindow->AddRenderer(renderer);


renderer->AddActor(actor);

renderer->SetBackground(.0, .5, 1); // Background color blue


renderer->ResetCamera();

renderWindow->Render();



BUT, the stl is load on a popup window, and dont permit zoom or move the
load model . I guess that i'm missing something. But how i have only 2 days
working with VTK, i dont know. I think that is something small and stupid,
but i can be wrong too.
Any tips?
Thanks!

​



-- 
__
*Lays Rodrigues*
*Developer Front-End at Br-Print3D Project*
*Student of Computer Science at UFF/PURO*
Organizadora da Semana da Computação UFF-PURO
www.facebook.com/semanacomputacaopuro
www.facebook.com/brprint3d
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151103/5470f829/attachment.html>


More information about the vtkusers mailing list