Ubuntu Linux 16.04 LTS + Qt5.5.1 + Qwtplot3d配置安装

最近课题组需要做一个三维点云的动态显示问题,查阅相关资料,主要有两种实现方法。

Python语言实现——Vispy

基于Python中的Vispy库,官网上的介绍是这样的:VisPy is a Python library for interactive scientific visualization that is designed to be fast, scalable, and easy to use.
安装方法:Vispy 需要numpy和PyQt5作为基础
“”" python3.5.2 “”"

sudo pip3 install numpy              
sudo pip3 install PyQt5
sudo pip3 install vispy	

测试是否安装成功:Ctrl + Alt + T 打开终端

stefan@stefan-virtual-machine:~$ python3
Python 3.5.2 (default, Nov 12 2018, 13:43:14) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import vispy
>>> print(vispy.sys_info())
Platform: Linux-4.15.0-45-generic-x86_64-with-Ubuntu-16.04-xenial
Python:   3.5.2 (default, Nov 12 2018, 13:43:14)  [GCC 5.4.0 20160609]
NumPy:    1.14.5
Backend:  PyQt5

出现以上输出,证明安装成功。可以根据http://vispy.org/ 上的范例学习,这里不详细介绍。

C++ 语言实现——QwtPlot3d

上述的Vispy参考资料太少,只能根据官网教程自学,且需要一定的OpenGL知识,望而却步。因而采用QwtPlot3d这个Qt第三方库进行实现。

  1. 准备工作:QwtPlot3d需要OpenGL作为基础,因而需要先安装OpenGL.
# 配置基本编译环境
sudo apt-get install build-essentia
# 安装OpenGL Library
sudo apt-get install libgl1-mesa-dev
# 安装OpenGL Utilities
sudo apt-get install libglu1-mesa-dev
# 安装OpenGL Utility Toolkit
sudo apt-get install freeglut3-dev

下面测试是否安装成功:进入https://jbox.sjtu.edu.cn/l/wJoO6f(密码:tztr)下载Test.cpp.在终端中输入:

g++ Test.cpp -o test  -l GL -l GLU -l glut
./test

效果如下图所示,即为安装成功。

在这里插入图片描述
2. 下载QwtPlot3d压缩包。
a. https://sourceforge.net/projects/qwtplot3d/ 此链接下载qwtplot3d-0.2.7.zip,使用Qt编译时会出现问题,具体修改措施参考:https://blog.csdn.net/eastonwoo/article/details/37658141
b. https://sourceforge.net/p/qwtplot3d/code/HEAD/tarball?path=/branches/multiple_curves_0_2_x 此链接下载qwtplot3d-code-r259-branches-multiple_curves_0_2_x.zip,编译顺利进行。
3. 打开Qt5.5.1, 打开qwtplot3d.pro,configure project。右下角选择Release,后构建。出现Warning不用理会。
在这里插入图片描述
4. 构建完成后,找到/home/stefan/qwtplot3d-code-r259-branches-multiple_curves_0_2_x/build-qwtplot3d-Desktop_Qt_5_5_1_GCC_64bit-Release/lib/release/linux文件夹下:
将:
libqwtplot3d.so
libqwtplot3d.so.0
libqwtplot3d.so.0.3
libqwtplot3d.so.0.3.0
复制至:
/home/stefan/Qt5.5.1/5.5/gcc_64/lib
/home/stefan/Qt5.5.1/Tools/QtCreator/lib/qtcreator 文件夹下
5. 使用Qt打开/qwtplot3d/examples/simpleplot/simpleplot.pro
6. 修改common.pri, 将unix:LIBS += -lqwtplot3d -L../../lib注释掉,改为:

unix:LIBS += -L/home/stefan/qwtplot3d-code-r259-branches-multiple_curves_0_2_x/build-qwtplot3d-Desktop_Qt_5_5_1_GCC_64bit-Release/lib/release/linux -lqwtplot3d -lz -lGLU

实际上就是将Release的结果中库包含进来。
7. 运行程序,出现以下图片,QwtPlot3d配置完成。

在这里插入图片描述
[1]: https://forum.qt.io/topic/43953/solved-qwtplot3d-linux/7
[2]: https://blog.csdn.net/wasaiheihei/article/details/52085397

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值