VTK Installation and Configuration with Qt in Ubuntu

  1. Download vtk-5.10.1.tar.gz fromhttp://vtk.org/VTK/resources/software.html#latestand extract;

  2. $cd/home/chen/Downloads/VTK5.10.1/

  3. $mkdir VTKBin

  4. $cd VTKBin

  5. $cmake ..

  6. $ccmake ..

    configure as follows:


    press c to configure, and press g togenerate and exit;

$makecopy the include files andlibraries to system directories: $sudo make installcopy the plugin to qt:

$cd /usr/lib/qt4

sudo mkdir plugins

cd plugins

sudo mkdir designer

sudo cp~/Downloads/VTK5.10.1/VTKBin/bin/libQVTKWidgetPlugin.so/usr/lib/qt4/plugins/designer

open qtcreator (can be installedfrom Ubuntu Software Center) create one Gui application and open the ui by qtdesigner tocheck QVTKWidget.



To use VTK in your own project, addfollowing to the CMakeLists.txt in your project:

########################################################

#VTK

#set(VTK_DIR"~/Downloads/vtk/VTK5.10.1/build")

set(VTK_DIR "/usr/local/lib/vtk-5.10")

find_package(VTK REQUIRED)

include(${VTK_USE_FILE})

########################################################


猜你喜欢

转载自blog.csdn.net/owldestiny/article/details/8804252