Build after adding
#include <vtkAutoInit.h> VTK_MODULE_INIT(vtkRenderingOpenGL)
The program runs, but the chart title and numbers at the axes are missing.
It continuously complains
ERROR: In /VTK/VTK-8.0.0/Rendering/ContextOpenGL/vtkOpenGLContextDevice2D.cxx, line 1470
vtkOpenGL2ContextDevice2D (0x7fb6d9c8a320): No text renderer available. Link to vtkRenderingFreeType to get the default implementation.
Additional, minor problem: the rubber band (right mouse button / ctrl+left button) seems to be displaced by half of the window size - probably the pixel density of the retina display is not recognized.
Any help how this can be fixed is appreciated - thanks !
> Thanks Allie,
> Unfortunately I still do not understand the linking problem: my .pro file
> LIBS += -L/usr/local/VTK/VTK-8.0.0/lib \ # folder to your VTK library
> -lvtkChartsCore-8.0 \
> -lvtkCommonCore-8.0 \
> -lvtkGUISupportQt-8.0 \
> -lvtkCommonDataModel-8.0 \
> -lvtkRenderingContext2D-8.0 \
> -lvtkRenderingContextOpenGL-8.0 \
> -lvtkRenderingOpenGL-8.0 \
> -lvtkRenderingCore-8.0 \
> -lvtkRenderingLabel-8.0 \
> -lvtkViewsContext2D-8.0 \
> What else do I have to do in order to link to vtkRenderingFreeType?
I'm not terribly familiar with using VTK outside of CMake, but I think
what you have is correct for qmake.
The issue is that vtkRenderingFreeType provides an object-factory
override for the vtkTextRenderer class, but it's not getting
registered with the object factory at runtime. I believe this is what
the VTK_MODULE_INIT macros do (someone correct me if I'm wrong).
I think adding a VTK_MODULE_INIT(...) for each of the linked VTK
libraries should fix this.
Powered by www.kitware.com