Visualization advice

Hello,

Can I have some advice on the following points?

1. Is the only way to execute OpenGl commands (glColor3f) by setting a call back function when setting the window to V3d_View?
V3d_View::SetWindow(hWnd,&function);

2. If you want to control the drawing (to the window), is the best way to create a frame buffer object and render that yourself?

Thank you for your advice, it would be great to have answers to these because it would open opportunities such as transparent UI, custom rendering.

Daniel Neander

Kirill Gavrilov's picture

>> 1. Is the only way to execute OpenGl commands (glColor3f) by setting
>> a call back function when setting the window to V3d_View?
>> V3d_View::SetWindow(hWnd,&function);
There are two ways to perform low-level rendering within current TKV3d:
- (Already mentioned) callback function at window level (the callback called several times for different stages).
- UserDraw functionality (see VUserDrawObj in src/ViewerTest/ViewerTest_OpenGlCommands.cxx as example), which allows custom rendering of custom interactive objects.

The design might become much more clear in next release - it will be possible to create own objects without redundant callback functions.

>> 2. If you want to control the drawing (to the window),
>> is the best way to create a frame buffer object and render that yourself?
The FBO is a good way to customize rendering (post-processing) at the final stage before displaying content on the screen.
It is unclean to me how actually FBO is expected to be used in your case.

Daniel Neander's picture

Thank you for you reply Kvg.

In my case it can be used with Qt to add support for transparent UI
(Re-implementing drawBackground function, and render the FBO in there).

jelle's picture

Daniel,

I'm curious if you've managed to get this up and running in Qt.
Is it possible to glance over your code perhaps?

thanks,

-jelle

AP's picture

Hi Daniel,

If you have a solution to drawing the view in a framebuffer and then painting that to a Qt Widget in contrast to the current direct draw method, please share.

I have been trying to draw a QTreeWidget above a View and when I set the QTreeWidget as translucent It Flickers and produces Artefacts as well as a weird redrawing of the rubberband rectangle, doesn't seem to like it. Your solution of drawing it to a Framebuffer would solve this and open up many more image based manipulations that can be made in Qt, like a Blurred effect on Modal Dialogs, fancy HUD's or producing thumbnails of the current view when user stores a viewport.

Best,

Alex

Daniel Neander's picture

Hello Jelle and Alex,

I don't have a working solution as I have been very busy the past months, but I think the following links is the solution.

http://dev.opencascade.org/index.php?q=node/766
http://tracker.dev.opencascade.org/view.php?id=24699
http://git.dev.opencascade.org/gitweb/?p=occt.git;a=tree;f=samples/CShar...

The DirectX sample is demonstrating the functionality we need.

Good luck!

Kind regards
Daniel