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:

    VTK Installation and Configuration with Qt in Ubuntu_第1张图片

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

  7. $make
  8. copy the include files andlibraries to system directories: $sudo make install
  9. copy 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})

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


你可能感兴趣的:(VTK Installation and Configuration with Qt in Ubuntu)