[vtkusers] Read STL File QVTKWidget vs QVTKWidget2

Dženan Zukić dzenanz at gmail.com
Tue Nov 10 14:50:29 EST 2015


Hi Lays,

this might be too late, but did you try this with an interactor?
Appropriate example:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/StyleSwitch

Regards

On Sat, Oct 31, 2015 at 4:12 PM, Lays Rodrigues <
laysrodriguessilva at gmail.com> wrote:

> 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
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151110/a8827579/attachment.html>


More information about the vtkusers mailing list