Compataility with latest versions of VTK

Hi,

Based on the previous post in the forum, I do understand that OCCT supports VTK 6.1 and not higher versions of that. I am working on the project which is based on Qt 5.5 & VTK 6.3. So I just want to make sure whether the approach what I am planning to take will help me to use OCCT in my project or not.

1. Compile & build static libraries of VTK 6.1

2. Compile & build shared libraries of OCCT using static libraries of VTK 6.1

​3. Use these shared libraries in my project in order to convert TopoDS_Shape objects to vtkPolyData objects.

Experts & experienced people kindly comment on this whether this will be feasible or I have to write my own wrapper to convert TopoDS_Shape objects to vtkPolyData objects?

 

Thanks

qa qa's picture

Hi Rakesh,

TopoDS_Shape object uses boundary representation approach but vtkPolyData is based on the triangulation approach. In my mind, you should try to find such a kind of converter in the OCCT IVTK project. If there is no such converter you should write it from scratch.

qa qa

Qr Qr's picture

I do understand that OCCT supports VTK 6.1 and not higher versions of that.

OpenCascade "almost supports" VTK 7.1 (the newest version of VTK). I do not remember what exactly you have to adjust in the code (there are some deprecated methods), but it is quite trivial if you're familiar with VTK. Also note that VTK7 is much faster in terms of FPS, so it is better to use VTK7. For conversion from TopoDS to vtkPolyData, you may refer to IVtkOCC_ShapeMesher.

Rakesh Patil's picture

Hi Qr Qr,

Yesterday I was trying to compile OCCT 7.1.0 by enabling Use VTK option in CMake. As I am using VTK 6.3, I gave required path settings of VTK. The build process failed at 47% when it was trying to generate libTKIVtk.dylib. Here is the error message it shows:

[ 47%] Linking CXX shared library ../../mac64/clang/libd/libTKIVtk.dylib

ld: library not found for -lvtkRenderingFreeTypeOpenGL

clang: error: linker command failed with exit code 1 (use -v to see invocation)

make[2]: *** [mac64/clang/libd/libTKIVtk.7.0.0.dylib] Error 1

make[1]: *** [src/TKIVtk/CMakeFiles/TKIVtk.dir/all] Error 2

make: *** [all] Error 2

It is clear that vtkRenderingFreeTypeOpenGL is not found, and it does not exists because VTK 6.3 and above does not support vtkRenderingFreeTypeOpenGL. So, I think that OCCT is still looking for that library which is supported by VTK lesser than 6.3.0. 

Note: I am compiling OCCT on macOS Sierra version 10.12.2

Thanks

Rakesh Patil's picture

Hi,

How can I compile OpenCascade 7.1.0 with VTK 6.3.0?

Thanks

Petr Matousek's picture

I am not sure if it is correct/recommended way how to do it, but ...

Before running cmake I removed the "vtkRenderingFreeTypeOpenGL" lines from both files:

${src.root}/src/TKIVtk/EXTERNLIB

${src.root}/src/TKIVtkDraw/EXTERNLIB

Then I build the OCCT the standard way without any linker complains that vtkRenderingFreeTypeOpenGL is missing.

Fedora Core 25, VTK 6.3.0, OCCT 7.1.0

Hope it could help someone. Petr