需求
在cc中创建一个点击交互按钮,主窗口点击,显示交互界面,点选点云将点云物体的rgb值或者坐标存储到txt中。
实现思路
模范cc中的PointPick插件,实现点击交互,将label中的内容读入txt
实现步骤
- UI制作
- 在qt design中设计UI如下:
- 在qt design中设计UI如下:
制作好UI后需要对去编译,生成ui_xxxxx.h文件,具体步骤可参考:https://blog.csdn.net/NEXUS666/article/details/111330786
- 自定义一个操作类:PickTool,编译生成Moc_PickTool.cpp,类的实现代码放在后面。
参考文章:https://blog.csdn.net/NEXUS666/article/details/111338271?utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-11.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-11.control
mainwindow上的改动
- 在mainwindow.ui上添加一个按键
保存后编译一下,覆盖原来的ui_mainwindow.h
- mainwindow.h上的改动
- 声明自定义的类(PickTool)
- 声明自定义的类(PickTool)
- 声明一个点击函数
- 定义一个指针
- 定义一个指针
- mainwindow.cpp上的改动
- 将指针初始化为null
- 绑定沟槽
- 实现函数
+
重新编译CloudCompare,即可完成
- 将指针初始化为null