model-views.h
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2017 Intel Corporation. All Rights Reserved.
3 
4 #pragma once
5 #include <librealsense2/rs.hpp>
6 
7 #include "rendering.h"
8 #include "ux-window.h"
9 #include "parser.hpp"
10 #include "rs-config.h"
11 
12 #define GLFW_INCLUDE_GLU
13 #include <GLFW/glfw3.h>
14 #include "opengl3.h"
15 #include <imgui.h>
16 #include <imgui_impl_glfw.h>
17 #include <map>
18 #include <set>
19 #include <array>
20 #include <unordered_map>
21 
22 #include "../third-party/json.hpp"
23 #include "objects-in-frame.h"
24 #include "processing-block-model.h"
25 
27 #include "fw-update-helper.h"
28 #include "updates-model.h"
29 #include "calibration-model.h"
30 #include "cah-model.h"
34 
35 ImVec4 from_rgba(uint8_t r, uint8_t g, uint8_t b, uint8_t a, bool consistent_color = false);
36 ImVec4 operator+(const ImVec4& c, float v);
37 
38 static const ImVec4 light_blue = from_rgba(0, 174, 239, 255, true); // Light blue color for selected elements such as play button glyph when paused
39 static const ImVec4 regular_blue = from_rgba(0, 115, 200, 255, true); // Checkbox mark, slider grabber
40 static const ImVec4 light_grey = from_rgba(0xc3, 0xd5, 0xe5, 0xff, true); // Text
41 static const ImVec4 dark_window_background = from_rgba(9, 11, 13, 255);
42 static const ImVec4 almost_white_bg = from_rgba(230, 230, 230, 255, true);
43 static const ImVec4 black = from_rgba(0, 0, 0, 255, true);
44 static const ImVec4 transparent = from_rgba(0, 0, 0, 0, true);
45 static const ImVec4 white = from_rgba(0xff, 0xff, 0xff, 0xff, true);
46 static const ImVec4 scrollbar_bg = from_rgba(14, 17, 20, 255);
47 static const ImVec4 scrollbar_grab = from_rgba(54, 66, 67, 255);
48 static const ImVec4 grey{ 0.5f,0.5f,0.5f,1.f };
49 static const ImVec4 dark_grey = from_rgba(30, 30, 30, 255);
50 static const ImVec4 sensor_header_light_blue = from_rgba(80, 99, 115, 0xff);
51 static const ImVec4 sensor_bg = from_rgba(36, 44, 51, 0xff);
52 static const ImVec4 redish = from_rgba(255, 46, 54, 255, true);
53 static const ImVec4 light_red = from_rgba(255, 146, 154, 255, true);
54 static const ImVec4 dark_red = from_rgba(200, 46, 54, 255, true);
55 static const ImVec4 button_color = from_rgba(62, 77, 89, 0xff);
56 static const ImVec4 header_window_bg = from_rgba(36, 44, 54, 0xff);
57 static const ImVec4 header_color = from_rgba(62, 77, 89, 255);
58 static const ImVec4 title_color = from_rgba(27, 33, 38, 255);
59 static const ImVec4 device_info_color = from_rgba(33, 40, 46, 255);
60 static const ImVec4 yellow = from_rgba(229, 195, 101, 255, true);
61 static const ImVec4 yellowish = from_rgba(255, 253, 191, 255, true);
62 static const ImVec4 green = from_rgba(0x20, 0xe0, 0x20, 0xff, true);
63 static const ImVec4 dark_sensor_bg = from_rgba(0x1b, 0x21, 0x25, 170);
64 static const ImVec4 red = from_rgba(233, 0, 0, 255, true);
65 static const ImVec4 greenish = from_rgba(67, 163, 97, 255);
66 static const ImVec4 orange = from_rgba(255, 157, 0, 255, true);
67 
68 inline ImVec4 operator*(const ImVec4& color, float t)
69 {
70  return ImVec4(color.x * t, color.y * t, color.z * t, color.w * t);
71 }
72 inline ImVec4 operator+(const ImVec4& a, const ImVec4& b)
73 {
74  return ImVec4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w);
75 }
76 
77 inline ImVec4 blend(const ImVec4& c, float a)
78 {
79  return{ c.x, c.y, c.z, a * c.w };
80 }
81 
82 namespace rs2
83 {
84  constexpr const char* server_versions_db_url = "https://librealsense.intel.com/Releases/rs_versions_db.json";
85 
86  void prepare_config_file();
87 
89 
91 
93 
94  void open_issue(std::string body);
95 
96  class device_model;
97 
98  typedef std::vector<std::unique_ptr<device_model>> device_models_list;
99 
100  void open_issue(const device_models_list& devices);
101 
102  void hyperlink(ux_window& window, const char* title, const char* link);
103 
105  {
106  explicit constexpr textual_icon(const char (&unicode_icon)[4]) :
107  _icon{ unicode_icon[0], unicode_icon[1], unicode_icon[2], unicode_icon[3] }
108  {
109  }
110  operator const char*() const
111  {
112  return _icon.data();
113  }
114  private:
115  std::array<char, 5> _icon;
116  };
117 
118  inline std::ostream& operator<<(std::ostream& os, const textual_icon& i)
119  {
120  return os << static_cast<const char*>(i);
121  }
122 
123  static const float FEET_TO_METER = 0.3048f;
124 
125  namespace configurations
126  {
127  namespace record
128  {
129  static const char* file_save_mode { "record.file_save_mode" };
130  static const char* default_path { "record.default_path" };
131  static const char* compression_mode { "record.compression" };
132  }
133  namespace update
134  {
135  static const char* allow_rc_firmware { "update.allow_rc_firmware" };
136  static const char* recommend_updates { "update.recommend_updates" };
137  static const char* recommend_calibration { "update.recommend_calibration" };
138  static const char* sw_updates_url { "update.sw_update_url" };
139  static const char* sw_updates_official_server { "update.sw_update_official_server" };
140  }
141  namespace calibration
142  {
143  static const char* enable_writing { "calibration.enable_writing" };
144  }
145  namespace viewer
146  {
147  static const char* is_3d_view { "viewer_model.is_3d_view" };
148  static const char* ground_truth_r { "viewer_model.ground_truth_r" };
149  static const char* target_width_r { "viewer_model.target_width_r" };
150  static const char* target_height_r { "viewer_model.target_height_r" };
151  static const char* continue_with_ui_not_aligned { "viewer_model.continue_with_ui_not_aligned" };
152  static const char* continue_with_current_fw{ "viewer_model.continue_with_current_fw" };
153  static const char* settings_tab { "viewer_model.settings_tab" };
154  static const char* sdk_version { "viewer_model.sdk_version" };
155  static const char* last_calib_notice { "viewer_model.last_calib_notice" };
156  static const char* is_measuring { "viewer_model.is_measuring" };
157  static const char* output_open { "viewer_model.output_open" };
158  static const char* search_term { "viewer_model.search_term" };
159 
160  static const char* log_to_console { "viewer_model.log_to_console" };
161  static const char* log_to_file { "viewer_model.log_to_file" };
162  static const char* log_filename { "viewer_model.log_filename" };
163  static const char* log_severity { "viewer_model.log_severity" };
164  static const char* post_processing { "viewer_model.post_processing" };
165  static const char* show_map_ruler { "viewer_model.show_map_ruler" };
166  static const char* show_stream_details { "viewer_model.show_stream_details" };
167  static const char* metric_system { "viewer_model.metric_system" };
168  static const char* shading_mode { "viewer_model.shading_mode" };
169  static const char* commands_xml { "viewer_model.commands_xml" };
170  static const char* hwlogger_xml { "viewer_model.hwlogger_xml" };
171 
172  static const char* last_ip { "viewer_model.last_ip" };
173  }
174  namespace window
175  {
176  static const char* is_fullscreen { "window.is_fullscreen" };
177  static const char* saved_pos { "window.saved_pos" };
178  static const char* position_x { "window.position_x" };
179  static const char* position_y { "window.position_y" };
180  static const char* saved_size { "window.saved_size" };
181  static const char* width { "window.width" };
182  static const char* height { "window.height" };
183  static const char* maximized { "window.maximized" };
184  }
185  namespace performance
186  {
187  static const char* glsl_for_rendering { "performance.glsl_for_rendering.v2" };
188  static const char* glsl_for_processing { "performance.glsl_for_processing.v2" };
189  static const char* enable_msaa { "performance.msaa" };
190  static const char* msaa_samples { "performance.msaa_samples" };
191  static const char* show_fps { "performance.show_fps" };
192  static const char* vsync { "performance.vsync" };
193  static const char* font_oversample { "performance.font_oversample.v2" };
194  static const char* show_skybox { "performance.show_skybox" };
195  static const char* occlusion_invalidation { "performance.occlusion_invalidation" };
196  }
197  namespace ply
198  {
199  static const char* mesh { "ply.mesh" };
200  static const char* use_normals { "ply.normals" };
201  static const char* encoding { "ply.encoding" };
202 
204  {
205  textual = 0,
206  binary = 1
207  };
208  }
209  }
210 
211  namespace textual_icons
212  {
213  // A note to a maintainer - preserve order when adding values to avoid duplicates
214  static const textual_icon file_movie { u8"\uf008" };
215  static const textual_icon times { u8"\uf00d" };
216  static const textual_icon download { u8"\uf019" };
217  static const textual_icon refresh { u8"\uf021" };
218  static const textual_icon lock { u8"\uf023" };
219  static const textual_icon camera { u8"\uf030" };
220  static const textual_icon video_camera { u8"\uf03d" };
221  static const textual_icon edit { u8"\uf044" };
222  static const textual_icon step_backward { u8"\uf048" };
223  static const textual_icon play { u8"\uf04b" };
224  static const textual_icon pause { u8"\uf04c" };
225  static const textual_icon stop { u8"\uf04d" };
226  static const textual_icon step_forward { u8"\uf051" };
227  static const textual_icon plus_circle { u8"\uf055" };
228  static const textual_icon question_mark { u8"\uf059" };
229  static const textual_icon info_circle { u8"\uf05a" };
230  static const textual_icon fix_up { u8"\uf062" };
231  static const textual_icon minus { u8"\uf068" };
232  static const textual_icon exclamation_triangle { u8"\uf071" };
233  static const textual_icon shopping_cart { u8"\uf07a" };
234  static const textual_icon bar_chart { u8"\uf080" };
235  static const textual_icon upload { u8"\uf093" };
236  static const textual_icon square_o { u8"\uf096" };
237  static const textual_icon unlock { u8"\uf09c" };
238  static const textual_icon floppy { u8"\uf0c7" };
239  static const textual_icon square { u8"\uf0c8" };
240  static const textual_icon bars { u8"\uf0c9" };
241  static const textual_icon caret_down { u8"\uf0d7" };
242  static const textual_icon repeat { u8"\uf0e2" };
243  static const textual_icon circle { u8"\uf111" };
244  static const textual_icon check_square_o { u8"\uf14a" };
245  static const textual_icon cubes { u8"\uf1b3" };
246  static const textual_icon toggle_off { u8"\uf204" };
247  static const textual_icon toggle_on { u8"\uf205" };
248  static const textual_icon connectdevelop { u8"\uf20e" };
249  static const textual_icon usb_type { u8"\uf287" };
250  static const textual_icon braille { u8"\uf2a1" };
251  static const textual_icon window_maximize { u8"\uf2d0" };
252  static const textual_icon window_restore { u8"\uf2d2" };
253  static const textual_icon grid { u8"\uf1cb" };
254  static const textual_icon exit { u8"\uf011" };
255  static const textual_icon see_less { u8"\uf070" };
256  static const textual_icon dotdotdot { u8"\uf141" };
257  static const textual_icon link { u8"\uf08e" };
258  static const textual_icon throphy { u8"\uF091" };
259  static const textual_icon metadata { u8"\uF0AE" };
260  static const textual_icon check { u8"\uF00C" };
261  static const textual_icon mail { u8"\uF01C" };
262  static const textual_icon cube { u8"\uf1b2" };
263  static const textual_icon measure { u8"\uf545" };
264  }
265 
266  class subdevice_model;
267  struct notifications_model;
268 
269  void imgui_easy_theming(ImFont*& font_14, ImFont*& font_18, ImFont*& monofont);
270 
272 
273  template<class T>
274  void sort_together(std::vector<T>& vec, std::vector<std::string>& names)
275  {
276  std::vector<std::pair<T, std::string>> pairs(vec.size());
277  for (size_t i = 0; i < vec.size(); i++) pairs[i] = std::make_pair(vec[i], names[i]);
278 
279  std::sort(begin(pairs), end(pairs),
280  [](const std::pair<T, std::string>& lhs,
281  const std::pair<T, std::string>& rhs) {
282  return lhs.first < rhs.first;
283  });
284 
285  for (size_t i = 0; i < vec.size(); i++)
286  {
287  vec[i] = pairs[i].first;
288  names[i] = pairs[i].second;
289  }
290  }
291 
292  template<class T>
293  void push_back_if_not_exists(std::vector<T>& vec, T value)
294  {
295  auto it = std::find(vec.begin(), vec.end(), value);
296  if (it == vec.end()) vec.push_back(value);
297  }
298 
300  {
301  std::array<std::pair<bool,rs2_metadata_type>,RS2_FRAME_METADATA_COUNT> md_attributes{};
302  };
303 
305  typedef std::map<int, rect> streams_layout;
306 
307  std::vector<std::pair<std::string, std::string>> get_devices_names(const device_list& list);
308  std::vector<std::string> get_device_info(const device& dev, bool include_location = true);
309 
311  {
312  public:
313  bool draw(std::string& error_message, notifications_model& model,bool new_line=true, bool use_option_name = true);
314  void update_supported(std::string& error_message);
315  void update_read_only_status(std::string& error_message);
316  void update_all_fields(std::string& error_message, notifications_model& model);
317  void set_option(rs2_option opt, float value, std::string &error_message);
318  bool draw_option(bool update_read_only_options, bool is_streaming,
319  std::string& error_message, notifications_model& model);
320 
323  std::shared_ptr<options> endpoint;
324  bool* invalidate_flag = nullptr;
325  bool supported = false;
326  bool read_only = false;
327  float value = 0.0f;
329  std::string id = "";
331  std::function<bool(option_model&, std::string&, notifications_model&)> custom_draw_method = nullptr;
332  bool edit_mode = false;
333  std::string edit_value = "";
334  private:
335  bool is_all_integers() const;
336  bool is_enum() const;
337  bool is_checkbox() const;
338  bool allow_change(float val, std::string& error_message) const;
339  };
340 
342  {
343  public:
344  frame_queue& at(int id)
345  {
346  std::lock_guard<std::mutex> lock(_lookup_mutex);
347  return _queues[id];
348  }
349 
350  template<class T>
351  void foreach(T action)
352  {
353  std::lock_guard<std::mutex> lock(_lookup_mutex);
354  for (auto&& kvp : _queues)
355  action(kvp.second);
356  }
357 
358  private:
359  std::unordered_map<int, frame_queue> _queues;
360  std::mutex _lookup_mutex;
361  };
362 
363  // Preserve user selections in UI
365  {
366  int selected_res_id = 0;
367  int selected_shared_fps_id = 0;
368  std::map<int, int> selected_fps_id;
369  std::map<int, int> selected_format_id;
370  };
371 
372  class viewer_model;
373  class subdevice_model;
374 
375  void save_processing_block_to_config_file(const char* name,
376  std::shared_ptr<rs2::processing_block> pb, bool enable = true);
377 
379  {
380  public:
382  _active(true){}
383 
384  std::shared_ptr<rs2::asynchronous_syncer> create_syncer()
385  {
386  stop();
387  std::lock_guard<std::mutex> lock(_mutex);
388  auto shared_syncer = std::make_shared<rs2::asynchronous_syncer>();
390 
391  _syncers.push_back({shared_syncer,q});
392  shared_syncer->start([this, q](rs2::frame f)
393  {
394  q.enqueue(f);
395  on_frame();
396  });
397  start();
398  return shared_syncer;
399  }
400 
401  void remove_syncer(std::shared_ptr<rs2::asynchronous_syncer> s)
402  {
403  stop();
404  std::lock_guard<std::mutex> lock(_mutex);
405  _syncers.erase(std::remove_if(_syncers.begin(), _syncers.end(),
406  [s](std::pair<std::shared_ptr<rs2::asynchronous_syncer>, rs2::frame_queue> pair)
407  {
408  return pair.first.get() == s.get();
409  }), _syncers.end()) ;
410  start();
411  }
412 
413  std::vector<rs2::frameset> try_wait_for_frames()
414  {
415  std::lock_guard<std::mutex> lock(_mutex);
416 
417  std::vector<rs2::frameset> result;
418  for(auto&& s = _syncers.begin(); s!=_syncers.end() && _active; s++)
419  {
421  if(s->second.try_wait_for_frame(&f,1))
422  {
423  result.push_back(f);
424  }
425  }
426 
427  return result;
428  }
429 
430  void stop()
431  {
432  _active.exchange(false);
433  }
434 
435  void start()
436  {
437  _active.exchange(true);
438  }
439 
440  std::function<void()> on_frame = []{};
441  private:
442  std::vector<std::pair<std::shared_ptr<rs2::asynchronous_syncer>, rs2::frame_queue>> _syncers;
443  std::mutex _mutex;
444  std::atomic<bool> _active;
445  };
446 
447  option_model create_option_mode(rs2_option opt, std::shared_ptr<options> options, const std::string& opt_base_label, bool* options_invalidated, std::string& error_message);
448 
449  using color = std::array<float, 3>;
450  using face = std::array<float3, 4>;
451  using colored_cube = std::array<std::pair<face, color>, 6>;
452  using tracked_point = std::pair<rs2_vector, unsigned int>; // translation and confidence
453 
455  {
456  public:
457  press_button_model(const char* icon_default, const char* icon_pressed, std::string tooltip_default, std::string tooltip_pressed,
458  bool init_pressed)
459  {
460  state_pressed = init_pressed;
461  tooltip[unpressed] = tooltip_default;
462  tooltip[pressed] = tooltip_pressed;
463  icon[unpressed] = icon_default;
464  icon[pressed] = icon_pressed;
465  }
466 
467  void toggle_button() { state_pressed = !state_pressed; }
468  void set_button_pressed(bool p) { state_pressed = p; }
469  bool is_pressed() { return state_pressed; }
470  std::string get_tooltip() { return(state_pressed ? tooltip[pressed] : tooltip[unpressed]); }
471  std::string get_icon() { return(state_pressed ? icon[pressed] : icon[unpressed]); }
472 
473  private:
475  {
476  unpressed, //default
477  pressed
478  };
479 
480  bool state_pressed = false;
481  std::string tooltip[2];
482  std::string icon[2];
483  };
484 
485  bool yes_no_dialog(const std::string& title, const std::string& message_text, bool& approved, ux_window& window, const std::string& error_message, bool disabled = false, const std::string& disabled_reason = "");
486  bool status_dialog(const std::string& title, const std::string& process_topic_text, const std::string& process_status_text, bool enable_close, ux_window& window);
487 
488  class tm2_model
489  {
490  public:
491  tm2_model() : _trajectory_tracking(true)
492  {
493  }
494  void draw_trajectory(bool is_trajectory_button_pressed);
495  void update_model_trajectory(const pose_frame& pose, bool track);
496  void record_trajectory(bool on) { _trajectory_tracking = on; };
497  void reset_trajectory() { trajectory.clear(); };
498 
499  private:
500  void add_to_trajectory(tracked_point& p);
501 
502  const float len_x = 0.1f;
503  const float len_y = 0.03f;
504  const float len_z = 0.01f;
505  /*
506  4--------------------------3
507  /| /|
508  5-|------------------------6 |
509  | /1 | /2
510  |/ |/
511  7--------------------------8
512  */
513  float3 v1{ -len_x / 2, -len_y / 2, len_z / 2 };
514  float3 v2{ len_x / 2, -len_y / 2, len_z / 2 };
515  float3 v3{ len_x / 2, len_y / 2, len_z / 2 };
516  float3 v4{ -len_x / 2, len_y / 2, len_z / 2 };
517  float3 v5{ -len_x / 2, len_y / 2, -len_z / 2 };
518  float3 v6{ len_x / 2, len_y / 2, -len_z / 2 };
519  float3 v7{ -len_x / 2, -len_y / 2, -len_z / 2 };
520  float3 v8{ len_x / 2, -len_y / 2, -len_z / 2 };
521  face f1{ { v1,v2,v3,v4 } }; //Back
522  face f2{ { v2,v8,v6,v3 } }; //Right side
523  face f3{ { v4,v3,v6,v5 } }; //Top side
524  face f4{ { v1,v4,v5,v7 } }; //Left side
525  face f5{ { v7,v8,v6,v5 } }; //Front
526  face f6{ { v1,v2,v8,v7 } }; //Bottom side
527 
528  std::array<color, 6> colors{ {
529  { { 0.5f, 0.5f, 0.5f } }, //Back
530  { { 0.7f, 0.7f, 0.7f } }, //Right side
531  { { 1.0f, 0.7f, 0.7f } }, //Top side
532  { { 0.7f, 0.7f, 0.7f } }, //Left side
533  { { 0.4f, 0.4f, 0.4f } }, //Front
534  { { 0.7f, 0.7f, 0.7f } } //Bottom side
535  } };
536 
537  colored_cube camera_box{ { { f1,colors[0] },{ f2,colors[1] },{ f3,colors[2] },{ f4,colors[3] },{ f5,colors[4] },{ f6,colors[5] } } };
538 
539  std::vector<tracked_point> trajectory;
540  std::vector<float2> boundary;
542 
543  };
544 
546  {
547  public:
548  static void populate_options(std::map<int, option_model>& opt_container,
549  const std::string& opt_base_label,
551  std::shared_ptr<options> options,
552  bool* options_invalidated,
553  std::string& error_message);
554 
555  subdevice_model(device& dev, std::shared_ptr<sensor> s, std::shared_ptr< atomic_objects_in_frame > objects, std::string& error_message, viewer_model& viewer, bool new_device_connected = true);
556  ~subdevice_model();
557 
558  bool is_there_common_fps() ;
559  bool supports_on_chip_calib();
560  bool draw_stream_selection(std::string& error_message);
561  bool is_selected_combination_supported();
562  std::vector<stream_profile> get_selected_profiles();
563  std::vector<stream_profile> get_supported_profiles();
564  void stop(std::shared_ptr<notifications_model> not_model);
565  void play(const std::vector<stream_profile>& profiles, viewer_model& viewer, std::shared_ptr<rs2::asynchronous_syncer>);
566  bool is_synchronized_frame(viewer_model& viewer, const frame& f);
567  void update(std::string& error_message, notifications_model& model);
568  void draw_options(const std::vector<rs2_option>& drawing_order,
569  bool update_read_only_options, std::string& error_message,
570  notifications_model& model);
571  uint64_t num_supported_non_default_options() const;
572  bool draw_option(rs2_option opt, bool update_read_only_options,
573  std::string& error_message, notifications_model& model)
574  {
575  if(options_metadata.find(opt)!=options_metadata.end())
576  return options_metadata[opt].draw_option(update_read_only_options, streaming, error_message, model);
577  return false;
578  }
579 
580  bool is_paused() const;
581  void pause();
582  void resume();
583 
584  bool can_enable_zero_order();
585  void verify_zero_order_conditions();
586 
587  void update_ui(std::vector<stream_profile> profiles_vec);
588  void get_sorted_profiles(std::vector<stream_profile>& profiles);
589 
590  template<typename T, typename V>
591  bool check_profile(stream_profile p, T cond, std::map<V, std::map<int, stream_profile>>& profiles_map,
592  std::vector<stream_profile>& results, V key, int num_streams, stream_profile& def_p);
593 
594  void restore_ui_selection() { ui = last_valid_ui; }
595  void store_ui_selection() { last_valid_ui = ui; }
596 
597  template<typename T>
598  bool get_default_selection_index(const std::vector<T>& values, const T & def, int* index)
599  {
600  auto max_default = values.begin();
601  for (auto it = values.begin(); it != values.end(); it++)
602  {
603 
604  if (*it == def)
605  {
606  *index = (int)(it - values.begin());
607  return true;
608  }
609  if (*max_default < *it)
610  {
611  max_default = it;
612  }
613  }
614  *index = (int)(max_default - values.begin());
615  return false;
616  }
617 
619  std::function<void()> on_frame = []{};
620  std::shared_ptr<sensor> s;
623  std::shared_ptr< atomic_objects_in_frame > detected_objects;
624 
625  std::map<int, option_model> options_metadata;
626  std::vector<std::string> resolutions;
627  std::map<int, std::vector<std::string>> fpses_per_stream;
628  std::vector<std::string> shared_fpses;
629  std::map<int, std::vector<std::string>> formats;
630  std::map<int, bool> stream_enabled;
631  std::map<int, bool> prev_stream_enabled;
632  std::map<int, std::string> stream_display_names;
633 
636 
637  std::vector<std::pair<int, int>> res_values;
638  std::map<int, std::vector<int>> fps_values_per_stream;
639  std::vector<int> shared_fps_values;
640  bool show_single_fps_list = false;
641  std::map<int, std::vector<rs2_format>> format_values;
642 
643  std::vector<stream_profile> profiles;
644 
646  std::mutex _queue_lock;
647  bool _options_invalidated = false;
648  int next_option = 0;
649  std::vector<rs2_option> supported_options;
650  bool streaming = false;
651  bool allow_change_resolution_while_streaming = false;
652  bool allow_change_fps_while_streaming = false;
653  rect normalized_zoom{0, 0, 1, 1};
655  bool auto_exposure_enabled = false;
656  float depth_units = 1.f;
657  float stereo_baseline = -1.f;
658 
659  bool roi_checked = false;
660 
661  std::atomic<bool> _pause;
662  std::atomic<bool> _is_being_recorded{ false };
663 
664  bool draw_streams_selector = true;
665  bool draw_fps_selector = true;
666 
668  bool show_algo_roi = false;
670 
671  std::shared_ptr<rs2::colorizer> depth_colorizer;
672  std::shared_ptr<rs2::yuy_decoder> yuy2rgb;
673  std::shared_ptr<processing_block_model> zero_order_artifact_fix;
674  std::shared_ptr<rs2::depth_huffman_decoder> depth_decoder;
675 
676  std::vector<std::shared_ptr<processing_block_model>> post_processing;
677  bool post_processing_enabled = true;
678  std::vector<std::shared_ptr<processing_block_model>> const_effects;
679 
680  private:
681  const float SHORT_RANGE_MIN_DISTANCE = 0.05f; // 5 cm
682  const float SHORT_RANGE_MAX_DISTANCE = 4.0f; // 4 meters
683  };
684 
685  class viewer_model;
686 
687  void outline_rect(const rect& r);
688  void draw_rect(const rect& r, int line_width = 1);
689 
691  {
692  public:
693  stream_model();
694  std::shared_ptr<texture_buffer> upload_frame(frame&& f);
695  bool is_stream_visible();
696  void update_ae_roi_rect(const rect& stream_rect, const mouse_info& mouse, std::string& error_message);
697  void show_frame(const rect& stream_rect, const mouse_info& g, std::string& error_message);
698  rect get_normalized_zoom(const rect& stream_rect, const mouse_info& g, bool is_middle_clicked, float zoom_val);
699 
700  bool is_stream_alive();
701  void show_stream_footer(ImFont* font, const rect &stream_rect, const mouse_info& mouse, const std::map<int, stream_model> &streams, viewer_model& viewer);
702  void show_stream_header(ImFont* font, const rect& stream_rect, viewer_model& viewer);
703  void show_stream_imu(ImFont* font, const rect& stream_rect, const rs2_vector& axis, const mouse_info& mouse);
704  void show_stream_pose(ImFont* font, const rect& stream_rect, const rs2_pose& pose_data,
705  rs2_stream stream_type, bool fullScreen, float y_offset, viewer_model& viewer);
706 
707  void snapshot_frame(const char* filename,viewer_model& viewer) const;
708 
709  void begin_stream(std::shared_ptr<subdevice_model> d, rs2::stream_profile p, const viewer_model& viewer);
710  bool draw_reflectivity(int x, int y, rs2::depth_sensor ds, const std::map<int, stream_model> &streams, std::stringstream &ss, bool same_line = false);
712  std::shared_ptr<texture_buffer> texture;
715  rect get_stream_bounds() const { return { 0, 0, size.x, size.y };}
716  rect get_original_stream_bounds() const { return{ 0, 0, original_size.x, original_size.y };}
719  std::chrono::high_resolution_clock::time_point last_frame;
720  double timestamp = 0.0;
721  unsigned long long frame_number = 0;
724  int count = 0;
725  rect roi_display_rect{};
726  float roi_percentage = 0.4f;
728  bool capturing_roi = false; // active modification of roi
729  std::shared_ptr<subdevice_model> dev;
730  float _frame_timeout = RS2_DEFAULT_TIMEOUT;
731  float _min_timeout = 167.0f;
732 
733  bool _mid_click = false;
734  float2 _middle_pos{0, 0};
735  rect _normalized_zoom{0, 0, 1, 1};
736  int color_map_idx = 1;
737  bool show_stream_details = false;
738  rect curr_info_rect{};
740  bool show_map_ruler = true;
741  bool show_metadata = false;
742 
743  animated<float> _info_height{ 0.f };
744  int _prev_mouse_pos_x = 0;
745  int _prev_mouse_pos_y = 0;
746 
747  private:
748  std::unique_ptr< reflectivity > _reflectivity;
750 
751  };
752 
753  std::pair<std::string, std::string> get_device_name(const device& dev);
754 
755  bool draw_combo_box(const std::string& id, const std::vector<std::string>& device_names, int& new_index);
756 
758  {
759  public:
760  typedef std::function<void(std::function<void()> load)> json_loading_func;
761 
762  void reset();
763  explicit device_model(device& dev, std::string& error_message, viewer_model& viewer, bool new_device_connected = true, bool allow_remove=true);
764  ~device_model();
765  void start_recording(const std::string& path, std::string& error_message);
766  void stop_recording(viewer_model& viewer);
767  void pause_record();
768  void resume_record();
769 
770  void refresh_notifications(viewer_model& viewer);
771  void check_for_bundled_fw_update(const rs2::context& ctx, std::shared_ptr<notifications_model> not_model);
772 
773  int draw_playback_panel(ux_window& window, ImFont* font, viewer_model& view);
774  bool draw_advanced_controls(viewer_model& view, ux_window& window, std::string& error_message);
775  void draw_controls(float panel_width, float panel_height,
776  ux_window& window,
777  std::string& error_message,
778  device_model*& device_to_remove,
779  viewer_model& viewer, float windows_width,
780  std::vector<std::function<void()>>& draw_later,
781  bool load_json_if_streaming = false,
782  json_loading_func json_loading = [](std::function<void()> load) {load(); },
783  bool draw_device_outline = true);
784  void handle_hardware_events(const std::string& serialized_data);
785  void begin_update(std::vector<uint8_t> data,
786  viewer_model& viewer, std::string& error_message);
787  void begin_update_unsigned(viewer_model& viewer, std::string& error_message);
788  void check_for_device_updates(viewer_model& viewer);
789 
790 
791  std::shared_ptr< atomic_objects_in_frame > get_detected_objects() const { return _detected_objects; }
792  bool is_cah_model_enabled() const { return _accuracy_health_model ? true : false; }
793 
794  std::vector<std::shared_ptr<subdevice_model>> subdevices;
795  std::shared_ptr<syncer_model> syncer;
796  std::shared_ptr<rs2::asynchronous_syncer> dev_syncer;
797  bool is_streaming() const;
798  bool metadata_supported = false;
799  bool get_curr_advanced_controls = true;
802  bool is_recording = false;
803  int seek_pos = 0;
804  int playback_speed_index = 2;
805  bool _playback_repeat = true;
806  bool _should_replay = false;
807  bool show_device_info = false;
808  bool _allow_remove = true;
809  bool show_depth_only = false;
810  bool show_stream_selection = true;
811  std::vector<std::pair<std::string, std::string>> infos;
812  std::vector<std::string> restarting_device_info;
813  std::set<std::string> advanced_mode_settings_file_names;
815 
816  std::vector<std::shared_ptr<notification_model>> related_notifications;
817 
818  bool show_trigger_camera_accuracy_health_popup = false;
819  bool show_reset_camera_accuracy_health_popup = false;
820 
821  private:
822  // This class is in charge of camera accuracy health window parameters,
823  // Needed as a member for reseting the window memory on device disconnection.
824 
825 
826  std::unique_ptr< cah_model > _accuracy_health_model; // If this device does not support CAH feature,
827  // the pointer will point to nullptr
828 
829  void draw_info_icon(ux_window& window, ImFont* font, const ImVec2& size);
830  int draw_seek_bar();
831  int draw_playback_controls(ux_window& window, ImFont* font, viewer_model& view);
834  float draw_device_panel(float panel_width,
835  ux_window& window,
836  std::string& error_message,
837  viewer_model& viewer);
838  void play_defaults(viewer_model& view);
839  float draw_preset_panel(float panel_width,
840  ux_window& window,
841  std::string& error_message,
842  viewer_model& viewer,
843  bool update_read_only_options,
844  bool load_json_if_streaming,
845  json_loading_func json_loading);
846  bool prompt_toggle_advanced_mode(bool enable_advanced_mode, const std::string& message_text,
847  std::vector<std::string>& restarting_device_info,
849  ux_window& window,
850  const std::string& error_message);
851 
852  void load_viewer_configurations(const std::string& json_str);
853  void save_viewer_configurations(std::ofstream& outfile, nlohmann::json& j);
854  void handle_online_sw_update(
855  std::shared_ptr < notifications_model > nm,
856  std::shared_ptr< sw_update::dev_updates_profile::update_profile > update_profile );
857 
858  bool handle_online_fw_update(
859  const context & ctx,
860  std::shared_ptr< notifications_model > nm,
861  std::shared_ptr< sw_update::dev_updates_profile::update_profile > update_profile );
862 
863  std::shared_ptr<recorder> _recorder;
864  std::vector<std::shared_ptr<subdevice_model>> live_subdevices;
866  bool pause_required = false;
867  std::shared_ptr< atomic_objects_in_frame > _detected_objects;
868  std::shared_ptr<updates_model> _updates;
869  std::shared_ptr<sw_update::dev_updates_profile::update_profile >_updates_profile;
871  };
872 
873  class viewer_model;
875  {
876  public:
879  {
880  process(std::move(f), source);
881  }),
882  viewer(viewer),
883  depth_stream_active(false),
884  resulting_queue_max_size(20),
885  resulting_queue(static_cast<unsigned int>(resulting_queue_max_size)),
886  render_thread(),
887  render_thread_active(false),
888  pc(new gl::pointcloud()),
889  uploader(new gl::uploader()),
890  disp_to_depth(false)
891  {
892  std::string s;
893  pc_gen = std::make_shared<processing_block_model>(nullptr, "Pointcloud Engine", pc, [=](rs2::frame f) { return pc->calculate(f); }, s);
894  processing_block.start(resulting_queue);
895  }
896 
898 
899  void update_texture(frame f) { pc->map_to(f); }
900 
901  /* Start the rendering thread in case its disabled */
902  void start();
903 
904  /* Stop the rendering thread in case its enabled */
905  void stop();
906 
907  bool is_rendering() const
908  {
909  return render_thread_active.load();
910  }
911 
913  {
914  frame f;
915  if (resulting_queue.poll_for_frame(&f))
916  {
918  model = frameset;
919  }
920  return model;
921  }
922 
923  void reset(void)
924  {
925  rs2::frame f{};
926  model = f;
927  while(resulting_queue.poll_for_frame(&f));
928  }
929 
930  std::atomic<bool> depth_stream_active;
931 
933  std::map<int, rs2::frame_queue> frames_queue;
935 
936  std::shared_ptr<pointcloud> get_pc() const { return pc; }
937  std::shared_ptr<processing_block_model> get_pc_model() const { return pc_gen; }
938 
939  private:
941  void process(rs2::frame f, const rs2::frame_source& source);
942  std::vector<rs2::frame> handle_frame(rs2::frame f, const rs2::frame_source& source);
943 
944  void map_id(rs2::frame new_frame, rs2::frame old_frame);
945  void map_id_frameset_to_frame(rs2::frameset first, rs2::frame second);
946  void map_id_frameset_to_frameset(rs2::frameset first, rs2::frameset second);
947  void map_id_frame_to_frame(rs2::frame first, rs2::frame second);
948 
949  rs2::frame apply_filters(rs2::frame f, const rs2::frame_source& source);
950  std::shared_ptr<subdevice_model> get_frame_origin(const rs2::frame& f);
951 
952  void zero_first_pixel(const rs2::frame& f);
955  std::shared_ptr<pointcloud> pc;
957  std::shared_ptr<processing_block_model> pc_gen;
960 
961  /* Post processing filter rendering */
962  std::atomic<bool> render_thread_active; // True when render post processing filter rendering thread is active, False otherwise
963  std::shared_ptr<std::thread> render_thread; // Post processing filter rendering Thread running render_loop()
964  void render_loop(); // Post processing filter rendering function
965 
966  std::shared_ptr<gl::uploader> uploader; // GL element that helps pre-emptively copy frames to the GPU
967  };
968 
969  void export_frame(const std::string& fname, std::unique_ptr<rs2::filter> exporter, notifications_model& ns, rs2::frame data, bool notify = true);
970 
971  // Auxillary function to save stream data in its internal (raw) format
973 
974  // Auxillary function to store frame attributes
976 
978  {
979  public:
980  explicit device_changes(rs2::context& ctx);
981  bool try_get_next_changes(event_information& removed_and_connected);
982  private:
983  void add_changes(const event_information& c);
984  std::queue<event_information> _changes;
985  std::mutex _mtx;
986  };
987 }
std::vector< std::shared_ptr< notification_model > > related_notifications
Definition: model-views.h:816
static const textual_icon lock
Definition: model-views.h:218
static const ImVec4 transparent
Definition: model-views.h:44
static const textual_icon video_camera
Definition: model-views.h:220
static const ImVec4 white
Definition: model-views.h:45
std::map< int, bool > stream_enabled
Definition: model-views.h:630
static const textual_icon floppy
Definition: model-views.h:238
std::shared_ptr< recorder > _recorder
Definition: model-views.h:863
static const textual_icon bar_chart
Definition: model-views.h:234
GLuint GLuint end
rs2_sensor_mode resolution_from_width_height(int width, int height)
Definition: model-views.cpp:46
GLboolean GLboolean GLboolean b
static const textual_icon connectdevelop
Definition: model-views.h:248
GLboolean GLboolean g
GLint y
std::atomic< bool > _active
Definition: model-views.h:444
static const ImVec4 light_red
Definition: model-views.h:53
std::vector< rs2::frameset > try_wait_for_frames()
Definition: model-views.h:413
static const textual_icon circle
Definition: model-views.h:243
press_button_model(const char *icon_default, const char *icon_pressed, std::string tooltip_default, std::string tooltip_pressed, bool init_pressed)
Definition: model-views.h:457
std::map< int, int > selected_fps_id
Definition: model-views.h:368
std::map< int, std::vector< rs2_format > > format_values
Definition: model-views.h:641
static const char * is_measuring
Definition: model-views.h:156
static const textual_icon unlock
Definition: model-views.h:237
rs2::disparity_transform disp_to_depth
Definition: model-views.h:958
std::vector< std::string > shared_fpses
Definition: model-views.h:628
bool motion_data_to_csv(const std::string &filename, rs2::frame frame)
GLuint const GLchar * name
static const ImVec4 almost_white_bg
Definition: model-views.h:42
static const ImVec4 header_window_bg
Definition: model-views.h:56
std::map< int, int > selected_format_id
Definition: model-views.h:369
bool pose_data_to_csv(const std::string &filename, rs2::frame frame)
std::shared_ptr< rs2::asynchronous_syncer > dev_syncer
Definition: model-views.h:796
static const char * position_y
Definition: model-views.h:179
std::shared_ptr< atomic_objects_in_frame > _detected_objects
Definition: model-views.h:867
std::shared_ptr< rs2::depth_huffman_decoder > depth_decoder
Definition: model-views.h:674
The header of the GLFW 3 API.
rs2_option opt
Definition: model-views.h:321
rs2_option
Defines general configuration controls. These can generally be mapped to camera UVC controls...
Definition: rs_option.h:22
GLfloat green
std::queue< event_information > _changes
Definition: model-views.h:984
static const textual_icon check_square_o
Definition: model-views.h:244
std::atomic< bool > depth_stream_active
Definition: model-views.h:930
GLdouble s
std::atomic< bool > _pause
Definition: model-views.h:661
static const char * target_width_r
Definition: model-views.h:149
bool frame_metadata_to_csv(const std::string &filename, rs2::frame frame)
static const char * last_ip
Definition: model-views.h:172
static const ImVec4 greenish
Definition: model-views.h:65
option_model create_option_mode(rs2_option opt, std::shared_ptr< options > options, const std::string &opt_base_label, bool *options_invalidated, std::string &error_message)
static const ImVec4 title_color
Definition: model-views.h:58
void set_button_pressed(bool p)
Definition: model-views.h:468
frame_queues queues
Definition: model-views.h:645
void remove_syncer(std::shared_ptr< rs2::asynchronous_syncer > s)
Definition: model-views.h:401
GLfloat GLfloat p
Definition: glext.h:12687
static const textual_icon caret_down
Definition: model-views.h:241
GLboolean reset
static const textual_icon info_circle
Definition: model-views.h:229
bool status_dialog(const std::string &title, const std::string &process_topic_text, const std::string &process_status_text, bool enable_close, ux_window &window)
static const textual_icon question_mark
Definition: model-views.h:228
static const ImVec4 light_grey
Definition: model-views.h:40
Definition: imgui.h:88
static const char * recommend_calibration
Definition: model-views.h:137
constexpr const char * server_versions_db_url
Definition: model-views.h:84
a class to store JSON values
Definition: json.hpp:221
GLuint color
void draw_seek_bar(rs2::playback &playback, int *seek_pos, float2 &location, float width)
void draw_rect(const rect &r, int line_width)
static const ImVec4 light_blue
Definition: model-views.h:38
GLsizei const GLchar *const * path
Definition: glext.h:4276
std::vector< int > shared_fps_values
Definition: model-views.h:639
std::shared_ptr< subdevice_model > dev
Definition: model-views.h:729
GLfloat value
std::string get_icon()
Definition: model-views.h:471
ImVec4 operator*(const ImVec4 &color, float t)
Definition: model-views.h:68
std::mutex _queue_lock
Definition: model-views.h:646
static const textual_icon repeat
Definition: model-views.h:242
stream_profile profile
Definition: model-views.h:718
static const char * post_processing
Definition: model-views.h:164
std::function< void(frame_interface *)> on_frame
Definition: streaming.h:164
std::shared_ptr< updates_model > _updates
Definition: model-views.h:868
UINT8_TYPE u8
Definition: sqlite3.c:11450
std::shared_ptr< texture_buffer > texture
Definition: model-views.h:712
static const char * saved_pos
Definition: model-views.h:177
rs2::frame_queue resulting_queue
Definition: model-views.h:934
static const textual_icon throphy
Definition: model-views.h:258
void imgui_easy_theming(ImFont *&font_14, ImFont *&font_18, ImFont *&monofont)
std::unique_ptr< reflectivity > _reflectivity
Definition: model-views.h:748
static const textual_icon braille
Definition: model-views.h:250
static const ImVec4 dark_window_background
Definition: model-views.h:41
Definition: cah-model.h:10
void hyperlink(ux_window &window, const char *title, const char *link)
GLsizei const GLchar *const * string
d
Definition: rmse.py:171
static const char * log_filename
Definition: model-views.h:162
constexpr textual_icon(const char(&unicode_icon)[4])
Definition: model-views.h:106
static const textual_icon plus_circle
Definition: model-views.h:227
unsigned char uint8_t
Definition: stdint.h:78
std::shared_ptr< gl::uploader > uploader
Definition: model-views.h:966
subdevice_model * dev
Definition: model-views.h:330
bool get_default_selection_index(const std::vector< T > &values, const T &def, int *index)
Definition: model-views.h:598
calibration_model _calib_model
Definition: model-views.h:870
static const char * hwlogger_xml
Definition: model-views.h:170
static const ImVec4 grey
Definition: model-views.h:48
static const textual_icon stop
Definition: model-views.h:225
void sort(sort_type m_sort_type, const std::string &in, const std::string &out)
std::shared_ptr< processing_block_model > pc_gen
Definition: model-views.h:957
GLuint GLuint * names
Definition: glext.h:5648
::realsense_legacy_msgs::pose_< std::allocator< void > > pose
Definition: pose.h:88
GLenum GLuint id
std::ostream & operator<<(std::ostream &os, const textual_icon &i)
Definition: model-views.h:118
static const textual_icon shopping_cart
Definition: model-views.h:233
static const char * show_fps
Definition: model-views.h:191
std::map< int, std::string > stream_display_names
Definition: model-views.h:632
GLuint index
void prepare_config_file()
Definition: ux-window.cpp:47
GLdouble t
GLboolean GLboolean GLboolean GLboolean a
std::atomic< bool > render_thread_active
Definition: model-views.h:962
std::shared_ptr< syncer_model > syncer
Definition: model-views.h:795
void open_issue(std::string body)
GLuint GLfloat * val
GLuint64 key
Definition: glext.h:8966
frame_metadata frame_md
Definition: model-views.h:727
static const textual_icon usb_type
Definition: model-views.h:249
Definition: parser.hpp:154
std::vector< std::string > restarting_device_info
Definition: model-views.h:812
static const char * msaa_samples
Definition: model-views.h:190
not_this_one begin(...)
std::shared_ptr< atomic_objects_in_frame > detected_objects
Definition: model-views.h:623
void update(rs2::update_device fwu_dev, std::vector< uint8_t > fw_image)
GLdouble f
std::vector< std::shared_ptr< processing_block_model > > const_effects
Definition: model-views.h:678
bool draw_combo_box(const std::string &id, const std::vector< std::string > &device_names, int &new_index)
float3 colors[]
Definition: rs-pcl.cpp:44
static const textual_icon grid
Definition: model-views.h:253
static const char * glsl_for_processing
Definition: model-views.h:188
static const char * metric_system
Definition: model-views.h:167
rs2::frameset get_points()
Definition: model-views.h:912
std::vector< float2 > boundary
Definition: model-views.h:540
dictionary streams
Definition: t265_stereo.py:140
frame_queue & at(int id)
Definition: model-views.h:344
GLsizeiptr size
static const float FEET_TO_METER
Definition: model-views.h:123
static const char * saved_size
Definition: model-views.h:180
static const textual_icon refresh
Definition: model-views.h:217
static const char * show_stream_details
Definition: model-views.h:166
static const ImVec4 orange
Definition: model-views.h:66
static const char * continue_with_current_fw
Definition: model-views.h:152
std::vector< tracked_point > trajectory
Definition: model-views.h:539
static const ImVec4 regular_blue
Definition: model-views.h:39
float w
Definition: imgui.h:100
const GLubyte * c
Definition: glext.h:12690
static const textual_icon download
Definition: model-views.h:216
std::shared_ptr< pointcloud > pc
Definition: model-views.h:955
GLdouble GLdouble r
temporal_event _stream_not_alive
Definition: model-views.h:739
static const textual_icon play
Definition: model-views.h:223
void record_trajectory(bool on)
Definition: model-views.h:496
static const textual_icon link
Definition: model-views.h:257
void push_back_if_not_exists(std::vector< T > &vec, T value)
Definition: model-views.h:293
GLdouble x
std::vector< std::pair< std::string, std::string > > infos
Definition: model-views.h:811
devices
Definition: test-fg.py:9
static const textual_icon step_forward
Definition: model-views.h:226
static const ImVec4 scrollbar_bg
Definition: model-views.h:46
std::vector< std::string > get_device_info(const device &dev, bool include_location)
std::vector< rs2_option > supported_options
Definition: model-views.h:649
static const textual_icon see_less
Definition: model-views.h:255
rect get_original_stream_bounds() const
Definition: model-views.h:716
static const textual_icon upload
Definition: model-views.h:235
GLint GLsizei GLsizei height
static const textual_icon edit
Definition: model-views.h:221
static const char * sw_updates_url
Definition: model-views.h:138
std::map< int, std::vector< std::string > > fpses_per_stream
Definition: model-views.h:627
static const textual_icon square
Definition: model-views.h:239
float z
Definition: imgui.h:100
std::shared_ptr< pointcloud > get_pc() const
Definition: model-views.h:936
std::set< std::string > advanced_mode_settings_file_names
Definition: model-views.h:813
std::chrono::high_resolution_clock::time_point last_frame
Definition: model-views.h:719
static const textual_icon mail
Definition: model-views.h:261
static const char * compression_mode
Definition: model-views.h:131
std::string id
Definition: model-views.h:801
static const ImVec4 sensor_bg
Definition: model-views.h:51
void sort_together(std::vector< T > &vec, std::vector< std::string > &names)
Definition: model-views.h:274
bool save_frame_meta_data(const std::string &filename, rs2::frame frame)
def find(dir, mask)
Definition: file.py:25
static const char * output_open
Definition: model-views.h:157
void export_frame(const std::string &fname, std::unique_ptr< rs2::filter > exporter, notifications_model &ns, frame data, bool notify)
unsigned __int64 uint64_t
Definition: stdint.h:90
static const textual_icon check
Definition: model-views.h:260
GLfloat GLfloat GLfloat GLfloat v3
static void draw(void)
Definition: gears.c:173
std::shared_ptr< options > endpoint
Definition: model-views.h:323
stream_profile original_profile
Definition: model-views.h:717
ImVec4 from_rgba(uint8_t r, uint8_t g, uint8_t b, uint8_t a, bool consistent_color=false)
static const textual_icon minus
Definition: model-views.h:231
GLuint start
static const char * last_calib_notice
Definition: model-views.h:155
static const char * use_normals
Definition: model-views.h:200
std::shared_ptr< sensor > s
Definition: model-views.h:620
GLint j
advanced_mode_control amc
Definition: model-views.h:832
static const textual_icon file_movie
Definition: model-views.h:214
static const ImVec4 sensor_header_light_blue
Definition: model-views.h:50
bool is_cah_model_enabled() const
Definition: model-views.h:792
bool yes_no_dialog(const std::string &title, const std::string &message_text, bool &approved, ux_window &window, const std::string &error_message, bool disabled, const std::string &disabled_reason)
std::vector< std::pair< std::shared_ptr< rs2::asynchronous_syncer >, rs2::frame_queue > > _syncers
Definition: model-views.h:442
static const ImVec4 device_info_color
Definition: model-views.h:59
static const char * target_height_r
Definition: model-views.h:150
void outline_rect(const rect &r)
bool draw_option(rs2_option opt, bool update_read_only_options, std::string &error_message, notifications_model &model)
Definition: model-views.h:572
post_processing_filters(viewer_model &viewer)
Definition: model-views.h:877
std::shared_ptr< processing_block_model > get_pc_model() const
Definition: model-views.h:937
viewer_model & viewer
Definition: model-views.h:618
GLint first
static const ImVec4 button_color
Definition: model-views.h:55
option_range range
Definition: model-views.h:322
#define RS2_DEFAULT_TIMEOUT
Definition: rs_config.h:13
Definition: imgui.h:98
void start(S on_frame)
rs2::depth_huffman_decoder depth_decoder
Definition: model-views.h:959
std::unique_ptr< cah_model > _accuracy_health_model
Definition: model-views.h:826
static const ImVec4 dark_grey
Definition: model-views.h:49
void log_to_file(rs2_log_severity min_severity, const char *file_path=nullptr)
Definition: rs.hpp:26
std::string selected_file_preset
Definition: model-views.h:814
action
Definition: enums.py:62
static const ImVec4 header_color
Definition: model-views.h:57
static const ImVec4 dark_red
Definition: model-views.h:54
std::vector< std::pair< stream_profile, frame_callback > > configurations
Definition: recorder.h:485
std::unordered_map< int, frame_queue > _queues
Definition: model-views.h:359
std::vector< std::pair< int, int > > res_values
Definition: model-views.h:637
float x
Definition: imgui.h:100
rect get_stream_bounds() const
Definition: model-views.h:715
rs2_stream
Streams are different types of data provided by RealSense devices.
Definition: rs_sensor.h:42
static const textual_icon exit
Definition: model-views.h:254
static const textual_icon dotdotdot
Definition: model-views.h:256
static const textual_icon window_restore
Definition: model-views.h:252
std::array< std::pair< face, color >, 6 > colored_cube
Definition: model-views.h:451
static const ImVec4 black
Definition: model-views.h:43
std::chrono::duration< uint64_t, std::nano > nanoseconds
std::map< int, rect > streams_layout
Definition: model-views.h:304
static const textual_icon times
Definition: model-views.h:215
std::shared_ptr< processing_block_model > zero_order_artifact_fix
Definition: model-views.h:673
std::map< int, option_model > options_metadata
Definition: model-views.h:625
ImVec4 operator+(const ImVec4 &c, float v)
rs2_sensor_mode
For setting the camera_mode option.
Definition: rs_option.h:165
void save_processing_block_to_config_file(const char *name, std::shared_ptr< rs2::processing_block > pb, bool enable)
static const char * glsl_for_rendering
Definition: model-views.h:187
std::string pretty_time(std::chrono::nanoseconds duration)
static const char * font_oversample
Definition: model-views.h:193
static const textual_icon toggle_off
Definition: model-views.h:246
std::shared_ptr< atomic_objects_in_frame > get_detected_objects() const
Definition: model-views.h:791
GLsizei const GLfloat * values
static const textual_icon toggle_on
Definition: model-views.h:247
std::map< int, bool > prev_stream_enabled
Definition: model-views.h:631
void log_to_console(rs2_log_severity min_severity)
Definition: rs.hpp:19
GLdouble GLdouble GLint GLint GLdouble v1
std::pair< std::string, std::string > get_device_name(const device &dev)
std::array< char, 5 > _icon
Definition: model-views.h:115
3D vector in Euclidean coordinate space
Definition: rs_types.h:129
ImVec4 blend(const ImVec4 &c, float a)
Definition: model-views.h:77
fname
Definition: rmse.py:13
std::vector< std::shared_ptr< subdevice_model > > live_subdevices
Definition: model-views.h:864
static const char * is_fullscreen
Definition: model-views.h:176
std::vector< std::pair< std::string, std::string > > get_devices_names(const device_list &list)
GLdouble GLdouble GLdouble q
static const textual_icon window_maximize
Definition: model-views.h:251
static const textual_icon fix_up
Definition: model-views.h:230
static const char * settings_tab
Definition: model-views.h:153
subdevice_ui_selection ui
Definition: model-views.h:634
static const char * show_skybox
Definition: model-views.h:194
static const char * log_severity
Definition: model-views.h:163
static const char * search_term
Definition: model-views.h:158
static const textual_icon step_backward
Definition: model-views.h:222
static const char * continue_with_ui_not_aligned
Definition: model-views.h:151
std::vector< std::shared_ptr< processing_block_model > > post_processing
Definition: model-views.h:676
GLboolean enable
Definition: glext.h:5688
static auto it
static const ImVec4 scrollbar_grab
Definition: model-views.h:47
static const char * enable_writing
Definition: model-views.h:143
Definition: imgui.h:1392
GLuint GLsizei const GLchar * label
rs2::processing_block processing_block
Definition: model-views.h:954
static const textual_icon cube
Definition: model-views.h:262
const GLuint GLenum const void * binary
Definition: glext.h:1882
static const ImVec4 red
Definition: model-views.h:64
std::function< void(std::function< void()> load)> json_loading_func
Definition: model-views.h:760
static GLuint mesh
Definition: heightmap.c:113
static const char * maximized
Definition: model-views.h:183
static const ImVec4 yellowish
Definition: model-views.h:61
static const textual_icon camera
Definition: model-views.h:219
GLint GLsizei count
void reset_trajectory()
Definition: model-views.h:497
static const char * ground_truth_r
Definition: model-views.h:148
static const textual_icon bars
Definition: model-views.h:240
std::shared_ptr< std::thread > render_thread
Definition: model-views.h:963
static const char * enable_msaa
Definition: model-views.h:189
std::mutex _lookup_mutex
Definition: model-views.h:360
region_of_interest algo_roi
Definition: model-views.h:667
static const textual_icon metadata
Definition: model-views.h:259
utilities::number::stabilized_value< float > _stabilized_reflectivity
Definition: model-views.h:749
bool save_frame_raw_data(const std::string &filename, rs2::frame frame)
typename::boost::move_detail::remove_reference< T >::type && move(T &&t) BOOST_NOEXCEPT
static const char * position_x
Definition: model-views.h:178
std::vector< std::unique_ptr< device_model > > device_models_list
Definition: model-views.h:96
GLsizei GLsizei GLchar * source
std::shared_ptr< rs2::yuy_decoder > yuy2rgb
Definition: model-views.h:672
static const char * shading_mode
Definition: model-views.h:168
std::vector< std::shared_ptr< subdevice_model > > subdevices
Definition: model-views.h:794
bool _trajectory_tracking
Definition: model-views.h:541
std::map< int, std::vector< int > > fps_values_per_stream
Definition: model-views.h:638
utilities::time::periodic_timer _update_readonly_options_timer
Definition: model-views.h:865
static const char * encoding
Definition: model-views.h:201
static const ImVec4 redish
Definition: model-views.h:52
static const textual_icon square_o
Definition: model-views.h:236
std::map< int, rs2::frame_queue > frames_queue
Definition: model-views.h:933
int i
static const char * sw_updates_official_server
Definition: model-views.h:139
std::array< float, 3 > color
Definition: model-views.h:449
const GLdouble * v2
static const char * is_3d_view
Definition: model-views.h:147
static const char * show_map_ruler
Definition: model-views.h:165
static const textual_icon pause
Definition: model-views.h:224
static const textual_icon exclamation_triangle
Definition: model-views.h:232
static const ImVec4 yellow
Definition: model-views.h:60
std::map< int, std::vector< std::string > > formats
Definition: model-views.h:629
static const textual_icon measure
Definition: model-views.h:263
std::vector< stream_profile > profiles
Definition: model-views.h:643
std::vector< std::string > resolutions
Definition: model-views.h:626
static const char * recommend_updates
Definition: model-views.h:136
std::mutex _mutex
Definition: model-views.h:443
GLuint64EXT * result
Definition: glext.h:10921
static const textual_icon cubes
Definition: model-views.h:245
std::string get_tooltip()
Definition: model-views.h:470
GLdouble v
std::shared_ptr< rs2::asynchronous_syncer > create_syncer()
Definition: model-views.h:384
static const char * sdk_version
Definition: model-views.h:154
static const char * occlusion_invalidation
Definition: model-views.h:195
static const char * default_path
Definition: model-views.h:130
YYCODETYPE lhs
Definition: sqlite3.c:132469
static const ImVec4 dark_sensor_bg
Definition: model-views.h:63
GeneratorWrapper< T > map(Func &&function, GeneratorWrapper< U > &&generator)
Definition: catch.hpp:4271
std::shared_ptr< sw_update::dev_updates_profile::update_profile > _updates_profile
Definition: model-views.h:869
Definition: parser.hpp:150
subdevice_ui_selection last_valid_ui
Definition: model-views.h:635
static const char * file_save_mode
Definition: model-views.h:129
static const char * allow_rc_firmware
Definition: model-views.h:135
const size_t resulting_queue_max_size
Definition: model-views.h:932
std::shared_ptr< rs2::colorizer > depth_colorizer
Definition: model-views.h:671
GLint GLsizei width
float y
Definition: imgui.h:100
std::array< float3, 4 > face
Definition: model-views.h:450
rs2_timestamp_domain
Specifies the clock in relation to which the frame timestamp was measured.
Definition: rs_frame.h:19


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:22