VTK Installation and Configuration with Qt in Ubuntu

22 篇文章 1 订阅
5 篇文章 0 订阅
本文档详细介绍了如何在Ubuntu操作系统中下载并安装VTK 5.10.1,包括从源码编译、配置、安装到系统目录以及将QVTKWidgetPlugin插件复制到Qt的designer目录。最后,展示了如何在QtCreator的CMakeLists.txt文件中设置VTK以在项目中使用。
摘要由CSDN通过智能技术生成
  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:


    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})

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


    评论
    添加红包

    请填写红包祝福语或标题

    红包个数最小为10个

    红包金额最低5元

    当前余额3.43前往充值 >
    需支付:10.00
    成就一亿技术人!
    领取后你会自动成为博主和红包主的粉丝 规则
    hope_wisdom
    发出的红包
    实付
    使用余额支付
    点击重新获取
    扫码支付
    钱包余额 0

    抵扣说明:

    1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
    2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

    余额充值