[vtkusers] Read STL File QVTKWidget vs QVTKWidget2
Lays Rodrigues
laysrodriguessilva at gmail.com
Sat Oct 31 16:12:26 EDT 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 green
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/20151031/91ff38ad/attachment.html>
More information about the vtkusers
mailing list