15 #include "udev-rules.h" 22 #define ARCBALL_CAMERA_IMPLEMENTATION 24 #include "../common/utilities/string/trim-newlines.h" 25 #include "../common/utilities/imgui/wrap.h" 32 return std::max(static_cast<T>(0), input);
39 std::vector<rs2::frame> frame_vec;
43 frame_vec.push_back(tex);
44 frame_vec.push_back(
f);
45 auto frame =
s.allocate_composite_frame(frame_vec);
55 int num_of_pose_buttons = 2;
60 bool color_icon = pose_info_object_button.is_pressed();
68 if (
ImGui::Button(pose_info_object_button.get_icon().c_str(), { 24, buttons_heights }))
70 pose_info_object_button.toggle_button();
84 color_icon = trajectory_button.is_pressed();
90 if (
ImGui::Button(trajectory_button.get_icon().c_str(), { 24, buttons_heights }))
92 trajectory_button.toggle_button();
96 streams[
s.second.profile.unique_id()].dev->tm2.record_trajectory(trajectory_button.is_pressed());
121 float x0 = stream_rect.
x + stream_rect.
w / 3;
122 float y0 = stream_rect.
y + stream_rect.
h / 3;
143 for (
auto& exporter : exporters)
148 if (
ImGui::Button(exporter.second.name.c_str(), { w / exporters.size() - 50, 30 }))
152 tab = exporter.first;
162 if (!mesh) use_normals =
false;
166 ImGui::Text(
"Polygon File Format defines a flexible systematic scheme for storing 3D data");
176 ImGui::Text(
" Use faces for meshing by connecting each group of 3 adjacent points");
204 ImGui::Text(
" Calculate vertex normals and add them to the PLY");
210 ImGui::Text(
"Save PLY as binary, or as a larger textual human-readable file");
223 auto curr_exporter = exporters.find(tab);
224 if (curr_exporter == exporters.end())
225 error_message =
"Exporter not implemented";
238 update_configuration();
251 error_message =
"No depth data available";
254 auto curr_exporter = exporters.find(tab);
255 if (curr_exporter == exporters.end())
256 error_message =
"Exporter not implemented";
259 auto model = ppf.get_points();
261 if (selected_tex_source_uid >= 0 &&
streams.find(selected_tex_source_uid) !=
streams.end())
263 tex =
streams[selected_tex_source_uid].texture->get_last_frame(
true);
264 if (tex) ppf.update_texture(tex);
268 if (!
ends_with(
to_lower(fname), curr_exporter->second.extension)) fname += curr_exporter->second.extension;
270 std::unique_ptr<rs2::filter> exporter;
273 auto data = frameset_alloc.process(last_points);
275 for (
auto&
option : curr_exporter->second.options)
296 ImGui::SetTooltip(
"%s",
"Close window without saving any changes to the settings");
313 const char* description,
321 bool hovered =
false;
322 bool clicked =
false;
362 if (hovered && !disabled)
368 if (clicked && !disabled)
370 *status = !(*status);
375 return clicked && !disabled;
385 bool pose_render =
false;
389 if (
s.second.is_stream_visible() &&
398 int selected_depth_source = -1;
399 std::vector<std::string> depth_sources_str;
400 std::vector<int> depth_sources;
402 for (
auto&&
s : streams)
404 if (
s.second.is_stream_visible() &&
407 if (selected_depth_source_uid == -1)
409 if (streams_origin.find(
s.second.profile.unique_id()) != streams_origin.end() &&
410 streams.find(streams_origin[
s.second.profile.unique_id()]) != streams.end())
412 selected_depth_source_uid = streams_origin[
s.second.profile.unique_id()];
415 if (streams_origin.find(
s.second.profile.unique_id()) != streams_origin.end() && streams_origin[
s.second.profile.unique_id()] == selected_depth_source_uid)
417 selected_depth_source =
i;
420 depth_sources.push_back(
s.second.profile.unique_id());
425 depth_sources_str.push_back(
to_string() << dev_name <<
" " << stream_name);
431 int selected_tex_source = 0;
432 std::vector<std::string> tex_sources_str;
433 std::vector<int> tex_sources;
434 std::vector<rs2::stream_profile> tex_profiles;
436 for (
auto&&
s : streams)
438 if (
s.second.is_stream_visible() &&
445 if (selected_tex_source_uid == -1 && selected_depth_source_uid != -1)
447 if (streams_origin.find(
s.second.profile.unique_id()) != streams_origin.end() &&
448 streams.find(streams_origin[
s.second.profile.unique_id()]) != streams.end())
450 selected_tex_source_uid = streams_origin[
s.second.profile.unique_id()];
453 if ((streams_origin.find(
s.second.profile.unique_id()) != streams_origin.end() &&streams_origin[
s.second.profile.unique_id()] == selected_tex_source_uid))
455 selected_tex_source =
i;
459 tex_sources.push_back(streams_origin[
s.second.profile.unique_id()]);
460 tex_profiles.push_back(
s.second.profile);
464 if (
s.second.profile.stream_index())
466 tex_sources_str.push_back(
to_string() << dev_name <<
" " << stream_name);
472 for (
int i = 0; i < tex_sources.size(); i++)
474 auto id = tex_sources[
i];
476 if (
it == last_tex_sources.end())
480 selected_tex_source_uid =
id;
484 last_tex_sources = tex_sources;
486 const auto top_bar_height = 60.f;
505 const auto has_stream = tex_sources_str.size() && depth_sources_str.size();
514 for(
auto&&
s : streams)
515 if (
s.second.dev)
s.second.dev->resume();
524 for(
auto&&
s : streams)
525 if (
s.second.dev)
s.second.dev->pause();
533 bool default_view = (
pos -
float3{ 0.f, 0.f, -1.f }).
length() < 0.001f &&
536 if (
big_button(&active, win, 5 +
left, 0,
u8"\uf01e",
"Reset",
false, !default_view,
"Reset 3D viewport to initial state"))
545 if (synchronization_enable)
549 support_non_syncronized_mode && has_stream,
"Unlock texture data from pointcloud"))
551 synchronization_enable =
false;
558 support_non_syncronized_mode && has_stream,
"Lock pointcloud and texture data together"))
560 synchronization_enable =
true;
566 { cursor.x +
left - 1, cursor.y + top_bar_height - 5 },
ImColor(
grey));
570 const auto source_selection_popup =
"Source Selection";
575 "List of available 3D data sources"))
587 select_3d_source =
true;
590 for (
auto&&
s : streams)
592 if (
s.second.is_stream_visible() &&
593 s.second.texture->get_last_frame() &&
598 bool selected = i == selected_depth_source;
603 selected_depth_source_uid = streams_origin[
s.second.profile.unique_id()];
614 select_3d_source =
false;
623 const auto tex_selection_popup =
"Tex Selection";
627 "List of available texture sources", text_color))
635 select_tex_source =
true;
637 for (
int i = 0; i < tex_sources_str.size(); i++)
641 bool selected = i == selected_tex_source;
646 selected_tex_source_uid = tex_sources[
i];
655 select_tex_source =
false;
661 const auto shader_selection_popup =
"Shading Selection";
663 "Shading",
true,
true,
664 "List of available shading modes"))
672 select_shader_source =
true;
680 selected = selected_shader == shader_type::flat;
683 if (selected) selected_shader = shader_type::flat;
686 selected = selected_shader == shader_type::diffuse;
687 if (
ImGui::MenuItem(
"With Diffuse Lighting",
nullptr, &selected, glsl_available))
689 if (selected) selected_shader = shader_type::diffuse;
696 select_shader_source =
false;
705 { cursor.x +
left - 1, cursor.y + top_bar_height - 5 },
ImColor(
grey));
709 std::string measure_tooltip =
"Measure distance between points";
710 if (!glsl_available) measure_tooltip +=
"\nRequires GLSL acceleration!";
711 if (_measurements.is_enabled())
716 _measurements.disable();
724 _measurements.enable();
731 active = trajectory_button.is_pressed();
733 "Route",
false, pose_render,
"Show 6-dof Pose Trajectory\nRequires T265 tracking device"))
735 trajectory_button.toggle_button();
736 for (
auto&&
s : streams)
739 streams[
s.second.profile.unique_id()].dev->tm2.record_trajectory(trajectory_button.is_pressed());
748 set_export_popup(large_font,
font, stream_rect, error_message, temp_cfg);
772 const std::string udev_rules_man(
"/etc/udev/rules.d/99-realsense-libusb.rules");
773 const std::string udev_rules_deb(
"/lib/udev/rules.d/60-librealsense2-udev-rules.rules");
774 std::ifstream f_man(udev_rules_man);
775 std::ifstream f_deb(udev_rules_deb);
777 std::string message =
"UDEV-Rules permissions configuration \n for RealSense devices.`\n" 778 "Missing/outdated UDEV-Rules will cause 'Permissions Denied' errors\nunless the application is running under 'sudo' (not recommended)\n" 779 "In case of Debians use: \n" 780 "sudo apt-get upgrade/install librealsense2-udev-rules\n" 781 "To manually install UDEV-Rules in terminal run:\n" 782 "$ sudo cp ~/.99-realsense-libusb.rules /etc/udev/rules.d/99-realsense-libusb.rules && sudo udevadm control --reload-rules && udevadm trigger\n";
784 bool create_file =
false;
786 if(!(f_man.good() || f_deb.good()))
788 message =
"RealSense UDEV-Rules are missing!\n" +
message;
789 auto n = not_model->add_notification({
message,
794 n->enable_complex_dismiss =
true;
795 n->delay_id =
"missing-udev";
796 if (
n->is_delayed())
n->dismiss(
true);
806 std::string duplicates =
"Multiple realsense udev-rules were found! :\n1:" + udev_rules_man
807 +
"\n2: " + udev_rules_deb+
"\nMake sure to remove redundancies!";
808 auto n = not_model->add_notification({ duplicates,
811 n->enable_complex_dismiss =
true;
812 n->delay_id =
"multiple-udev";
813 if (
n->is_delayed())
n->dismiss(
true);
816 udev_fname = udev_rules_man;
822 udev_fname = udev_rules_deb;
826 std::istreambuf_iterator<char>());
829 tmp.erase(tmp.find_last_of(
"\n") + 1);
831 float udev_file_ver{}, built_in_file_ver{};
834 std::regex udev_ver_regex(
"^##Version=(\\d+\\.\\d+)##");
837 if (std::regex_search(udev.begin(), udev.end(), match, udev_ver_regex))
840 if (std::regex_search(str.begin(), str.end(), match, udev_ver_regex))
843 if (built_in_file_ver > udev_file_ver)
846 s <<
"RealSense UDEV-Rules file:\n " << udev_fname <<
"\n is not up-to date! Version " << built_in_file_ver <<
" can be applied\n";
847 auto n = not_model->add_notification({
852 n->enable_complex_dismiss =
true;
853 n->delay_id =
"udev-version";
854 if (
n->is_delayed())
n->dismiss(
true);
862 std::ofstream
out(tmp_filename.c_str());
863 out << realsense_udev_rules;
894 if (version > saved_version)
896 auto n = std::make_shared<version_upgrade_model>(version);
897 not_model->add_notification(
n);
910 _measurements.enable();
913 _measurements.is_metric = [
this]() {
return metric_system; };
927 #ifdef BUILD_EASYLOGGINGPP 955 , frameset_alloc( this )
956 , synchronization_enable( true )
957 , synchronization_enable_prev_state(true)
959 , _support_ir_reflectivity( false )
962 syncer = std::make_shared<syncer_model>();
963 updates = std::make_shared<updates_model>();
980 std::vector<int> streams_to_remove;
983 if (!
kvp.second.is_stream_visible() &&
984 (!
kvp.second.dev || (!
kvp.second.dev->is_paused() && !
kvp.second.dev->streaming)))
990 streams_to_remove.push_back(
kvp.first);
993 for (
auto&&
i : streams_to_remove) {
1057 static std::set<std::string> errors_not_to_show;
1058 static bool dont_show_this_error =
false;
1059 auto simplify_error_message = [](
const std::string&
s) {
1061 return std::regex_replace(
s, e,
"address");
1068 auto simplified_error_message = simplify_error_message(message);
1069 if (errors_not_to_show.count(simplified_error_message))
1079 auto custom_command = [&]()
1094 to_string() <<
"Wrapping of error message text failed!");
1108 if (dont_show_this_error)
1110 errors_not_to_show.insert(simplify_error_message(msg));
1114 dont_show_this_error =
false;
1118 ImGui::Checkbox(
"Don't show this error again", &dont_show_this_error);
1127 std::vector<uint8_t> rv;
1132 rv.resize(file.tellg());
1134 file.seekg(0, std::ios::beg);
1135 file.read((
char*)rv.data(), rv.size());
1146 message << std::endl <<
"Progress: " << (int)(progress * 100.0) <<
" [%]";
1148 auto custom_command = [&]()
1215 text =
to_string() <<
" The requested format " << format <<
" is not supported for rendering ";
1220 for (
int i = 0;
i < text.size();
i++)
1221 to_print += text[(
i + counter) % text.size()];
1240 ImGui::Text(
"Connect a RealSense Camera\nor Add Source");
1249 int top_bar_height,
size_t factor,
1250 const std::set<stream_model*>& active_streams,
1251 std::map<stream_model*, int>& stream_index
1254 std::map<int, rect> results;
1255 if (factor == 0)
return results;
1258 auto complement = ceil((
float)active_streams.size() / factor);
1260 auto cell_width =
static_cast<float>(r.
w / factor);
1261 auto cell_height =
static_cast<float>(r.
h / complement);
1263 auto it = active_streams.begin();
1264 for (
auto x = 0;
x < factor;
x++)
1266 for (
auto y = 0;
y < complement;
y++)
1269 if (
it == active_streams.end())
break;
1271 rect rxy = { r.
x +
x * cell_width, r.
y +
y * cell_height + top_bar_height,
1272 cell_width, cell_height - top_bar_height };
1287 for (
auto&&
kvp : l) res +=
kvp.second.area();
1293 const int top_bar_height = 32;
1295 std::set<stream_model*> active_streams;
1296 std::map<stream_model*, int> stream_index;
1299 if (
stream.second.is_stream_visible())
1301 active_streams.insert(&
stream.second);
1311 std::map<int, rect> results;
1316 r.
w, r.
h - top_bar_height };
1321 for (
size_t f = 1;
f <= active_streams.size();
f++)
1324 active_streams, stream_index);
1337 std::shared_ptr<texture_buffer> texture_frame =
nullptr;
1342 std::map<int, frame> last_frames;
1350 last_frames[
f.get_profile().unique_id()] =
f;
1353 for(
auto&&
f : last_frames)
1354 not_model->output.update_dashboards(
f.second);
1356 for(
auto&&
frame : last_frames)
1362 for (
auto&&
frame : frames)
1394 catch (
const error& ex)
1398 catch (
const std::exception& ex)
1400 error_message = ex.what();
1420 draw_viewport( viewer_rect, window, devices, error_message, texture_frame, p );
1423 static_cast< int >( window.
width() ),
1424 static_cast< int >( window.
height() ),
1431 catch(
const std::exception & e )
1433 error_message = e.what();
1451 target = { 0.0f, 0.0f, 0.0f };
1460 float world_up[3] = { 0.0f, 1.0f, 0.0f };
1463 look.
y * world_up[2] - look.
z * world_up[1],
1464 look.
z * world_up[0] - look.
x * world_up[2],
1465 look.
x * world_up[1] - look.
y * world_up[0],
1468 up.
x = across[1] * look.
z - across[2] * look.
y;
1469 up.
y = across[2] * look.
x - across[0] * look.
z;
1470 up.
z = across[0] * look.
y - across[1] * look.
x;
1481 const rect& stream_rect,
1482 std::vector<rgb_per_distance> rgb_per_distance_vec,
1486 if (rgb_per_distance_vec.empty() || (ruler_length <= 0.f))
1489 ruler_length = std::ceil(ruler_length);
1495 const auto stream_height = stream_rect.
y + stream_rect.
h;
1496 const auto stream_width = stream_rect.
x + stream_rect.
w;
1498 static const auto ruler_distance_offset = 10;
1499 auto bottom_y_ruler = stream_height - ruler_distance_offset;
1500 if (s_model.
texture->zoom_preview)
1502 bottom_y_ruler = s_model.
texture->curr_preview_rect.y - ruler_distance_offset;
1505 static const auto top_y_offset = 50;
1506 auto top_y_ruler = stream_rect.
y + top_y_offset;
1512 static const auto left_x_colored_ruler_offset = 50;
1513 static const auto colored_ruler_width = 20;
1514 const auto left_x_colored_ruler = stream_width - left_x_colored_ruler_offset;
1515 const auto right_x_colored_ruler = stream_width - (left_x_colored_ruler_offset - colored_ruler_width);
1516 assert((bottom_y_ruler - top_y_ruler) != 0.
f);
1517 const auto ratio = (bottom_y_ruler - top_y_ruler) / ruler_length;
1520 float y_ruler_val = top_y_ruler;
1521 static const auto numbered_ruler_width = 20.f;
1523 const auto right_x_numbered_ruler = right_x_colored_ruler + numbered_ruler_width;
1524 static const auto hovered_numbered_ruler_opac = 0.8f;
1525 static const auto unhovered_numbered_ruler_opac = 0.6f;
1526 float colored_ruler_opac = unhovered_numbered_ruler_opac;
1527 float numbered_ruler_background_opac = unhovered_numbered_ruler_opac;
1528 bool is_ruler_hovered =
false;
1529 if (mouse.
cursor.
x >= left_x_colored_ruler &&
1530 mouse.
cursor.
x <= right_x_numbered_ruler &&
1531 mouse.
cursor.
y >= top_y_ruler &&
1532 mouse.
cursor.
y <= bottom_y_ruler)
1533 is_ruler_hovered =
true;
1535 if (is_ruler_hovered)
1537 std::stringstream ss;
1539 auto y = (bottom_y_ruler - top_y_ruler) - relative_mouse_y;
1540 ss << std::fixed << std::setprecision(2) << (
y / ratio) << ruler_units;
1542 colored_ruler_opac = 1.f;
1543 numbered_ruler_background_opac = hovered_numbered_ruler_opac;
1549 glColor4f(0.0, 0.0, 0.0, numbered_ruler_background_opac);
1551 glVertex2f(right_x_colored_ruler, top_y_ruler);
1552 glVertex2f(right_x_numbered_ruler , top_y_ruler);
1553 glVertex2f(right_x_numbered_ruler , bottom_y_ruler);
1554 glVertex2f(right_x_colored_ruler, bottom_y_ruler);
1558 const float x_ruler_val = right_x_colored_ruler + 4.0f;
1562 const auto skip_numbers = ((ruler_length / 10.f) - 1.
f);
1563 auto to_skip = (skip_numbers < 0.f)?0.
f: skip_numbers;
1564 for (
int i = static_cast<int>(ruler_length - 1);
i > 0; --
i)
1566 y_ruler_val += ((bottom_y_ruler - top_y_ruler) / ruler_length);
1568 if (((to_skip--) > 0))
1572 to_skip = skip_numbers;
1574 y_ruler_val += ((bottom_y_ruler - top_y_ruler) / ruler_length);
1578 auto total_depth_scale = rgb_per_distance_vec.back().depth_val - rgb_per_distance_vec.front().depth_val;
1579 static const auto sensitivity_factor = 0.01f;
1580 auto sensitivity = sensitivity_factor * total_depth_scale;
1583 auto last_y = bottom_y_ruler;
1584 auto last_depth_value = 0.f;
1585 size_t last_index = 0;
1586 for (
size_t i = 1;
i < rgb_per_distance_vec.size(); ++
i)
1588 auto curr_depth = rgb_per_distance_vec[
i].depth_val;
1589 if ((((curr_depth - last_depth_value) < sensitivity) && (
i != rgb_per_distance_vec.size() - 1)))
1595 glColor4f(rgb_per_distance_vec[last_index].rgb_val.r / 255.f,
1596 rgb_per_distance_vec[last_index].rgb_val.g / 255.f,
1597 rgb_per_distance_vec[last_index].rgb_val.b / 255.f,
1598 colored_ruler_opac);
1602 last_depth_value = curr_depth;
1605 auto y = bottom_y_ruler - ((rgb_per_distance_vec[
i].depth_val) * ratio);
1606 if ((
i == (rgb_per_distance_vec.size() - 1)) || (std::ceil(curr_depth) > ruler_length))
1609 glColor4f(rgb_per_distance_vec[
i].rgb_val.r / 255.f,
1610 rgb_per_distance_vec[
i].rgb_val.g / 255.f,
1611 rgb_per_distance_vec[
i].rgb_val.b / 255.f,
1612 colored_ruler_opac);
1621 static const auto top_line_offset = 0.5f;
1622 static const auto right_line_offset = top_line_offset / 2;
1623 glColor4f(0.0, 0.0, 0.0, colored_ruler_opac);
1625 glVertex2f(left_x_colored_ruler - top_line_offset, top_y_ruler - top_line_offset);
1626 glVertex2f(right_x_numbered_ruler + right_line_offset / 2, top_y_ruler - top_line_offset);
1627 glVertex2f(right_x_numbered_ruler + right_line_offset / 2, bottom_y_ruler + top_line_offset);
1628 glVertex2f(left_x_colored_ruler - top_line_offset, bottom_y_ruler + top_line_offset);
1634 assert(!distances.empty());
1636 float mean = std::accumulate(distances.begin(),
1637 distances.end(), 0.0f) / distances.size();
1640 float inverse = 1.f / distances.size();
1641 for (
auto elem : distances)
1643 e +=
static_cast<float>(pow(elem - mean, 2));
1646 auto standard_deviation = sqrt(inverse * e);
1647 static const auto length_jump = 4.f;
1648 return std::ceil((mean + 1.5
f * standard_deviation) / length_jump) * length_jump;
1657 static bool icon_visible =
false;
1658 if (every_sec) icon_visible = !icon_visible;
1659 float alpha = icon_visible ? 1.f : 0.2f;
1668 if ((layout.size() == 0) && (dev_model_num > 0))
1670 show_no_stream_overlay(font2, static_cast<int>(view_rect.
x), static_cast<int>(view_rect.
y), static_cast<int>(win.
width()), static_cast<int>(win.
height() - output_height));
1672 for (
auto &&
kvp : layout)
1674 auto&& view_rect =
kvp.second;
1677 auto&& stream_size = stream_mv.size;
1680 stream_mv.show_frame(stream_rect, mouse, error_message);
1682 auto p = stream_mv.dev->dev.as<
playback>();
1683 float posX = stream_rect.x + 9;
1684 float posY = stream_rect.y - 26;
1686 if (!stream_mv.is_stream_alive())
1689 show_icon(font2,
"warning_icon", message.c_str(),
1690 static_cast<int>(stream_rect.center().x - 100),
1691 static_cast<int>(stream_rect.center().y - 25),
1692 stream_mv.profile.unique_id(),
1694 "Did not receive frames from the platform within a reasonable time window,\nplease try reducing the FPS or the resolution");
1697 stream_mv.show_stream_header(font1, stream_rect, *
this);
1698 stream_mv.show_stream_footer(font1, stream_rect, mouse,
streams, *
this);
1704 static_cast<int>(stream_rect.h), stream_mv.profile.format());
1707 if (stream_mv.dev->_is_being_recorded)
1713 show_paused_icon(font2, static_cast<int>(posX), static_cast<int>(posY), stream_mv.profile.unique_id());
1715 auto stream_type = stream_mv.profile.stream_type();
1718 switch (stream_type)
1727 auto axis = motion.get_motion_data();
1728 stream_mv.show_stream_imu(font1, stream_rect,
axis, mouse);
1739 auto pose_data =
pose.get_pose_data();
1741 stream_mv.show_stream_pose(font1,
1742 stream_rect, pose_data,
1743 stream_type, (*this).fullscreen, 30.0f, *
this);
1754 static std::vector< std::pair< ImColor, bool > >
colors =
1763 typedef size_t ColorIdx;
1764 static std::map< size_t, ColorIdx > id2color;
1769 ColorIdx &
color = id2color[
object.id];
1770 if( color <
int( colors.size() ))
1773 return colors[
color].first;
1776 for(
auto &
p : colors )
1778 bool & in_use =
p.second;
1791 return colors[0].first;
1795 auto p_objects = stream_mv.dev->detected_objects;
1796 std::lock_guard< std::mutex >
lock( p_objects->mutex );
1799 for(
auto it = id2color.begin();
it != id2color.end(); )
1801 size_t id =
it->first;
1805 if(
object.
id ==
id )
1813 colors[
it->second].second =
false;
1814 auto it_to_erase =
it++;
1815 id2color.erase( it_to_erase );
1827 ?
object.normalized_depth_bbox
1828 :
object.normalized_color_bbox;
1832 float const max_depth = 2.f;
1833 float const min_depth = 0.8f;
1834 float const depth_range = max_depth - min_depth;
1835 float usable_depth =
std::min(
object.mean_depth, max_depth );
1836 float a = 0.75f * (max_depth - usable_depth) / depth_range + 0.25
f;
1843 if( fabs(
object.mean_depth) > 0.
f )
1850 { bbox.
x + 1, bbox.
y + 1 },
1851 { bbox.
x +
size.x + 20, bbox.
y +
size.y + 6 },
1858 if( !
object.
name.empty() )
1864 { bbox.
x + bbox.
w -
size.x - 20, bbox.
y + bbox.
h -
size.y - 6 },
1865 { bbox.
x + bbox.
w - 1, bbox.
y + bbox.
h - 1 },
1876 auto frame_color = get_color(
object );
1877 glColor3f( a * frame_color.Value.x, a * frame_color.Value.y, a * frame_color.Value.z );
1883 stream_rect.y -= 32;
1884 stream_rect.h += 32;
1897 float ruler_length = 0.f;
1902 auto textured_depth_data =
static_cast<const uint8_t*
>(textured_frame.
get_data());
1903 static const auto skip_pixels_factor = 30;
1904 std::vector<rgb_per_distance> rgb_per_distance_vec;
1905 std::vector<float> distances;
1910 auto depth_index =
i*depth_width +
j;
1911 auto length = depth_data[depth_index] * stream_mv.dev->depth_units;
1914 auto textured_depth_index = depth_index * 3;
1915 auto r = textured_depth_data[textured_depth_index];
1916 auto g = textured_depth_data[textured_depth_index + 1];
1917 auto b = textured_depth_data[textured_depth_index + 2];
1918 rgb_per_distance_vec.push_back({
length, {
r,
g,
b } });
1919 distances.push_back(
length);
1924 if (!distances.empty())
1937 auto top_bar_height = 60.f;
2000 for (
auto&&
r : rects)
2002 for (
int i = 0;
i < 4;
i++)
2004 auto j = (
i + 1) % 4;
2015 auto x =
static_cast<float>(-M_PI / 2);
2018 { 0,
static_cast<float>(cos(
x)), static_cast<float>(-sin(
x)), 0 },
2019 { 0,
static_cast<float>(sin(
x)), static_cast<float>(cos(
x)), 0 },
2022 static const double z = M_PI;
2023 static float _rz[4][4] = {
2024 { float(cos(z)), float(-sin(z)),0, 0 },
2025 { float(sin(z)), float(cos(z)), 0, 0 },
2038 auto f =
stream.second.texture->get_last_frame();
2049 t.to_column_major((
float*)model);
2101 auto T = tiles * 0.5f;
2105 for (
int i = 0;
i <= ceil(tiles);
i++)
2149 for (
float d = 1;
d < 6;
d += 2)
2151 auto get_point = [&](
float x,
float y) ->
float3 2158 return{ point[0], point[1], point[2] };
2161 auto top_left = get_point(0, 0);
2162 auto top_right = get_point(static_cast<float>(
intrin.
width), 0);
2164 auto bottom_left = get_point(0, static_cast<float>(
intrin.
height));
2183 glPointSize(std::sqrt(viewer_rect.
w / vf_profile.width()));
2200 auto viewport_rect = viewer_rect;
2203 auto scaled_cursor = cursor;
2206 if (viewport_rect.contains(scaled_cursor))
2238 auto x1x0 =
p -
pos;
2239 auto t = (x1x2 * x1x0) / (x1x2 * x1x2);
2240 auto p1 = pos + x1x2*
t;
2247 pos =
lerp(
p, pos, 0.9f);
2360 static bool settings_open =
false;
2404 auto settings =
"Settings";
2405 auto about =
"About";
2406 bool open_settings_popup =
false;
2407 bool open_about_popup =
false;
2414 settings_open =
true;
2423 open_url(
"https://store.intelrealsense.com/");
2428 open_settings_popup =
true;
2435 open_about_popup =
true;
2442 settings_open =
false;
2446 static bool reload_required =
false;
2447 static bool refresh_required =
false;
2448 static bool refresh_updates =
false;
2452 if (open_settings_popup)
2456 reload_required =
false;
2457 refresh_required =
false;
2462 float w = window.
width() * 0.6f;
2463 float h = window.
height() * 0.6f;
2464 float x0 = window.
width() * 0.2f;
2544 recording_setting = 0;
2549 recording_setting = 1;
2554 static char path[256];
2555 memset(path, 0, 256);
2557 memcpy(path, path_str.c_str(),
std::min(255, (
int)path_str.size()));
2569 if (
ImGui::RadioButton(
"Always Compress (might cause frame drops)", recording_compression == 0))
2571 recording_compression = 0;
2574 if (
ImGui::RadioButton(
"Never Compress (larger .bag file size)", recording_compression == 1))
2576 recording_compression = 1;
2581 recording_compression = 2;
2591 ImGui::SetTooltip(
"Increased font samples produce nicer text, but require more GPU memory, sometimes resulting in boxes instead of font characters");
2596 reload_required =
true;
2601 #ifndef __APPLE__ // Not available at the moment on Mac 2605 refresh_required =
true;
2609 ImGui::SetTooltip(
"Using OpenGL 3 shaders is a widely supported way to boost rendering speeds on modern GPUs.");
2614 refresh_required =
true;
2618 ImGui::SetTooltip(
"Using OpenGL 3 shaders for depth data processing can reduce CPU utilisation.");
2620 if (gpu_processing && !gpu_rendering)
2623 ImGui::Text(
u8"\uf071 Using GLSL for processing but not for rendering can reduce CPU utilisation, but is likely to hurt overall performance!");
2628 if (
ImGui::Checkbox(
"Enable Multisample Anti-Aliasing (MSAA)", &msaa))
2630 reload_required =
true;
2634 ImGui::SetTooltip(
"MSAA will improve the rendering quality of edges at expense of greater GPU memory utilisation.");
2643 reload_required =
true;
2650 if (
ImGui::Checkbox(
"Show Application FPS (rendering FPS)", &show_fps))
2652 reload_required =
true;
2656 ImGui::SetTooltip(
"Show application refresh rate in window title\nThis rate is unrelated to camera FPS and measures application responsivness");
2662 reload_required =
true;
2666 ImGui::SetTooltip(
"Vertical sync will try to synchronize application framerate to the monitor refresh-rate (usually limiting the framerate to 60)");
2671 reload_required =
true;
2681 ImGui::SetTooltip(
"When enabled, this option provides background to the 3D view, instead of leaving it blank.\nThis is purely cosmetic");
2684 if (
ImGui::Checkbox(
"Perform Occlusion Invalidation", &enable_occlusion_invalidation))
2689 ImGui::SetTooltip(
"Occlusions are a natural side-effect of having multiple sensors\nWhen this option is enabled, the SDK will filter out occluded pixels");
2698 std::vector<std::string> unit_systems;
2699 unit_systems.push_back(
"Imperial System");
2700 unit_systems.push_back(
"Metric System");
2703 if (
draw_combo_box(
"##units_system", unit_systems, metric_system))
2711 ImGui::Text(
"librealsense has built-in logging capabilities.");
2712 ImGui::Text(
"Logs may contain API calls, timing of frames, OS error messages and file-system links, but no actual frame content.");
2715 if (
ImGui::Checkbox(
"Output librealsense log to console", &log_to_console))
2728 static char logpath[256];
2729 memset(logpath, 0, 256);
2731 memcpy(logpath, path_str.c_str(),
std::min(255, (
int)path_str.size()));
2739 if (log_to_console || log_to_file)
2764 static char logpath[256];
2765 memset(logpath, 0, 256);
2767 memcpy(logpath, path_str.c_str(),
std::min(255, (
int)path_str.size()));
2779 static char logpath[256];
2780 memset(logpath, 0, 256);
2782 memcpy(logpath, path_str.c_str(),
std::min(255, (
int)path_str.size()));
2793 ImGui::Text(
"RealSense tools settings capture the state of UI, and not of the hardware:");
2797 reload_required =
true;
2810 if (!
ends_with(filename,
".json")) filename +=
".json";
2811 temp_cfg.
save(filename.c_str());
2826 reload_required =
true;
2836 if (
ImGui::Checkbox(
"Recommend Bundled Firmware", &recommend_fw_updates))
2839 refresh_updates =
true;
2843 ImGui::SetTooltip(
"%s",
"When firmware of the device is below the version bundled with this software release\nsuggest firmware update");
2845 #ifdef CHECK_FOR_UPDATES 2851 ImGui::SetTooltip(
"%s",
"Select the server URL of the SW/FW updates information");
2856 static char custom_url[256] = { 0 };
2858 memcpy(custom_url, url_str.c_str(),
std::min(255, (
int)url_str.size()));
2861 official_url =
true;
2868 official_url =
false;
2879 url_str = custom_url;
2897 if (reload_required)
2900 ImGui::Text(
u8"\uf071 The application will be restarted in order for new settings to take effect");
2909 if (reload_required) window.
reload();
2910 else if (refresh_required) window.
refresh();
2913 if (refresh_updates)
2914 for (
auto&&
dev : devices)
2915 dev->refresh_notifications(*
this);
2949 ImGui::SetTooltip(
"%s",
"Close window without saving any changes to the settings");
2959 if (open_about_popup)
2985 ImVec2(w - 30, 100), {0.20f, 0.38f}, {0.80f, 0.56f});
2988 ImGui::Text(
"Intel RealSense is a suite of depth-sensing and motion-tracking technologies.");
2990 ImGui::Text(
"librealsense is an open-source cross-platform SDK for working with RealSense devices.");
2994 ImGui::Text(
"github.com/IntelRealSense/librealsense.");
3000 ImGui::Text(
"RealSense is a registered trademark of Intel Corporation.");
3019 hyperlink(window,
"Intel RealSense",
"https://realsense.intel.com/");
3022 hyperlink(window,
"github.com/IntelRealSense/librealsense",
"https://github.com/IntelRealSense/librealsense/");
3026 hyperlink(window,
"Apache License, Version 2.0",
"https://raw.githubusercontent.com/IntelRealSense/librealsense/master/LICENSE");
3068 const rect& viewer_rect,
bool force)
3076 auto sec_since_update = std::chrono::duration<float, std::milli>(
now - view_clock).
count() / 1000;
3080 up = { 0.f, -1.f, 0.f };
3084 auto step = sec_since_update * 0.3f;
3088 pos = pos +
dir * step;
3093 pos = pos -
dir * step;
3098 pos = pos + x_axis * step;
3103 pos = pos - x_axis * step;
3123 const auto MAX_MOUSE_JUMP = 200;
3124 const auto SCROLL_SLOW_MAX_TIME_MS = 50;
3125 const auto SCROLL_FAST_MIN_TIME_MS = 500;
3126 float zoom_per_tick = 0.2f;
3131 auto delta_scroll_time = std::chrono::duration_cast<std::chrono::milliseconds>(scroll_time - prev_scroll_time).
count();
3132 prev_scroll_time = scroll_time;
3135 if (delta_scroll_time < SCROLL_SLOW_MAX_TIME_MS)
3136 zoom_per_tick *= 2.f;
3137 else if (delta_scroll_time > SCROLL_FAST_MIN_TIME_MS)
3138 zoom_per_tick *= 0.5f;
3142 if (std::abs(cx -
px) < MAX_MOUSE_JUMP &&
3143 std::abs(cy - py) < MAX_MOUSE_JUMP )
3150 static_cast<int>(viewer_rect.
w), static_cast<int>(viewer_rect.
h),
3151 static_cast<int>(
px), static_cast<int>(cx),
3152 static_cast<int>(py), static_cast<int>(cy),
3173 auto rect = viewer_rect;
3198 if (startx >
rect.
w)
3212 if (starty >
rect.
h)
3257 std::vector<rs2::frame>
res;
3260 for (
auto&&
f :
set)
3264 res.push_back(frame);
3310 auto index =
f.get_profile().unique_id();
3315 else return nullptr;
3325 static bool first =
true;
3355 auto rect_copy = viewer_rect;
3371 s.second.dev->resume();
3372 if (
auto p =
s.second.dev->dev.as<
playback>())
3385 s.second.dev->pause();
3412 auto ms = duration_cast<milliseconds>(diff).
count();
3413 auto t =
smoothstep(static_cast<float>(ms), 0, 100);
3415 std::map<int, rect> results;
3416 for (
auto&&
kvp : l)
viewer_model(context &ctx_)
float smoothstep(float x, float min, float max)
float3 cross(const float3 &a, const float3 &b)
static const auto OPTION_IGNORE_COLOR
static const textual_icon lock
IMGUI_API void PushStyleVar(ImGuiStyleVar idx, float val)
int selected_tex_source_uid
frame apply_filter(filter_interface &filter)
static const ImVec4 transparent
float lerp(float a, float b, float t)
GLenum GLuint GLenum GLsizei const GLchar * message
rs2::gl::pointcloud_renderer _pc_renderer
GLuint get_gl_handle() const
IMGUI_API void Image(ImTextureID user_texture_id, const ImVec2 &size, const ImVec2 &uv0=ImVec2(0, 0), const ImVec2 &uv1=ImVec2(1, 1), const ImVec4 &tint_col=ImVec4(1, 1, 1, 1), const ImVec4 &border_col=ImVec4(0, 0, 0, 0))
static const ImVec4 white
static const textual_icon floppy
IMGUI_API void AddRectFilled(const ImVec2 &a, const ImVec2 &b, ImU32 col, float rounding=0.0f, int rounding_corners=0x0F)
float stof(const std::string &value)
IMGUI_API bool IsKeyPressed(int key_index, bool repeat=true)
streams_layout _old_layout
GLboolean GLboolean GLboolean b
void draw_color_ruler(const mouse_info &mouse, const stream_model &s_model, const rect &stream_rect, std::vector< rgb_per_distance > rgb_per_distance_vec, float ruler_length, const std::string &ruler_units)
static const ImVec4 light_red
IMGUI_API bool RadioButton(const char *label, bool active)
static const textual_icon circle
IMGUI_API ImVec2 GetCursorPos()
rs2::frame handle_ready_frames(const rect &viewer_rect, ux_window &window, int devices, std::string &error_message)
static matrix4 identity()
static const char * is_measuring
std::map< int, int > streams_origin
IMGUI_API void SetTooltip(const char *fmt,...) IM_PRINTFARGS(1)
std::string to_lower(std::string x)
static const textual_icon unlock
GLuint const GLchar * name
static const ImVec4 almost_white_bg
IMGUI_API float GetFontSize()
static const ImVec4 header_window_bg
int rs2_get_api_version(rs2_error **error)
static const auto OPTION_PICKED_ID
std::map< int, rect > calc_layout(const rect &r)
static const auto OPTION_ORIGIN_PICKED
ImVec4 from_rgba(uint8_t r, uint8_t g, uint8_t b, uint8_t a, bool consistent_color)
IMGUI_API void ProgressBar(float fraction, const ImVec2 &size_arg=ImVec2(-1, 0), const char *overlay=NULL)
static export_model make_exporter(std::string name, std::string extension, T(&filters_str)[sz])
rs2_option
Defines general configuration controls. These can generally be mapped to camera UVC controls...
std::atomic< bool > depth_stream_active
static const auto OPTION_NORMAL_X
IMGUI_API bool InputTextMultiline(const char *label, char *buf, size_t buf_size, const ImVec2 &size=ImVec2(0, 0), ImGuiInputTextFlags flags=0, ImGuiTextEditCallback callback=NULL, void *user_data=NULL)
static const auto OPTION_MOUSE_Y
IMGUI_API void SetCursorPos(const ImVec2 &local_pos)
static const auto OPTION_NORMAL_Y
void popup_firmware_update_progress(const ux_window &window, const float progress)
#define ImGui_ScopePushFont(f)
static const ImVec4 light_grey
std::vector< uint8_t > read_fw_file(std::string file_path)
static config_file & instance()
constexpr const char * server_versions_db_url
static const char * commands_xml
void draw_rect(const rect &r, int line_width)
static const ImVec4 light_blue
GLsizei const GLchar *const * path
std::enable_if< std::is_base_of< rs2::frame, T >::value, bool >::type poll_for_frame(T *output) const
float get_output_height() const
stream_profile get_profile() const
std::map< int, stream_model > streams
void render_pose(rs2::rect stream_rect, float buttons_heights)
std::unordered_set< int > _hidden_options
IMGUI_API void SetNextWindowPos(const ImVec2 &pos, ImGuiSetCond cond=0)
void update_input(ux_window &win, const rs2::rect &viewer_rect)
std::shared_ptr< texture_buffer > texture
static const char * log_to_file
std::string get_folder_path(special_folder f)
void reset_camera(float3 pos={0.0f, 0.0f,-1.0f})
rs2::frame_queue resulting_queue
static const auto OPTION_NORMAL_Z
const void * get_data() const
frame get_3d_texture_source(frame f)
static const auto OPTION_PICKED_Y
void hyperlink(ux_window &window, const char *title, const char *link)
GLdouble GLdouble GLdouble w
GLsizei const GLchar *const * string
std::vector< plane_3d > subdivide(const plane_3d &rect, int parts=4)
std_msgs::Header * header(M &m)
returns Header<M>::pointer(m);
static const char * log_filename
std::array< point3d, 4 > object
IMGUI_API bool IsWindowHovered()
GLfloat GLfloat GLfloat GLfloat h
rect unnormalize(const rect &unnormalize_to) const
void show_no_device_overlay(ImFont *font, int min_x, int min_y)
static const char * hwlogger_xml
IMGUI_API void AddLine(const ImVec2 &a, const ImVec2 &b, ImU32 col, float thickness=1.0f)
void sort(sort_type m_sort_type, const std::string &in, const std::string &out)
IMGUI_API bool InputText(const char *label, char *buf, size_t buf_size, ImGuiInputTextFlags flags=0, ImGuiTextEditCallback callback=NULL, void *user_data=NULL)
void hide_common_options()
float evaluate_layout(const std::map< int, rect > &l)
rs2_pose get_pose_data() const
rs2::gl::camera_renderer _cam_renderer
void update_3d_camera(ux_window &win, const rect &viewer_rect, bool force=false)
bool ends_with(const std::string &s, const std::string &suffix)
frame get_3d_depth_source(frame f)
IMGUI_API bool SliderInt(const char *label, int *v, int v_min, int v_max, const char *display_format="%.0f", bool render_bg=false)
::realsense_legacy_msgs::pose_< std::allocator< void > > pose
void set_matrix(rs2_gl_matrix_type type, float *m4x4)
std::chrono::high_resolution_clock::time_point _transition_start_time
#define GL_TEXTURE_WRAP_T
bool is_valid(const plane_3d &p)
status
Defines return codes that SDK interfaces use. Negative values indicate errors, a zero value indicates...
std::shared_ptr< notifications_model > not_model
bool directory_exists(const char *dir)
bool manipulating() const
GLboolean GLboolean GLboolean GLboolean a
ImFont * get_font() const
std::shared_ptr< texture_buffer > get_last_texture()
IMGUI_API ImVec2 GetMousePos()
void open_issue(std::string body)
T get_or_default(const char *key, T def) const
float calculate_ruler_max_distance(const std::vector< float > &distances) const
static const auto OPTION_PICKED_Z
static const auto OPTION_PLY_NORMALS
static const char * log_to_console
IMGUI_API bool BeginPopup(const char *str_id)
IMGUI_API void SameLine(float pos_x=0.0f, float spacing_w=-1.0f)
std::string error_to_string(const error &e)
bool draw_combo_box(const std::string &id, const std::vector< std::string > &device_names, int &new_index)
std::map< int, rect > get_interpolated_layout(const std::map< int, rect > &l)
std::map< int, rect > generate_layout(const rect &r, int top_bar_height, size_t factor, const std::set< stream_model * > &active_streams, std::map< stream_model *, int > &stream_index)
void show_no_stream_overlay(ImFont *font, int min_x, int min_y, int max_x, int max_y)
GLfloat GLfloat GLfloat alpha
IMGUI_API ImDrawList * GetWindowDrawList()
static const char * metric_system
IMGUI_API bool Begin(const char *name, bool *p_open=NULL, ImGuiWindowFlags flags=0)
IMGUI_API void PopStyleVar(int count=1)
IMGUI_API ImVec2 CalcTextSize(const char *text, const char *text_end=NULL, bool hide_text_after_double_hash=false, float wrap_width=-1.0f)
void set_matrix(rs2_gl_matrix_type type, float *m4x4)
static const float FEET_TO_METER
static void rs2_deproject_pixel_to_point(float point[3], const struct rs2_intrinsics *intrin, const float pixel[2], float depth)
#define GL_COLOR_BUFFER_BIT
static const char * show_stream_details
static const char * continue_with_current_fw
static const ImVec4 regular_blue
void show_popup(const ux_window &window, const popup &p)
GLint texture_border_mode
IMGUI_API void TextUnformatted(const char *text, const char *text_end=NULL)
static const textual_icon play
void open_url(const char *url)
float framebuf_width() const
std::string get(const char *key, const char *def) const
#define GL_PROJECTION_MATRIX
bool is_option_skipped(rs2_option opt) const
void render(rs2::float3 cam_position)
IMGUI_API ImGuiIO & GetIO()
float single_wave(float x)
static const char * sw_updates_url
IMGUI_API void SetNextWindowSize(const ImVec2 &size, ImGuiSetCond cond=0)
std::shared_ptr< texture_buffer > upload_frame(frame &&f)
GLint GLint GLsizei GLint GLenum format
void set_export_popup(ImFont *large_font, ImFont *font, rect stream_rect, std::string &error_message, config_file &temp_cfg)
static const char * compression_mode
static const ImVec4 sensor_bg
std::function< void()> on_reload_complete
std::string trim_newlines(std::string text)
frameset_allocator(viewer_model *viewer)
stream_model * selected_stream
void export_frame(const std::string &fname, std::unique_ptr< rs2::filter > exporter, notifications_model &ns, frame data, bool notify)
unsigned __int64 uint64_t
IMGUI_API void SetCursorPosX(float x)
GLenum GLenum GLsizei const GLuint GLboolean enabled
void mouse_pick(ux_window &win, float3 picked, float3 normal)
std::shared_ptr< updates_model > updates
static const auto OPTION_FILLED
static const char * use_normals
rect grow(int pixels) const
static const ImVec4 sensor_header_light_blue
IMGUI_API void PushItemWidth(float item_width)
IMGUI_API void Text(const char *fmt,...) IM_PRINTFARGS(1)
#define RS2_API_BUILD_VERSION
IMGUI_API bool Button(const char *label, const ImVec2 &size=ImVec2(0, 0))
rs2_format
A stream's format identifies how binary data is encoded within a frame.
const char * file_dialog_open(file_dialog_mode flags, const char *filters, const char *default_path, const char *default_name)
IMGUI_API void Separator()
void show_paused_icon(ImFont *font, int x, int y, int id)
std::vector< frame > get_frames(frame set)
static const ImVec4 button_color
void begin_stream(std::shared_ptr< subdevice_model > d, rs2::stream_profile p)
bool big_button(bool *status, ux_window &win, int x, int y, const char *icon, const char *label, bool dropdown, bool enabled, const char *description, ImVec4 text_color=light_grey)
std::array< float3, 4 > roi_rect
bool get_hovered_over_input() const
void log_to_file(rs2_log_severity min_severity, const char *file_path=nullptr)
IMGUI_API void EndPopup()
static const ImVec4 header_color
static const ImVec4 dark_red
void show_recording_icon(ImFont *font_18, int x, int y, int id, float alpha_delta)
#define GL_DEPTH_BUFFER_BIT
static void handle(rs2_error *e)
ImVec4 alpha(const ImVec4 &v, float a)
static const auto OPTION_PICKED_X
static const textual_icon exit
static const auto OPTION_SELECTED
#define GL_ONE_MINUS_SRC_ALPHA
static const auto OPTION_SCALE_FACTOR
std::map< export_type, export_model > exporters
IMGUI_API void PushStyleColor(ImGuiCol idx, const ImVec4 &col)
static const auto OPTION_SHADED
static const ImVec4 black
void arcball_camera_update(float eye[3], float target[3], float up[3], float view[16], float delta_time_seconds, float zoom_per_tick, float pan_speed, float rotation_multiplier, int screen_width, int screen_height, int x0, int x1, int y0, int y1, int midclick_held, int rclick_held, int delta_scroll_ticks, unsigned int flags)
measurement _measurements
void show_3dviewer_header(ux_window &window, rs2::rect stream_rect, bool &paused, std::string &error_message)
bool is_rasterizeable(rs2_format format)
IMGUI_API void PushFont(ImFont *font)
post_processing_filters ppf
void save(const char *filename)
static const textual_icon toggle_off
void show_icon(ImFont *font_18, const char *label_str, const char *text, int x, int y, int id, const ImVec4 &color, const std::string &tooltip="")
void log_to_console(rs2_log_severity min_severity)
float framebuf_height() const
T non_negative(const T &input)
rs2_format format() const
static const auto OPTION_MOUSE_PICK
IMGUI_API ImVec2 GetCursorScreenPos()
ImVec4 blend(const ImVec4 &c, float a)
bool val_in_range(const T &val, const std::initializer_list< T > &list)
static const char * is_fullscreen
bool modal_notification_on
void set(const char *key, const char *value)
static const char * settings_tab
void update_configuration()
IMGUI_API void PopItemWidth()
static const char * log_severity
const char * rs2_stream_to_string(rs2_stream stream)
GLsizei GLenum GLenum GLuint GLenum * severities
GLenum GLenum GLenum input
void render_3d_view(const rect &view_rect, ux_window &win, std::shared_ptr< texture_buffer > texture, rs2::points points)
void draw(ux_window &win)
void set_hovered_over_input()
GLuint GLsizei const GLchar * label
const GLuint GLenum const void * binary
#define RS2_API_FULL_VERSION_STR
static const ImVec4 yellowish
IMGUI_API bool MenuItem(const char *label, const char *shortcut=NULL, bool selected=false, bool enabled=true)
static const char * ground_truth_r
#define GLFW_KEY_LEFT_CONTROL
bool contains(const float2 &p) const
IMGUI_API bool BeginPopupModal(const char *name, bool *p_open=NULL, ImGuiWindowFlags extra_flags=0)
IMGUI_API bool Selectable(const char *label, bool selected=false, ImGuiSelectableFlags flags=0, const ImVec2 &size=ImVec2(0, 0))
GLuint GLfloat GLfloat y0
bool is_3d_depth_source(frame f)
IMGUI_API bool Checkbox(const char *label, bool *v)
typename::boost::move_detail::remove_reference< T >::type && move(T &&t) BOOST_NOEXCEPT
std::vector< std::unique_ptr< device_model > > device_models_list
std::string api_version_to_string(int version)
static const char * shading_mode
rect normalize(const rect &normalize_to) const
IMGUI_API void SetCursorScreenPos(const ImVec2 &pos)
static const char * encoding
shader_type selected_shader
static void draw_axes(float axis_size=1.f, float axisWidth=4.f)
texture_buffer & get_splash()
bool is_3d_texture_source(frame f) const
std::map< int, rs2::frame_queue > frames_queue
rect adjust_ratio(float2 size) const
GLenum GLuint GLenum GLsizei length
static const char * sw_updates_official_server
std::vector< popup > _active_popups
int selected_depth_source_uid
std::array< float, 3 > color
std::string wrap(const std::string &text, int wrap_pixels_width)
static const char * is_3d_view
static const char * show_map_ruler
static const textual_icon pause
IMGUI_API ImGuiStyle & GetStyle()
void popup_if_error(const ux_window &window, std::string &error_message)
static const textual_icon exclamation_triangle
temporal_event origin_occluded
IMGUI_API void CloseCurrentPopup()
static const ImVec4 yellow
IMGUI_API bool IsKeyDown(int key_index)
const char * rs2_log_severity_to_string(rs2_log_severity info)
ImFont * get_large_font() const
static const textual_icon measure
void show_rendering_not_supported(ImFont *font_18, int min_x, int min_y, int max_x, int max_y, rs2_format format)
void show_top_bar(ux_window &window, const rect &viewer_rect, const device_models_list &devices)
IMGUI_API void OpenPopup(const char *str_id)
static const char * recommend_updates
float get_scale_factor() const
matrix4 tm2_pose_to_world_transformation(const rs2_pose &pose)
static const auto OPTION_PLY_BINARY
rs2_log_severity
Severity of the librealsense logger.
static const auto OPTION_PLY_MESH
rs2_stream stream_type() const
void set_option(rs2_option option, float value) const
float get_option(rs2_option option) const
#define GL_TEXTURE_WRAP_S
static const char * sdk_version
void show_tooltip(ux_window &win)
static const char * default_path
static const ImVec4 dark_sensor_bg
IMGUI_API bool IsItemHovered()
press_button_model trajectory_button
static const char * file_save_mode
static const auto OPTION_MOUSE_X
std::shared_ptr< texture_buffer > last_texture
const size_t resulting_queue_max_size
GLdouble GLdouble GLint GLint const GLdouble * points
IMGUI_API void PopStyleColor(int count=1)
rs2::mouse_info & get_mouse()
std::string to_string(T value)
void draw_viewport(const rect &viewer_rect, ux_window &window, int devices, std::string &error_message, std::shared_ptr< texture_buffer > texture, rs2::points f=rs2::points())
void render_2d_view(const rect &view_rect, ux_window &win, int output_height, ImFont *font1, ImFont *font2, size_t dev_model_num, const mouse_info &mouse, std::string &error_message)