From 809985732e35491f77e13d9876f9ad9541f6b7d6 Mon Sep 17 00:00:00 2001 From: MichalPelka Date: Wed, 28 Oct 2026 22:16:55 +0100 Subject: [PATCH] Step 2: option to show all scans while picking control points Control Points mode draws only the active scan, which is often too sparse to recognize the CP location. Add a "Show all scans (gray)" checkbox to the Control Point window that draws every other scan in flat gray as context. Display-only: CP picking still uses the active scan. Closes #436 Co-Authored-By: Claude Opus 5.5 --- .../multi_view_tls_registration_gui.cpp | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/apps/multi_view_tls_registration/multi_view_tls_registration_gui.cpp b/apps/multi_view_tls_registration/multi_view_tls_registration_gui.cpp index ca44372a..e927e240 100644 --- a/apps/multi_view_tls_registration/multi_view_tls_registration_gui.cpp +++ b/apps/multi_view_tls_registration/multi_view_tls_registration_gui.cpp @@ -205,6 +205,11 @@ inline AppStateBase app_state; // showEulerCenterOfRotationWindow() in display() below. bool cor_gui = false; +// Control Points editing shows only the active (index_pose) scan; when set, +// all other scans are drawn too, flat gray, as context for finding the CP +// location (issue #436). Display-only -- CP picking still uses the active scan. +bool cp_show_all_scans = false; + bool scroll_hint_enabled = true; bool scroll_hint_active = false; int scroll_hint_count = 0; @@ -4109,6 +4114,32 @@ void renderControlPoints(const ControlPoints& control_points, PointClouds& point if (control_points.is_imgui && control_points.index_pose >= 0 && static_cast(control_points.index_pose) < pointClouds.size()) { + if (cp_show_all_scans) + { + const Color contextColor{ 90, 90, 90, 255 }; + for (size_t i = 0; i < pointClouds.size(); ++i) + { + if (static_cast(i) == control_points.index_pose) + { + continue; + } + scan_renderer.drawCachedWithTransform( + i, + Eigen::Affine3d::Identity(), + contextColor, + static_cast(app_state.point_size), + ScanColorMode::Flat, + 0.f, + 1.f, + Eigen::Vector3d::Zero(), + 1.f, + point_clouds_container.xz_intersection, + point_clouds_container.yz_intersection, + point_clouds_container.xy_intersection, + static_cast(point_clouds_container.intersection_width)); + } + } + std::vector wasVisible(pointClouds.size()); for (size_t i = 0; i < pointClouds.size(); ++i) { @@ -4904,11 +4935,26 @@ void display() ShowMainDockSpace(); if (session.control_points.is_imgui) + { session.control_points.imgui( session.point_clouds_container, Eigen::Vector3f( app_state.camera.euler.rotationCenter.x, app_state.camera.euler.rotationCenter.y, app_state.camera.euler.rotationCenter.z)); + // Appends to the same "Control Point" window ControlPoints::imgui() just built. + if (session.control_points.is_imgui) + { + if (ImGui::Begin("Control Point", &session.control_points.is_imgui)) + { + ImGui::Separator(); + ImGui::Checkbox("Show all scans (gray)", &cp_show_all_scans); + if (ImGui::IsItemHovered()) + ImGui::SetTooltip("Off: only the active scan. On: all scans as context; CP picking still uses the active scan"); + } + ImGui::End(); + } + } + if (session.ground_control_points.is_imgui) session.ground_control_points.imgui(session.point_clouds_container);