[vtkusers] Rendering a Window on Screen with vtkOpenVRRenderWindow

Ken Martin ken.martin at kitware.com
Tue Apr 10 11:41:31 EDT 2018


If you need it embedded into a Qt app you can do it the same basic way the
OpenVR plugin in paraview does it.  I think it relies on you having a
vtk/qt window in your app (already up and displayed) and then using that as
the HelperWindow. SOme snippets of code (and a lot you don;t need) can be
found here

https://gitlab.kitware.com/paraview/paraview/blob/master/Plugins/OpenVR/vtkPVOpenVRHelper.cxx#L591

On Wed, Feb 28, 2018 at 9:36 PM, lmkkp <lmkkpvtk at 163.com> wrote:

> How can I render a window on screen with vtkOpenVRRenderWindow?
> The relevant code in VTK8.1 is following:
>        this->HelperWindow->SetDisplayId(this->GetGenericDisplayId());
>        this->HelperWindow->SetOffScreenRendering(1);//I tried to comment
> out this line,
>                                                                   //then a
> black window appeared on the screen.
>                                                                 //This
> window did not do any rendering.
>        this->HelperWindow->Initialize();
> The relevant code using sdl in VTK8.0 is following:
>     this->WindowId = SDL_CreateWindow( this->WindowName,
>         this->Position[0], this->Position[1],
>         this->Size[0] / 2, this->Size[1] / 2,
>         unWindowFlags );
> I want the 8.1 version to be the same as the 8.0 version on the desktop to
> display the rendering window and embedded into the qt main window.
> Ps: I can not embed the 8.0 version's sdl window into qt window because
> some strange errors.
> Thanks very much.
>
>
>
>
> _______________________________________________
> 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:
> https://vtk.org/mailman/listinfo/vtkusers
>
>


-- 
Ken Martin PhD
Distinguished Engineer
Kitware Inc.
101 East Weaver Street
Carrboro, North Carolina
27510 USA

This communication, including all attachments, contains confidential and
legally privileged information, and it is intended only for the use of the
addressee.  Access to this email by anyone else is unauthorized. If you are
not the intended recipient, any disclosure, copying, distribution or any
action taken in reliance on it is prohibited and may be unlawful. If you
received this communication in error please notify us immediately and
destroy the original message.  Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180410/bd047996/attachment.html>


More information about the vtkusers mailing list