6 Star 0 Fork 9

src-openEuler/pcl

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Fix-Bug-between-addText3D-and-QVTKWidget.patch 2.78 KB
一键复制 编辑 原始数据 按行查看 历史
From 40bf6c03b2596f5e9e5867e4934899fa17065e8e Mon Sep 17 00:00:00 2001
From: Shu Dengdeng <60308179+booksuper@users.noreply.github.com>
Date: Mon, 27 Dec 2021 05:09:45 -0600
Subject: [PATCH] Fix Bug between addText3D and QVTKWidget (#5054)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Error between addtext3d and qvtkwidget
When using addtext3d to display 3D text in qvtkwidget, an error "access conflict occurs when reading position 0x000000000000008" will be reported. The reason is that "render - > render()" has been used in addtext3d once, but to send 3D text to qvtkwidget window, execute "UI - > qvtkwidget - > setrenderwindow (viewer - > getrenderwindow());Viewer - > setupinteractor (UI - > qvtkwidget - > getinteractor()); ", which is equivalent to repeated rendering, resulting in pointer out of bounds.
After experiments, it is OK to delete "render - > render()" and it works normally when it does not interact with qvtkwidget
* Error between addtext3d and qvtkwidget
When using addtext3d to display 3D text in qvtkwidget, an error "access conflict occurs when reading position 0x000000000000008" will be reported. The reason is that "render - > render()" has been used in addtext3d once, but to send 3D text to qvtkwidget window, execute "UI - > qvtkwidget - > setrenderwindow (viewer - > getrenderwindow());Viewer - > setupinteractor (UI - > qvtkwidget - > getinteractor()); ", which is equivalent to repeated rendering, resulting in pointer out of bounds.
To solve this problem it is OK to delete "render - > render()". I have passed the test on vtk8.0.0, Larshg has tested on vtk9.0.1, and vtk6 and 7 have not been tested. Therefore, the judgment statement of VTK version is added.
* Fix Bug between addText3D and QVTKWidget
After successfully testing vtk6,7,just remove “Render->render()” entirely
* Apply suggestions from code review
Co-authored-by: Lars Glud <larshg@gmail.com>
Co-authored-by: Lars Glud <larshg@gmail.com>
---
.../include/pcl/visualization/impl/pcl_visualizer.hpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/visualization/include/pcl/visualization/impl/pcl_visualizer.hpp b/visualization/include/pcl/visualization/impl/pcl_visualizer.hpp
index 4eca4e2b74b..3cbed49d6b6 100644
--- a/visualization/include/pcl/visualization/impl/pcl_visualizer.hpp
+++ b/visualization/include/pcl/visualization/impl/pcl_visualizer.hpp
@@ -755,8 +755,7 @@ pcl::visualization::PCLVisualizer::addText3D (
textActor->SetCamera (renderer->GetActiveCamera ());
renderer->AddActor (textActor);
- renderer->Render ();
-
+
// Save the pointer/ID pair to the global actor map. If we are saving multiple vtkFollowers
// for multiple viewport
const std::string uid = tid + std::string (i, '*');
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/pcl.git
git@gitee.com:src-openeuler/pcl.git
src-openeuler
pcl
pcl
master

搜索帮助