Skip to content

Commit d982a68

Browse files
authored
Merge pull request #4562 from arilowen/DQT-pause-render-fix
DQT: fix plane and metric annotations when stream is paused
2 parents fdcfd34 + d40592b commit d982a68

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

common/viewer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1509,7 +1509,7 @@ namespace rs2
15091509
auto r1 = matrix4::identity();
15101510
auto r2 = matrix4::identity();
15111511

1512-
if (draw_plane)
1512+
if (draw_plane && !paused)
15131513
{
15141514
glPushAttrib(GL_LINE_BIT);
15151515
glLineWidth(2);

tools/depth-quality/depth-quality-model.cpp

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ namespace rs2
162162

163163
bool tool_model::draw_instructions(ux_window& win, const rect& viewer_rect, bool& distance, bool& orientation)
164164
{
165+
if (_viewer_model.paused)
166+
return false;
167+
165168
auto plane_fit_found = is_valid(_metrics_model.get_plane());
166169
_metrics_model.set_plane_fit(plane_fit_found);
167170
_roi_located.add_value(plane_fit_found);
@@ -625,7 +628,18 @@ namespace rs2
625628
ImGui::SetTooltip("Estimated distance to an average within the ROI of the target (wall) in mm");
626629
}
627630
ImGui::SameLine(); ImGui::SetCursorPosX(col1);
628-
ImGui::Text("%.2f mm", _metrics_model.get_last_metrics().distance);
631+
632+
static float prev_metric_distance = 0;
633+
if (_viewer_model.paused)
634+
{
635+
ImGui::Text("%.2f mm", prev_metric_distance);
636+
}
637+
else
638+
{
639+
auto curr_metric_distance = _metrics_model.get_last_metrics().distance;
640+
ImGui::Text("%.2f mm", curr_metric_distance);
641+
prev_metric_distance = curr_metric_distance;
642+
}
629643

630644
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 5);
631645

@@ -668,7 +682,17 @@ namespace rs2
668682
ImGui::SetTooltip("Estimated angle to the wall in degrees");
669683
}
670684
ImGui::SameLine(); ImGui::SetCursorPosX(col1);
671-
ImGui::Text("%.2f deg", _metrics_model.get_last_metrics().angle);
685+
static float prev_metric_angle = 0;
686+
if (_viewer_model.paused)
687+
{
688+
ImGui::Text("%.2f mm", prev_metric_angle);
689+
}
690+
else
691+
{
692+
auto curr_metric_angle = _metrics_model.get_last_metrics().angle;
693+
ImGui::Text("%.2f mm", curr_metric_angle);
694+
prev_metric_angle = curr_metric_angle;
695+
}
672696

673697
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 5);
674698
ImGui::TreePop();

0 commit comments

Comments
 (0)