Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra rendering view created for each button #40

Open
finetjul opened this issue Feb 4, 2013 · 8 comments
Open

Extra rendering view created for each button #40

finetjul opened this issue Feb 4, 2013 · 8 comments
Assignees
Labels
Milestone

Comments

@finetjul
Copy link
Member

finetjul commented Feb 4, 2013

On Ubuntu 12.04.1, I build MSVTK in Release mode
a) Start vtkbuttons demo
b) Load a polydata .vtk file
-> the data is correctly loaded.
=> an extra black window (~100x100) is created in the top left corner of my desktop.
an extra window is created for each loaded dataset
Screenshot from 2013-02-04 08:36:58

@ghost ghost assigned alosi Feb 4, 2013
@alosi
Copy link
Contributor

alosi commented Feb 5, 2013

Sorry I accidentally delete the previous comment. I wrote that it happens also on mac osx: It's a problem with VTK offscreen rendering (on linux and osx) that doesn't work properly and shows the rendering window so i think it's a VTK issue.

@alosi alosi closed this as completed Feb 5, 2013
@finetjul
Copy link
Member Author

finetjul commented Feb 5, 2013

You need to build VTK with VTK_OPENGL_HAS_OSMESA on.
This can be done in External_VTK.cmake
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/OffScreenRendering
However, I'm not sure the off screen rendering is working anyway. I don't see image in the tooltip.

@finetjul finetjul reopened this Feb 5, 2013
@alosi
Copy link
Contributor

alosi commented Feb 8, 2013

I build VTK with VTK_OPENGL_HAS_OSMESA enabled on Ubuntu but vtkButtons application doesn't work properly: if I load a data the surface and the button are not shown in the rendering window; It seems that offscreen rendering is used for all rendering processes. could you tell me if the application built with osmesa works correctly for you?

Now I'm trying to build it with mangled mesa http://www.vtk.org/Wiki/VTK/OpenGL#OpenGL_.2B_Off_screen

If I build without osmesa the application works properly and the image is shown in the tooltip (but the extra window is created)

@alosi alosi closed this as completed Feb 8, 2013
@alosi alosi reopened this Feb 8, 2013
@finetjul
Copy link
Member Author

finetjul commented Feb 9, 2013

You are right, VTK_OPENGL_HAS_OSMESA doesn't work.
There is a fix suggested on the paraview mailing list that can work:
http://www.cmake.org/pipermail/paraview/2009-December/014908.html

Can you try to change the line vtkXOpenGLRenderWindow.cxx:642
from

if (this->OwnWindow)

into

if (this->OwnWindow && !this->GetOffScreenRendering() )

Btw, I never manage to get any image in the tooltip, what type of file do you load ?

@alosi
Copy link
Contributor

alosi commented Feb 11, 2013

Thank you! With your fix it works and the extra window is not shown under ubuntu.

To answer your question:
I don't load or save image file from disk, I use a buffer with PNG image format:

I get the image as a QImage from msvQVTKButtons https://github.com/MSV-Project/MSVTK/blob/master/Applications/VTKButtons/msvQVTKButtonsMainWindow.cxx#L272

then I write it in a QBuffer with PNG format and I put it in the tooltip with html code https://github.com/MSV-Project/MSVTK/blob/master/Applications/VTKButtons/msvQVTKButtonsMainWindow.cxx#L278

@finetjul
Copy link
Member Author

Can you then push the fix in the MSVTK fork of VTK:
https://github.com/MSV-Project/VTK/commits/master

I managed to get the preview show up in the tooltip on my ubuntu computer. I did it by building against a Qt 4.7.3, which means that this feature is broken for Qt 4.6.3 (it was displaying a "file" icon instead of the preview).

Concerning the conversion to base64, you can use ctkWidgetsUtils::base64HTMLImageTagSrc()

@alosi
Copy link
Contributor

alosi commented Feb 12, 2013

Ok. Could you please give me write access to the forked VTK repository?

@finetjul
Copy link
Member Author

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants