代码拉取完成,页面将自动刷新
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, '*');
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。