QGlWidget and OCCT Iges entities

Hi everybody, I'm new in the forum and I'm starting to use OpenCascade to read IGES files. 
I'm using Qt library with a QGlWidget area in wich I draw my geometric entities like lines and surfaces with the basic OpenGl functions (GL_LINES, GL_LINE_LOOP..).
I've this question: Is it possible to draw the OpenCascade geometries (for examples the curves and the surface of the iges file) in my GLarea or I must do in a separate GlArea. I would like to draw both openCascade geometries and my geometries in the same window. 
I don't understand if the two things can coexist in the same Gl area.

Forum supervisor's picture

Dear Gabriele,

Welcome to our resources and communicate us via Contact Form to exchange information about our services and expertise and needs of your company projects.

OCCT 3D Viewer can be combined within other OpenGL renderer in various ways,
as rendering performed on top, or embedded into scene as custom OpenGl_Element.

The most obvious example of such combination is Open CASCADE CAD Assistant,
where Qt/QML draws user interface controls using OpenGL on top of OCCT 3D Viewer:
https://www.opencascade.com/content/cad-assistant

However, while rendering 3D elements, you should be aware of complexity and multi-pass techniques used by OCCT 3D Viewer.
Therefore, it is preferred to use low-level OCCT APIs (custom AIS_InteractiveObject computing primitives arrays,
or using OpenGL calls directly within custom OpenGl_Element) for more straight-forward integration into rendering pipeline.
Package OpenGl in OCCT provides a lot of useful classes wrapping OpenGL routines in object-oriented way.

See also class VUserDrawObj in file src/ViewerTest/ViewerTest_OpenGlCommands.cxx as short introduction
to embedding of low-level rendering routines into OCCT 3D Viewer.

Best regards,
Forum supervisor

Gabriele Cuccolini's picture

Hi, thank you very much for your answer. It's very helpful for me. The cad-assistant is very interesting to start to understand the OpenCascade world.