measurement.cpp
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2020 Intel Corporation. All Rights Reserved.
3 
4 #include "measurement.h"
5 
7 
8 using namespace rs2;
9 
11  measurement_active = true;
13 }
15  state.points.clear();
16  state.edges.clear();
17  measurement_active = false;
19 }
21 
23  return !(measurement_active && state.points.size() == 1) && !measurement_point_hovered;
24 }
25 
27 
28 std::vector<int> measurement_state::find_path(int from, int to)
29 {
30  std::map<int, int> parents;
31  std::deque<int> q;
32 
33  q.push_back(from);
34  for (int i = 0; i < points.size(); i++)
35  {
36  parents[i] = -1;
37  }
38 
39  while (q.size())
40  {
41  auto vert = q.front();
42  q.pop_front();
43 
44  for (auto&& pair : edges)
45  {
46  int next = -1;
47  if (pair.first == vert) next = pair.second;
48  if (pair.second == vert) next = pair.first;
49  if (next >= 0 && parents[next] == -1)
50  {
51  parents[next] = vert;
52  q.push_back(next);
53  }
54  }
55  }
56 
57  std::vector<int> path;
58  parents[from] = -1;
59 
60  if (parents[to] != -1)
61  {
62  auto p = to;
63  while (p != -1)
64  {
65  path.push_back(p);
66  p = parents[p];
67  }
68  }
69 
70  return path;
71 }
72 
74 {
76 
77  if (is_enabled())
78  {
79  commit_state();
80 
81  if (state.points.size() >= 2 && !shift)
82  {
83  state.points.clear();
84  state.edges.clear();
85  state.polygons.clear();
86  }
87 
88  int last = int(state.points.size());
89  if (current_hovered_point == -1 ||
90  current_hovered_point >= state.points.size())
91  {
92  state.points.push_back(p);
93  }
94  else
95  {
96  last = current_hovered_point;
97  }
98 
99  int prev = last - 1;
100  if (last_hovered_point >= 0 && last_hovered_point < state.points.size())
101  prev = last_hovered_point;
102 
103  if (state.edges.size())
104  {
105  auto path = state.find_path(prev, last);
106  if (path.size())
107  {
108  state.polygons.push_back(path);
109 
110  std::vector<float3> poly;
111  for (auto&& idx : path) poly.push_back(state.points[idx].pos);
112 
113  auto area = calculate_area(poly);
114  log_function(to_string() << "Measured area of " << area_to_string(area));
115  }
116  }
117 
118  if (state.points.size() >= 2)
119  {
120  auto dist = state.points[last].pos - state.points[prev].pos;
121  state.edges.push_back(std::make_pair(last, prev));
122  log_function(to_string() << "Measured distance of " << length_to_string(dist.length()));
123  }
124 
125  last_hovered_point = int(state.points.size() - 1);
126 
127  commit_state();
128  }
129 }
130 
132 {
133  return to_string() << std::setprecision(2) << area << " m";
134 }
135 
137 {
139  if (is_metric())
140  {
141  if (distance < 0.01f)
142  {
143  label = to_string() << std::setprecision(3) << distance * 1000.f << " mm";
144  } else if (distance < 1.f) {
145  label = to_string() << std::setprecision(3) << distance * 100.f << " cm";
146  } else {
147  label = to_string() << std::setprecision(3) << distance << " m";
148  }
149  } else
150  {
151  if (distance < 0.0254f)
152  {
153  label = to_string() << std::setprecision(3) << distance * 1000.f << " mm";
154  } else if (distance < 0.3048f) {
155  label = to_string() << std::setprecision(3) << distance / 0.0254 << " in";
156  } else if (distance < 0.9144) {
157  label = to_string() << std::setprecision(3) << distance / 0.3048f << " ft";
158  } else {
159  label = to_string() << std::setprecision(3) << distance / 0.9144 << " yd";
160  }
161  }
162  return label;
163 }
164 
165 float measurement::calculate_area(std::vector<float3> poly)
166 {
167  if (poly.size() < 3) return 0.f;
168 
169  float3 total{ 0.f, 0.f, 0.f };
170 
171  for (int i = 0; i < poly.size(); i++)
172  {
173  auto v1 = poly[i];
174  auto v2 = poly[(i+1) % poly.size()];
175  auto prod = cross(v1, v2);
176  total = total + prod;
177  }
178 
179  auto a = poly[1] - poly[0];
180  auto b = poly[2] - poly[0];
181  auto n = cross(a, b);
182  return abs(total * n.normalize()) / 2;
183 }
184 
185 void draw_sphere(const float3& pos, float r, int lats, int longs)
186 {
187  for(int i = 0; i <= lats; i++)
188  {
189  float lat0 = float(M_PI) * (-0.5f + (float) (i - 1) / lats);
190  float z0 = sin(lat0);
191  float zr0 = cos(lat0);
192 
193  float lat1 = float(M_PI) * (-0.5f + (float) i / lats);
194  float z1 = sin(lat1);
195  float zr1 = cos(lat1);
196 
198  for(int j = 0; j <= longs; j++)
199  {
200  float lng = 2.f * float(M_PI) * (float) (j - 1) / longs;
201  float x = cos(lng);
202  float y = sin(lng);
203 
204  glNormal3f(pos.x + x * zr0, pos.y + y * zr0, pos.z + z0);
205  glVertex3f(pos.x + r * x * zr0, pos.y + r * y * zr0, pos.z + r * z0);
206  glNormal3f(pos.x + x * zr1, pos.y + y * zr1, pos.z + z1);
207  glVertex3f(pos.x + r * x * zr1, pos.y + r * y * zr1, pos.z + r * z1);
208  }
209  glEnd();
210  }
211 }
212 
214 {
215  int32_t vp[4];
217  check_gl_error();
218 
219  GLfloat model[16];
221  GLfloat proj[16];
223 
224  rs2::matrix4 p(proj);
225  rs2::matrix4 v(model);
226 
227  return translate_3d_to_2d(pos, p, v, rs2::matrix4::identity(), vp);
228 }
229 
230 void measurement::draw_label(ux_window& win, float3 pos, float distance, int height, bool is_area)
231 {
232  auto w_pos = project_to_2d(pos);
233  std::string label = is_area ? area_to_string(distance) : length_to_string(distance);
234  if (is_area) ImGui::PushFont(win.get_large_font());
235  auto size = ImGui::CalcTextSize(label.c_str());
236  if (is_area) ImGui::PopFont();
237 
238  std::string win_id = to_string() << "measurement_" << id;
239  id++;
240 
242 
243  if (!is_area)
244  {
247  }
248  else
249  {
252  }
254  ImGui::SetNextWindowPos(ImVec2(w_pos.x - size.x / 2, height - w_pos.y - size.y / 2 - 5));
255  ImGui::SetNextWindowSize(ImVec2(size.x + 20, size.y - 15));
256  ImGui::Begin(win_id.c_str(), nullptr, flags);
257 
258  if (is_area) ImGui::PushFont(win.get_large_font());
259  ImGui::Text("%s", label.c_str());
260  if (is_area) {
261  ImGui::PopFont();
262  ImGui::SameLine();
264  ImGui::Text("%s", "2");
265  }
266 
267  ImGui::End();
270 }
271 
272 void measurement::draw_ruler(ux_window& win, float3 from, float3 to, float height, int selected)
273 {
274  std::vector<float3> parts;
275  parts.push_back(from);
276  auto dir = to - from;
277  auto l = dir.length();
278  auto unit = is_metric() ? 0.01f : 0.0254f;
279  if (l > 0.5f) unit = is_metric() ? 0.1f : 0.03048f;
280  auto parts_num = l / unit;
281  for (int i = 0; i < parts_num; i++)
282  {
283  auto t = i / (float)parts_num;
284  parts.push_back(from + dir * t);
285  }
286  parts.push_back(to);
287 
288  glLineWidth(3.f);
289  glBegin(GL_LINES);
290  for (int i = 1; i < parts.size(); i++)
291  {
292  auto alpha = selected == 0 ? 0.4f : 0.9f;
293  alpha = selected == 2 ? 1.f : alpha;
294  if (i % 2 == 0) glColor4f(1.f, 1.f, 1.f, alpha);
296  auto from = parts[i-1];
297  auto to = parts[i]; // intentional shadowing
298  glVertex3d(from.x, from.y, from.z);
299  glVertex3d(to.x, to.y, to.z);
300  }
301  glEnd();
302 
303  if (selected == 2)
304  {
305  // calculate center of the ruler line
306  float3 ctr = from + (to - from) / 2;
307  float distance = (to - from).length();
308  draw_label(win, ctr, distance, int(height));
309  }
310 }
311 
313 {
314  _picked = picked; _normal = normal;
316 
317  if (input_ctrl.click) {
318  add_point({ _picked, _normal });
319  }
320 
321  if (is_enabled())
322  {
323  if (point_hovered(win) < 0 && hovered_edge_id < 0)
324  win.cross_hovered();
325  }
326 }
327 
328 void measurement::update_input(ux_window& win, const rs2::rect& viewer_rect)
329 {
330  id = 0;
331 
332  if (ImGui::IsKeyPressed('Z') || ImGui::IsKeyPressed('z'))
333  restore_state();
334 
336 
337  auto rect_copy = viewer_rect;
338  rect_copy.y += 60;
339  input_ctrl.click = false;
340  if (win.get_mouse().mouse_down[0] && !input_ctrl.mouse_down)
341  {
342  input_ctrl.mouse_down = true;
345  }
346  if (input_ctrl.mouse_down && !win.get_mouse().mouse_down[0])
347  {
348  input_ctrl.mouse_down = false;
349  if (win.time() - input_ctrl.selection_started < 0.5 &&
350  (win.get_mouse().cursor - input_ctrl.down_pos).length() < 100)
351  {
352  if (rect_copy.contains(win.get_mouse().cursor))
353  {
354  input_ctrl.click = true;
355  input_ctrl.click_time = float(glfwGetTime());
356  }
357  }
358  }
359 }
360 
362 {
363  for (int i = 0; i < state.points.size(); i++)
364  {
365  auto&& point = state.points[i];
366  auto pos_2d = project_to_2d(point.pos);
367  pos_2d.y = win.framebuf_height() - pos_2d.y;
368 
369  if ((pos_2d - win.get_mouse().cursor).length() < 15)
370  {
371  return i;
372  }
373  }
374  return -1;
375 }
376 
378 {
379  const float l2 = dot(b - a, b - a);
380  if (l2 == 0.0) return (p - a).length();
381  const float t = clamp(dot(p - a, b - a) / l2, 0.f, 1.f);
382  return (lerp(a, b, t) - p).length();
383 }
384 
386 {
387  for (int i = 0; i < state.edges.size(); i++)
388  {
389  auto&& a = state.points[state.edges[i].first];
390  auto&& b = state.points[state.edges[i].second];
391 
392  auto a_2d = project_to_2d(a.pos);
393  auto b_2d = project_to_2d(b.pos);
394 
395  auto cursor = win.get_mouse().cursor;
396  cursor.y = win.framebuf_height() - cursor.y;
397 
398  if (distance_to_line(a_2d, b_2d, cursor) < 15)
399  {
400  return i;
401  }
402  }
403  return -1;
404 }
405 
407 {
408  state_history.push_back(state);
409  if (state_history.size() > 100)
410  {
411  state_history.pop_front();
412  }
413 }
414 
416 {
417  auto new_state = state;
418  while (state_history.size() && new_state == state)
419  {
420  new_state = state_history.back();
421  state_history.pop_back();
422  }
423  state = new_state;
424 }
425 
427 {
429 
430  auto p_idx = point_hovered(win);
431  if (p_idx >= 0 && !win.get_mouse().mouse_down[0])
432  {
433  _picked = state.points[p_idx].pos;
434  _normal = state.points[p_idx].normal;
435  }
437  {
439  glLineWidth(2.f);
442 
443  float size = _picked.z * 0.03f;
444 
445  glBegin(GL_LINES);
446  glColor3f(1.f, 1.f, 1.f);
448  auto nend = _picked + _normal * size * 0.3f;
449  glVertex3d(nend.x, nend.y, nend.z);
450  glEnd();
451 
453 
454  if (input_ctrl.mouse_down) size -= _picked.z * 0.01f;
455  size += _picked.z * 0.01f * single_wave(input_ctrl.click_period());
456 
457  auto axis1 = cross(vec3d{ _normal.x, _normal.y, _normal.z }, vec3d{ 0.f, 1.f, 0.f });
458  auto faxis1 = float3 { axis1.x, axis1.y, axis1.z };
459  faxis1.normalize();
460  auto axis2 = cross(vec3d{ _normal.x, _normal.y, _normal.z }, axis1);
461  auto faxis2 = float3 { axis2.x, axis2.y, axis2.z };
462  faxis2.normalize();
463 
464  matrix4 basis = matrix4::identity();
465  basis(0, 0) = faxis1.x;
466  basis(0, 1) = faxis1.y;
467  basis(0, 2) = faxis1.z;
468 
469  basis(1, 0) = faxis2.x;
470  basis(1, 1) = faxis2.y;
471  basis(1, 2) = faxis2.z;
472 
473  basis(2, 0) = _normal.x;
474  basis(2, 1) = _normal.y;
475  basis(2, 2) = _normal.z;
476 
477  const int segments = 50;
478  for (int i = 0; i < segments; i++)
479  {
480  auto t1 = 2.f * float(M_PI) * ((float)i / segments);
481  auto t2 = 2.f * float(M_PI) * ((float)(i+1) / segments);
482  float4 xy1 { cosf(t1) * size, sinf(t1) * size, 0.f, 1.f };
483  xy1 = basis * xy1;
484  xy1 = float4 { _picked.x + xy1.x, _picked.y + xy1.y, _picked.z + xy1.z, 1.f };
485  float4 xy2 { cosf(t1) * size * 0.5f, sinf(t1) * size * 0.5f, 0.f, 1.f };
486  xy2 = basis * xy2;
487  xy2 = float4 { _picked.x + xy2.x, _picked.y + xy2.y, _picked.z + xy2.z, 1.f };
488  float4 xy3 { cosf(t2) * size * 0.5f, sinf(t2) * size * 0.5f, 0.f, 1.f };
489  xy3 = basis * xy3;
490  xy3 = float4 { _picked.x + xy3.x, _picked.y + xy3.y, _picked.z + xy3.z, 1.f };
491  float4 xy4 { cosf(t2) * size, sinf(t2) * size, 0.f, 1.f };
492  xy4 = basis * xy4;
493  xy4 = float4 { _picked.x + xy4.x, _picked.y + xy4.y, _picked.z + xy4.z, 1.f };
494  //glVertex3fv(&_picked.x);
495 
496  glColor4f(white.x, white.y, white.z, 0.5f);
497  glVertex3fv(&xy1.x);
498  glColor4f(white.x, white.y, white.z, 0.8f);
499  glVertex3fv(&xy2.x);
500  glVertex3fv(&xy3.x);
501 
502  glColor4f(white.x, white.y, white.z, 0.5f);
503  glVertex3fv(&xy1.x);
504  glVertex3fv(&xy4.x);
505  glColor4f(white.x, white.y, white.z, 0.8f);
506  glVertex3fv(&xy3.x);
507  }
508  //glVertex3fv(&_picked.x); glVertex3fv(&end.x);
509  glEnd();
510 
511  if (state.points.size() == 1 || (shift && state.points.size()))
512  {
513  auto p0 = (last_hovered_point >= 0 && last_hovered_point < state.points.size())
514  ? state.points[last_hovered_point] : state.points.back();
515  draw_ruler(win, _picked, p0.pos, win.framebuf_height(), 2);
516  }
517 
520  }
521 
524 
526 
527  for (auto&& poly : state.polygons)
528  {
529  auto ancor = state.points[poly.front()];
530 
531  std::vector<float3> points;
532  points.push_back(ancor.pos);
533 
534  auto mid = ancor.pos;
535 
537 
540  for (int i = 0; i < poly.size() - 1; i++)
541  {
542  auto b = state.points[poly[i]];
543  auto c = state.points[poly[i+1]];
544  glVertex3fv(&ancor.pos.x);
545  glVertex3fv(&b.pos.x);
546  glVertex3fv(&c.pos.x);
547  mid = mid + c.pos;
548  points.push_back(c.pos);
549  }
550  glEnd();
551 
553 
554  mid = mid * (1.f / poly.size());
555 
556  auto area = calculate_area(points);
557 
558  draw_label(win, mid, area, int(win.framebuf_height()), true);
559  }
560 
561  for (int i = 0; i < state.edges.size(); i++)
562  {
563  auto&& pair = state.edges[i];
565  int selected = 1;
566  if (hovered_edge_id >= 0)
567  selected = hovered_edge_id == i ? 2 : 0;
568  draw_ruler(win, state.points[pair.second].pos, state.points[pair.first].pos, win.framebuf_height(), selected);
570  }
571 
572  if (win.get_mouse().mouse_down[1]) {
573  commit_state();
574  state.points.clear();
575  state.edges.clear();
576  state.polygons.clear();
577  }
578 
579  for (auto&& points: state.points)
580  {
582  draw_sphere(points.pos, 0.011f, 20, 20);
583  }
585 
588  int hovered_point = point_hovered(win);
589  if (hovered_point >= 0)
590  {
591  if (!shift) last_hovered_point = hovered_point;
592  current_hovered_point = hovered_point;
594  {
595  dragging_point_index = hovered_point;
597  if (input_ctrl.click_period() > 0.5f)
598  {
600  }
601  }
602  }
603 
604  int i = 0;
605  for (auto&& points: state.points)
606  {
608  glColor4f(white.x, white.y, white.z, dragging_point_index == i ? 0.8f : 0.1f);
609  else
610  glColor4f(white.x, white.y, white.z, 0.6f);
611 
612  draw_sphere(points.pos, dragging_point_index == i ? 0.012f : 0.008f, 20, 20);
613  i++;
614  }
615 
618 
619  if (!win.get_mouse().mouse_down[0] || input_ctrl.click_period() < 0.5f)
620  {
621  if (dragging_measurement_point && state.points.size() >= 2)
622  {
625 
626  for (auto&& e : state.edges)
627  {
628  if (e.first == dragging_point_index || e.second == dragging_point_index)
629  {
630  auto dist = state.points[e.first].pos - state.points[e.second].pos;
631  log_function(to_string() << "Adjusted measurement to " << length_to_string(dist.length()));
632  }
633  }
634 
635  for (auto&& path : state.polygons)
636  {
637  if (std::find(path.begin(), path.end(), dragging_point_index) != path.end())
638  {
639  std::vector<float3> poly;
640  for (auto&& idx : path) poly.push_back(state.points[idx].pos);
641 
642  auto area = calculate_area(poly);
643  log_function(to_string() << "Adjusted area of " << area_to_string(area));
644  }
645  }
646 
647  commit_state();
648  }
650  }
652  {
653  state.points[dragging_point_index].pos = _picked;
654  }
655 
656  if (point_hovered(win) >= 0 || hovered_edge_id >= 0)
657  win.link_hovered();
658 }
659 
661 {
662  if (mouse_picked_event.eval())
663  {
665  {
666  std::string tt = to_string() << std::fixed << std::setprecision(3)
667  << _picked.x << ", " << _picked.y << ", " << _picked.z << " meters";
668  ImGui::SetTooltip("%s", tt.c_str());
669  }
670  }
671 }
float y
Definition: rendering.h:499
float3 cross(const float3 &a, const float3 &b)
Definition: rendering.h:153
IMGUI_API void PushStyleVar(ImGuiStyleVar idx, float val)
Definition: imgui.cpp:4650
static const ImVec4 transparent
Definition: model-views.h:44
float lerp(float a, float b, float t)
Definition: rendering.h:122
static const ImVec4 white
Definition: model-views.h:45
std::vector< int > find_path(int from, int to)
Definition: measurement.cpp:28
IMGUI_API float GetCursorPosX()
Definition: imgui.cpp:5082
IMGUI_API bool IsKeyPressed(int key_index, bool repeat=true)
Definition: imgui.cpp:3068
GLboolean GLboolean GLboolean b
std::string length_to_string(float distance)
GLint y
static matrix4 identity()
Definition: rendering.h:281
static const char * is_measuring
Definition: model-views.h:156
IMGUI_API void SetTooltip(const char *fmt,...) IM_PRINTFARGS(1)
Definition: imgui.cpp:3288
khronos_float_t GLfloat
static const ImVec4 almost_white_bg
Definition: model-views.h:42
#define GL_QUAD_STRIP
std::deque< measurement_state > state_history
Definition: measurement.h:78
#define glBegin
GLfloat GLfloat p
Definition: glext.h:12687
Definition: imgui.h:88
#define glGetIntegerv
bool measurement_active
Definition: measurement.h:83
static config_file & instance()
Definition: rs-config.cpp:80
mouse_control input_ctrl
Definition: measurement.h:102
static const ImVec4 light_blue
Definition: model-views.h:38
GLsizei const GLchar *const * path
Definition: glext.h:4276
IMGUI_API void SetNextWindowPos(const ImVec2 &pos, ImGuiSetCond cond=0)
Definition: imgui.cpp:4923
void update_input(ux_window &win, const rs2::rect &viewer_rect)
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t1
Definition: glext.h:9721
#define glVertex3fv
#define GLFW_KEY_LEFT_SHIFT
Definition: glfw3.h:473
#define glVertex3d
Definition: cah-model.h:10
GLsizei const GLchar *const * string
#define GL_BLEND
std::function< bool()> is_metric
Definition: measurement.h:69
void draw_sphere(const float3 &pos, float r, int lats, int longs)
bool measurement_point_hovered
Definition: measurement.h:82
void add_point(interest_point p)
Definition: measurement.cpp:73
GLdouble n
Definition: glext.h:1966
normal
Definition: rmse.py:164
#define glColor4f
#define glVertex3f
float distance_to_line(rs2::float2 a, rs2::float2 b, rs2::float2 p)
#define GL_SRC_ALPHA
e
Definition: rmse.py:177
GLsizei GLsizei GLfloat distance
Definition: glext.h:10563
point
Definition: rmse.py:166
#define glEnable
#define glGetFloatv
bool manipulating() const
Definition: measurement.cpp:26
GLdouble t
float calculate_area(std::vector< float3 > points)
GLboolean GLboolean GLboolean GLboolean a
size_t size() const
Definition: rs_frame.hpp:800
int current_hovered_point
Definition: measurement.h:86
IMGUI_API void SameLine(float pos_x=0.0f, float spacing_w=-1.0f)
Definition: imgui.cpp:9246
GLdouble f
temporal_event mouse_picked_event
Definition: measurement.h:88
GLfloat GLfloat GLfloat alpha
IMGUI_API bool Begin(const char *name, bool *p_open=NULL, ImGuiWindowFlags flags=0)
Definition: imgui.cpp:3772
IMGUI_API void PopStyleVar(int count=1)
Definition: imgui.cpp:4675
GLsizeiptr size
IMGUI_API ImVec2 CalcTextSize(const char *text, const char *text_end=NULL, bool hide_text_after_double_hash=false, float wrap_width=-1.0f)
Definition: test-wrap.cpp:15
#define GL_VIEWPORT
static const ImVec4 regular_blue
Definition: model-views.h:39
const GLubyte * c
Definition: glext.h:12690
void draw_ruler(ux_window &win, float3 from, float3 to, float height, int selected)
GLdouble GLdouble r
#define GL_LINES
GLdouble x
#define glLineWidth
double time() const
Definition: ux-window.h:85
#define GL_PROJECTION_MATRIX
void draw_label(ux_window &win, float3 pos, float distance, int height, bool is_area=false)
GLint GLsizei GLsizei height
float single_wave(float x)
Definition: rendering.h:1643
IMGUI_API void SetNextWindowSize(const ImVec2 &size, ImGuiSetCond cond=0)
Definition: imgui.cpp:4937
float dot(const rs2::float2 &a, const rs2::float2 &b)
Definition: rendering.h:200
float z
Definition: imgui.h:100
int point_hovered(ux_window &win)
GLbitfield flags
def find(dir, mask)
Definition: file.py:25
#define glNormal3f
IMGUI_API void SetCursorPosX(float x)
Definition: imgui.cpp:5101
void mouse_pick(ux_window &win, float3 picked, float3 normal)
#define glEnd
GLint j
IMGUI_API void Text(const char *fmt,...) IM_PRINTFARGS(1)
Definition: imgui.cpp:5223
int dragging_point_index
Definition: measurement.h:81
IMGUI_API void End()
Definition: imgui.cpp:4330
const base::type::char_t * unit
int edge_hovered(ux_window &win)
bool mouse_down[2]
Definition: rendering.h:478
ImVec4 alpha(const ImVec4 &v, float a)
float x
Definition: imgui.h:100
bool dragging_measurement_point
Definition: measurement.h:80
measurement_state state
Definition: measurement.h:77
#define GL_ONE_MINUS_SRC_ALPHA
void add_value(bool val)
Definition: rendering.h:818
IMGUI_API void PushStyleColor(ImGuiCol idx, const ImVec4 &col)
Definition: imgui.cpp:4599
rs2::float2 project_to_2d(rs2::float3 pos)
IMGUI_API void PushFont(ImFont *font)
Definition: imgui.cpp:4539
float framebuf_height() const
Definition: ux-window.h:45
GLdouble GLdouble GLint GLint GLdouble v1
void next(auto_any_t cur, type2type< T, C > *)
Definition: foreach.hpp:757
bool is_enabled() const
Definition: measurement.cpp:20
GLFWAPI double glfwGetTime(void)
Returns the value of the GLFW timer.
Definition: input.c:1275
#define glColor3f
std::string area_to_string(float area)
GLdouble GLdouble GLdouble q
void set(const char *key, const char *value)
Definition: rs-config.cpp:15
std::function< void(std::string)> log_function
Definition: measurement.h:68
bool display_mouse_picked_tooltip() const
Definition: measurement.cpp:22
void draw(ux_window &win)
GLuint GLsizei const GLchar * label
float clamp(float x, float min, float max)
Definition: rendering.h:103
#define GL_MODELVIEW_MATRIX
float rs2_vector::* pos
GLuint segments
Definition: glext.h:9587
int i
GLenum GLuint GLenum GLsizei length
const GLdouble * v2
float2 translate_3d_to_2d(float3 point, matrix4 p, matrix4 v, matrix4 f, int32_t vp[4])
Definition: rendering.h:1650
signed int int32_t
Definition: stdint.h:77
IMGUI_API bool IsKeyDown(int key_index)
Definition: imgui.cpp:3061
ImFont * get_large_font() const
Definition: ux-window.h:62
void cross_hovered()
Definition: ux-window.cpp:171
#define glBlendFunc
#define check_gl_error()
Definition: opengl3.h:17
#define GLFW_KEY_RIGHT_SHIFT
Definition: glfw3.h:477
void link_hovered()
Definition: ux-window.cpp:166
GLdouble v
void show_tooltip(ux_window &win)
GLdouble GLdouble GLint GLint const GLdouble * points
IMGUI_API void PopFont()
Definition: imgui.cpp:4549
#define GL_TRIANGLES
#define GL_DEPTH_TEST
float y
Definition: imgui.h:100
IMGUI_API void PopStyleColor(int count=1)
Definition: imgui.cpp:4609
rs2::mouse_info & get_mouse()
Definition: ux-window.h:66
#define glDisable
std::string to_string(T value)


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