Series
- Part-1: Install and Configure Qt5 on Ubuntu 16.04
- Part-2: Install and Configure VTK 8.1.0 from source with Qt5 on Ubuntu 16.04
- Part-3: Install and Configure PCL 1.8.1 with vtk qt support on Ubuntu 16.04 from source
- Part-4: Install and Configure PCL 1.8.1 with vtk qt support on windows 10 from source
Guide
- qt: 5.7.0
- qmake: 3.0
- qtcreator: 3.5.1
- vtk: 8.1.0 (from source)
install qt57
see Part-1: Install and Configure Qt5 on Ubuntu 16.04
install qt57 and qtcreator.
install vtk
download source
Download vtk source
1 | wget https://www.vtk.org/files/release/8.1/VTK-8.1.0.tar.gz |
integrate VTK with Qt for a pretty graphical user interface, we need to turn on some options.
configure vtk with qt
1 | cd VTK-8.1.0 |
with options:
VTK_Group_Qt ON
VTK_QT_VERSION 5 # default
QT5_DIR /opt/qt/5.7/gcc_64/lib/cmake/Qt5
VTK_RENDERING_BACKEND OpenGL2 # default
BUILD_SHARED_LIBS ON
CMAKE_BUILD_TYPE Release
CMAKE_INSTALL_PREFIX /usr/local
set
QT5_Dir
to/opt/qt/5.7/gcc_64/lib/cmake/Qt5
download MD5 VTKData
tar VTKData-8.1.0.tar.gz
and copy MD5
to VTK-8.1.0/build/ExternalData/Objects/MD5
make and install
1 | make -j8 |
install to
/usr/local/include/vtk-8.1
and/usr/local/lib/cmake/vtk-8.1
install QVTKWidget plugin
- copy
libQVTKWidgetPlugin.so
to
install path:/usr/lib/x86_64-linux-gnu/qt5/plugins/designer
1 | cd build/lib |
- now list designer plugins
1 | ls /usr/lib/x86_64-linux-gnu/qt5/plugins/designer |
- if we start
qtcreator
we will see anQVTKWidget
at the bottom ofVTK
container ofDesign
layout.
VTK Example
CylinderRenderingProperties.cpp
1 |
|
CMakeLists.txt
1 | cmake_minimum_required(VERSION 2.8) |
compile
mkdir build && cd build && cmake-gui ..
make -j8
Reference
History
- 20180108: created.