Additional Viewer Enhancements#6423
Conversation
gwen2018
left a comment
There was a problem hiding this comment.
when click on or close to one of the end points of existing segment, it may crash at line 2712 because at that moment selected_points[] may only has one element.
auto dist = selected_points[1].pos - selected_points[0].pos;
may caused by conflict in
if ((pos_2d - win.get_mouse().cursor).length() < 20)
{
dragging_point_index = i;
measurement_point_hovered = true;
if (win.get_mouse().mouse_down && input_ctrl.click_period() > 0.5f)
dragging_measurement_point = true;
}
| dynamic ? GL_DYNAMIC_DRAW : GL_STATIC_DRAW); | ||
| glVertexAttribPointer(attribute, size, GL_FLOAT, GL_FALSE, 0, 0); | ||
| _size = count; | ||
| check_gl_error(); |
There was a problem hiding this comment.
There is no legal note in the file's header
| case GL_INVALID_ENUM: error="INVALID_ENUM"; break; | ||
| case GL_INVALID_VALUE: error="INVALID_VALUE"; break; | ||
| case GL_OUT_OF_MEMORY: error="OUT_OF_MEMORY"; break; | ||
| case GL_INVALID_FRAMEBUFFER_OPERATION: error="INVALID_FRAMEBUFFER_OPERATION"; break; |
|
|
||
| ss << "GL_" << error.c_str() << " - " << file << ":" << line << "\n"; | ||
| err = glGetError(); | ||
| has_errors = true; |
There was a problem hiding this comment.
has_errors will be inconsistent if in the previous line err = GL_NO_ERROR.
Also - all the retrieved values are overwritten by the last one . Is it by design?
| { | ||
| err = glGetError(); | ||
| } | ||
| } No newline at end of file |
|
|
||
| #define check_gl_error() _check_gl_error(__FILE__,__LINE__) | ||
|
|
||
| #define MOUSE_PICK_USE_PBO 1 // use pbo to improve performance, for debug only |
There was a problem hiding this comment.
Should it be leaved in place?
| @@ -0,0 +1,114 @@ | |||
| #include "skybox.h" | |||
|
|
||
| ImGui::PushStyleColor(ImGuiCol_Text, light_grey); | ||
| ImGui::PushStyleColor(ImGuiCol_TextSelectedBg, white); | ||
| // active = show_help_screen; |
There was a problem hiding this comment.
Can the commented code be removed?
|
|
||
| glMatrixMode(GL_PROJECTION); | ||
| glPushMatrix(); | ||
| gluPerspective(45, viewer_rect.w / win.framebuf_height(), 0.001f, 100.0f); |
There was a problem hiding this comment.
In case of T265 100 meter won't be enough imho as you may want to see the whole path
| { | ||
| if (distance < 0.01f) | ||
| { | ||
| label = to_string() << std::fixed << std::setprecision(3) << distance * 1000.f << " mm"; |
| return source.allocate_composite_frame(results); | ||
| if (results.size()) | ||
| return source.allocate_composite_frame(results); | ||
| else return rs2::frame{}; |
There was a problem hiding this comment.
Why not to pass through the input instead of an empty frame?
|
Addressed code review comments and added some extra functionality -
|
gwen2018
left a comment
There was a problem hiding this comment.
very nice additional features multiple segments and area calculation, real useful.
one more potential issue in measurement.cpp line 347, need to check dragging_point_index, in case a single click onto an endpoints.
if (dragging_measurement_point && dragging_point_index >= 0)
ev-mp
left a comment
There was a problem hiding this comment.
I reviewed the latter part and it is good to go, imho.
The FW version conflict should be resolved.
Adding simple distance measurement ability to the 3D view of the Viewer:
