thliebig / QCSXCAD

QCSXCAD - Qt-GUI for CSXCAD
http://openEMS.de
GNU Lesser General Public License v3.0
4 stars 13 forks source link

Fails to build with VTK-9.2.2: no member named 'GetRenderWindow' in 'QVTKOpenGLStereoWidget'; did you mean 'renderWindow'? #10

Closed yurivict closed 1 year ago

yurivict commented 1 year ago
/wrkdirs/usr/ports/cad/qcsxcad/work/QCSXCAD-0.6.2-9-g3f09a8b/QVTKStructure.cpp:116:13: error: no member named 'GetRenderWindow' in 'QVTKOpenGLStereoWidget'; did you mean 'renderWindow'?
        VTKWidget->GetRenderWindow()->AddRenderer(ren);
                   ^~~~~~~~~~~~~~~
                   renderWindow
/usr/local/include/vtk-9.2/QVTKOpenGLStereoWidget.h:93:20: note: 'renderWindow' declared here
  vtkRenderWindow* renderWindow() const { return this->VTKOpenGLWindow->renderWindow(); }
                   ^
thliebig commented 1 year ago

Well looking into the vtk 9.2 release notes confirms that vtk has made some API changes. I'm not sure why a library this big does stuff like this. But I guess checking for all such API changes will require some work. Until then, QCSXCAD does not work with vtk >=9.2

yurivict commented 1 year ago

This patch solves it.

thliebig commented 1 year ago

Does it work with older vtk aswell? And down to which version of vtk? Otherwise it will need an ugly #ifdef switch...

yurivict commented 1 year ago

My guess is that it doesn't work with older VTK versions.

I added this patch in order to update VTK to 9.2.2 on FreeBSD. But if you need to support multiple VTK versions you need to put ugly ifdefs. The change occurred between 9.1.0 and 9.2.2

All release tags are listed here.

StefanBruens commented 1 year ago

renderWindow and setRenderWindow have been added in 9.0(rc) only, and the semantically equivalent GetRenderWindow/SetRenderWindow have been deprecated at the same time. Thats unfortunately a quite short time window.

According to https://repology.org/project/vtk/badges, all current distributions have VTK 9.

From all the distributions above, only openSUSE packages (Q)CSXCAD.

@thliebig - is it really worth to keep up VTK 7 and 8 support?