Skip to content

Commit

Permalink
Merge pull request #4562 from arilowen/DQT-pause-render-fix
Browse files Browse the repository at this point in the history
DQT: fix plane and metric annotations when stream is paused
  • Loading branch information
dorodnic authored Aug 4, 2019
2 parents fdcfd34 + d40592b commit d982a68
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common/viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1509,7 +1509,7 @@ namespace rs2
auto r1 = matrix4::identity();
auto r2 = matrix4::identity();

if (draw_plane)
if (draw_plane && !paused)
{
glPushAttrib(GL_LINE_BIT);
glLineWidth(2);
Expand Down
28 changes: 26 additions & 2 deletions tools/depth-quality/depth-quality-model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ namespace rs2

bool tool_model::draw_instructions(ux_window& win, const rect& viewer_rect, bool& distance, bool& orientation)
{
if (_viewer_model.paused)
return false;

auto plane_fit_found = is_valid(_metrics_model.get_plane());
_metrics_model.set_plane_fit(plane_fit_found);
_roi_located.add_value(plane_fit_found);
Expand Down Expand Up @@ -625,7 +628,18 @@ namespace rs2
ImGui::SetTooltip("Estimated distance to an average within the ROI of the target (wall) in mm");
}
ImGui::SameLine(); ImGui::SetCursorPosX(col1);
ImGui::Text("%.2f mm", _metrics_model.get_last_metrics().distance);

static float prev_metric_distance = 0;
if (_viewer_model.paused)
{
ImGui::Text("%.2f mm", prev_metric_distance);
}
else
{
auto curr_metric_distance = _metrics_model.get_last_metrics().distance;
ImGui::Text("%.2f mm", curr_metric_distance);
prev_metric_distance = curr_metric_distance;
}

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

Expand Down Expand Up @@ -668,7 +682,17 @@ namespace rs2
ImGui::SetTooltip("Estimated angle to the wall in degrees");
}
ImGui::SameLine(); ImGui::SetCursorPosX(col1);
ImGui::Text("%.2f deg", _metrics_model.get_last_metrics().angle);
static float prev_metric_angle = 0;
if (_viewer_model.paused)
{
ImGui::Text("%.2f mm", prev_metric_angle);
}
else
{
auto curr_metric_angle = _metrics_model.get_last_metrics().angle;
ImGui::Text("%.2f mm", curr_metric_angle);
prev_metric_angle = curr_metric_angle;
}

ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 5);
ImGui::TreePop();
Expand Down

0 comments on commit d982a68

Please sign in to comment.