Skip to content

feat(tutos): use qml and c++ for tuto 08 and 09

Emilie WERNERT requested to merge tuto-qml into dev

This MR depends of !16 (merged), please review it before this one

What does this MR do?

New version of the Tutorial 08 and 09 using qml and c++ (without XML configuration).

fwVTKQml:
New library to allow to display a VTK scene in qml

visuVTKQml: New bundle to initialize qml FrameBuffer

uiMedDataQml, uiImageQml, uiReconstructionQml:
New bundles containing service inherited from IQmlService and the associated qml files.

Closes #2 (closed)

Documentation

sight-doc!3 (merged)

How to test it?

Launch Tuto08GenericSceneQml and Tuto09MesherWithGenericSceneQml.

Tuto08:

  • open an image and use the different editors/sliders
  • open a model and a texture

Tuto09:

  • open a 3D image mask
  • generate a modelSeries
  • play with the organ manager editor

Data

For Tuto08, you will need a 3D image, a model with texture coordinates and a texture image.
For Tuto09, you will need a 3D image mask.

You can find some data here For the texture, you can use this mesh: sphere_uv.vtk

Some results

Tuto08:

Capture_d_écran_2018-08-29_à_14.34.22

Capture_d_écran_2018-08-27_à_12.07.50

Tuto09:

Capture_d_écran_2018-08-29_à_14.33.40

Known issues

Snapshot:
The snapshot does not work, it produces a random colored image, as if the image buffer was not initialized:
with qml, the scene is rendered into a frameBuffer, I think that the snapshot adaptor does use this frameBuffer to snapshot the scene.
I replaced the use of the vtk scene to create snapshot and directly use qml grabToImage().

Texture:
A vtk assert is raised when I load a texture in tuto08.

Assertion failed: (this->Handle), function Bind, file Dev/Builds/pkgs-dev-d/vtk/vtk-prefix/src/vtk/Rendering/OpenGL2/vtkTextureObject.cxx, line 545.

I think that the context of our vtkInternalOpenGLRenderWindow is not correctly given to the vtkTextureObject in SMaterial.
I hacked it by disabling the use of a vtkTextureObject when using a vtkInternalOpenGLRenderWindow

If you accept this MR, I will create issues to fix it later.

Depends

  • sight-deps!1 : Qt 5.11
  • !15 (merged) : helper to manage services (AppManager)
  • !16 (merged) : basic Qml integration (QmlEditor and QmlEngine)
Edited by Emilie WERNERT

Merge request reports