Classes | Public Types | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
rs2::viewer_model Class Reference

#include <viewer.h>


struct  rgb
struct  rgb_per_distance

Public Types

enum  export_type { ply }
enum  shader_type { shader_type::points, shader_type::flat, shader_type::diffuse }

Public Member Functions

void begin_stream (std::shared_ptr< subdevice_model > d, rs2::stream_profile p)
std::map< int, rectcalc_layout (const rect &r)
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 gc_streams ()
frame get_3d_depth_source (frame f)
frame get_3d_texture_source (frame f)
std::vector< frameget_frames (frame set)
std::shared_ptr< texture_bufferget_last_texture ()
float get_output_height () const
rs2::frame handle_ready_frames (const rect &viewer_rect, ux_window &window, int devices, std::string &error_message)
bool is_3d_depth_source (frame f)
bool is_3d_texture_source (frame f) const
bool is_option_skipped (rs2_option opt) const
void popup_firmware_update_progress (const ux_window &window, const float progress)
void popup_if_error (const ux_window &window, std::string &error_message)
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)
void render_3d_view (const rect &view_rect, ux_window &win, std::shared_ptr< texture_buffer > texture, rs2::points points)
void render_pose (rs2::rect stream_rect, float buttons_heights)
void reset_camera (float3 pos={0.0f, 0.0f,-1.0f})
void show_3dviewer_header (ux_window &window, rs2::rect stream_rect, bool &paused, std::string &error_message)
void show_no_device_overlay (ImFont *font, int min_x, int min_y)
void show_no_stream_overlay (ImFont *font, int min_x, int min_y, int max_x, int max_y)
void show_paused_icon (ImFont *font, int x, int y, int id)
void show_popup (const ux_window &window, const popup &p)
void show_recording_icon (ImFont *font_18, int x, int y, int id, float alpha_delta)
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)
void try_select_pointcloud (ux_window &win)
void update_3d_camera (ux_window &win, const rect &viewer_rect, bool force=false)
void update_configuration ()
std::shared_ptr< texture_bufferupload_frame (frame &&f)
 viewer_model (context &ctx_)
 ~viewer_model ()

Public Attributes

std::unordered_set< int > _hidden_options
bool _support_ir_reflectivity
bool allow_3d_source_change = true
bool allow_stream_close = true
bool continue_with_current_fw = false
float dim_level = 1.f
bool draw_frustrum = true
bool draw_plane = false
std::map< export_type, export_modelexporters
frameset_allocator frameset_alloc
bool fullscreen = false
bool glsl_available = false
press_button_model grid_object_button { u8"\uf1cb", u8"\uf1cb", "Configure Grid", "Configure Grid", false }
uint32_t ground_truth_r = 1200
bool is_3d_view = false
std::vector< int > last_tex_sources
bool metric_system = true
bool modal_notification_on = false
std::shared_ptr< notifications_modelnot_model = std::make_shared<notifications_model>()
bool occlusion_invalidation = true
const float panel_width = 340.f
const float panel_y = 50.f
bool paused = false
press_button_model pose_info_object_button { u8"\uf05a", u8"\uf05a", "Show pose stream info overlay", "Hide pose stream info overlay", false }
post_processing_filters ppf
std::array< float3, 4 > roi_rect
bool select_3d_source = false
bool select_shader_source = false
bool select_tex_source = false
int selected_depth_source_uid = -1
shader_type selected_shader = shader_type::diffuse
stream_modelselected_stream = nullptr
int selected_tex_source_uid = -1
bool show_help_screen = false
std::map< int, stream_modelstreams
std::mutex streams_mutex
std::map< int, int > streams_origin
bool support_non_syncronized_mode = true
std::shared_ptr< syncer_modelsyncer
std::atomic< bool > synchronization_enable
std::atomic< bool > synchronization_enable_prev_state
double texture_update_time = 0.0
press_button_model trajectory_button { u8"\uf1b0", u8"\uf1b0","Draw trajectory", "Stop drawing trajectory", true }
std::shared_ptr< updates_modelupdates
std::atomic< int > zo_sensors

Private Member Functions

float calculate_ruler_max_distance (const std::vector< float > &distances) const
void check_permissions ()
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)
std::map< int, rectget_interpolated_layout (const std::map< int, rect > &l)
void hide_common_options ()
void set_export_popup (ImFont *large_font, ImFont *font, rect stream_rect, std::string &error_message, config_file &temp_cfg)
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="")

Private Attributes

std::vector< popup_active_popups
rs2::gl::camera_renderer _cam_renderer
streams_layout _layout
measurement _measurements
streams_layout _old_layout
rs2::gl::pointcloud_renderer _pc_renderer
bool _pc_selected = false
skybox _skybox
std::chrono::high_resolution_clock::time_point _transition_start_time
bool fixed_up = true
rs2::points last_points
std::shared_ptr< texture_bufferlast_texture
bool manipulating = false
temporal_event origin_occluded { std::chrono::milliseconds(3000) }
float2 overflow = { 0.f, 0.f }
float3 pos = { 0.0f, 0.0f, -0.5f }
bool show_skybox = true
float3 target = { 0.0f, 0.0f, 0.0f }
GLint texture_border_mode = GL_CLAMP_TO_EDGE
float3 up
float view [16]


class post_processing_filters

Detailed Description

Definition at line 56 of file viewer.h.

Member Enumeration Documentation


Definition at line 139 of file viewer.h.


Definition at line 167 of file viewer.h.

Constructor & Destructor Documentation

rs2::viewer_model::~viewer_model ( )

Definition at line 70 of file viewer.h.

rs2::viewer_model::viewer_model ( context ctx_)

Definition at line 952 of file viewer.cpp.

Member Function Documentation

void rs2::viewer_model::begin_stream ( std::shared_ptr< subdevice_model d,
rs2::stream_profile  p 

Definition at line 3228 of file viewer.cpp.

std::map< int, rect > rs2::viewer_model::calc_layout ( const rect r)

Definition at line 1291 of file viewer.cpp.

float rs2::viewer_model::calculate_ruler_max_distance ( const std::vector< float > &  distances) const

Definition at line 1632 of file viewer.cpp.

void rs2::viewer_model::check_permissions ( )

Definition at line 766 of file viewer.cpp.

void rs2::viewer_model::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 

Definition at line 1479 of file viewer.cpp.

void rs2::viewer_model::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() 

Definition at line 3318 of file viewer.cpp.

void rs2::viewer_model::gc_streams ( )

Definition at line 977 of file viewer.cpp.

frame rs2::viewer_model::get_3d_depth_source ( frame  f)

Definition at line 3269 of file viewer.cpp.

frame rs2::viewer_model::get_3d_texture_source ( frame  f)

Definition at line 3281 of file viewer.cpp.

std::vector< frame > rs2::viewer_model::get_frames ( frame  set)

Definition at line 3255 of file viewer.cpp.

std::map< int, rect > rs2::viewer_model::get_interpolated_layout ( const std::map< int, rect > &  l)

Definition at line 3398 of file viewer.cpp.

std::shared_ptr< texture_buffer > rs2::viewer_model::get_last_texture ( )

Definition at line 3250 of file viewer.cpp.

float rs2::viewer_model::get_output_height ( ) const

Definition at line 66 of file viewer.h.

rs2::frame rs2::viewer_model::handle_ready_frames ( const rect viewer_rect,
ux_window window,
int  devices,
std::string error_message 

Definition at line 1335 of file viewer.cpp.

void rs2::viewer_model::hide_common_options ( )

Definition at line 872 of file viewer.cpp.

bool rs2::viewer_model::is_3d_depth_source ( frame  f)

Definition at line 3293 of file viewer.cpp.

bool rs2::viewer_model::is_3d_texture_source ( frame  f) const

Definition at line 3236 of file viewer.cpp.

bool rs2::viewer_model::is_option_skipped ( rs2_option  opt) const

Definition at line 1014 of file viewer.cpp.

void rs2::viewer_model::popup_firmware_update_progress ( const ux_window window,
const float  progress 

Definition at line 1142 of file viewer.cpp.

void rs2::viewer_model::popup_if_error ( const ux_window window,
std::string error_message 

Definition at line 1051 of file viewer.cpp.

void rs2::viewer_model::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 

Definition at line 1651 of file viewer.cpp.

void rs2::viewer_model::render_3d_view ( const rect view_rect,
ux_window win,
std::shared_ptr< texture_buffer texture,
rs2::points  points 

Definition at line 1934 of file viewer.cpp.

void rs2::viewer_model::render_pose ( rs2::rect  stream_rect,
float  buttons_heights 

Definition at line 53 of file viewer.cpp.

void rs2::viewer_model::reset_camera ( float3  pos = { 0.0f, 0.0f, -1.0f })

Definition at line 1449 of file viewer.cpp.

void rs2::viewer_model::set_export_popup ( ImFont large_font,
ImFont font,
rect  stream_rect,
std::string error_message,
config_file temp_cfg 

Definition at line 117 of file viewer.cpp.

void rs2::viewer_model::show_3dviewer_header ( ux_window window,
rs2::rect  stream_rect,
bool &  paused,
std::string error_message 

Definition at line 379 of file viewer.cpp.

void rs2::viewer_model::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 = "" 

Definition at line 1161 of file viewer.cpp.

void rs2::viewer_model::show_no_device_overlay ( ImFont font,
int  min_x,
int  min_y 

Definition at line 1233 of file viewer.cpp.

void rs2::viewer_model::show_no_stream_overlay ( ImFont font,
int  min_x,
int  min_y,
int  max_x,
int  max_y 

Definition at line 1185 of file viewer.cpp.

void rs2::viewer_model::show_paused_icon ( ImFont font,
int  x,
int  y,
int  id 

Definition at line 1176 of file viewer.cpp.

void rs2::viewer_model::show_popup ( const ux_window window,
const popup p 

Definition at line 1019 of file viewer.cpp.

void rs2::viewer_model::show_recording_icon ( ImFont font_18,
int  x,
int  y,
int  id,
float  alpha_delta 

Definition at line 1180 of file viewer.cpp.

void rs2::viewer_model::show_rendering_not_supported ( ImFont font_18,
int  min_x,
int  min_y,
int  max_x,
int  max_y,
rs2_format  format 

Definition at line 1202 of file viewer.cpp.

void rs2::viewer_model::show_top_bar ( ux_window window,
const rect viewer_rect,
const device_models_list devices 

Definition at line 2314 of file viewer.cpp.

void rs2::viewer_model::try_select_pointcloud ( ux_window win)
void rs2::viewer_model::update_3d_camera ( ux_window win,
const rect viewer_rect,
bool  force = false 

Definition at line 3066 of file viewer.cpp.

void rs2::viewer_model::update_configuration ( )

Definition at line 884 of file viewer.cpp.

std::shared_ptr< texture_buffer > rs2::viewer_model::upload_frame ( frame &&  f)

Definition at line 3305 of file viewer.cpp.

Friends And Related Function Documentation

friend class post_processing_filters

Definition at line 212 of file viewer.h.

Member Data Documentation

std::vector<popup> rs2::viewer_model::_active_popups

Definition at line 201 of file viewer.h.

rs2::gl::camera_renderer rs2::viewer_model::_cam_renderer

Definition at line 246 of file viewer.h.

std::unordered_set<int> rs2::viewer_model::_hidden_options

Definition at line 195 of file viewer.h.

streams_layout rs2::viewer_model::_layout

Definition at line 226 of file viewer.h.

measurement rs2::viewer_model::_measurements

Definition at line 258 of file viewer.h.

streams_layout rs2::viewer_model::_old_layout

Definition at line 227 of file viewer.h.

rs2::gl::pointcloud_renderer rs2::viewer_model::_pc_renderer

Definition at line 247 of file viewer.h.

bool rs2::viewer_model::_pc_selected = false

Definition at line 250 of file viewer.h.

skybox rs2::viewer_model::_skybox

Definition at line 256 of file viewer.h.

bool rs2::viewer_model::_support_ir_reflectivity

Definition at line 196 of file viewer.h.

std::chrono::high_resolution_clock::time_point rs2::viewer_model::_transition_start_time

Definition at line 228 of file viewer.h.

bool rs2::viewer_model::allow_3d_source_change = true

Definition at line 150 of file viewer.h.

bool rs2::viewer_model::allow_stream_close = true

Definition at line 151 of file viewer.h.

bool rs2::viewer_model::continue_with_current_fw = false

Definition at line 177 of file viewer.h.

context& rs2::viewer_model::ctx

Definition at line 132 of file viewer.h.

float rs2::viewer_model::dim_level = 1.f

Definition at line 175 of file viewer.h.

bool rs2::viewer_model::draw_frustrum = true

Definition at line 156 of file viewer.h.

bool rs2::viewer_model::draw_plane = false

Definition at line 154 of file viewer.h.

std::map<export_type, export_model> rs2::viewer_model::exporters

Definition at line 143 of file viewer.h.

bool rs2::viewer_model::fixed_up = true

Definition at line 234 of file viewer.h.

frameset_allocator rs2::viewer_model::frameset_alloc

Definition at line 144 of file viewer.h.

bool rs2::viewer_model::fullscreen = false

Definition at line 127 of file viewer.h.

bool rs2::viewer_model::glsl_available = false

Definition at line 184 of file viewer.h.

press_button_model rs2::viewer_model::grid_object_button { u8"\uf1cb", u8"\uf1cb", "Configure Grid", "Configure Grid", false }

Definition at line 188 of file viewer.h.

uint32_t rs2::viewer_model::ground_truth_r = 1200

Definition at line 137 of file viewer.h.

bool rs2::viewer_model::is_3d_view = false

Definition at line 134 of file viewer.h.

rs2::points rs2::viewer_model::last_points

Definition at line 239 of file viewer.h.

std::vector<int> rs2::viewer_model::last_tex_sources

Definition at line 164 of file viewer.h.

std::shared_ptr<texture_buffer> rs2::viewer_model::last_texture

Definition at line 240 of file viewer.h.

bool rs2::viewer_model::manipulating = false

Definition at line 243 of file viewer.h.

bool rs2::viewer_model::metric_system = true

Definition at line 136 of file viewer.h.

bool rs2::viewer_model::modal_notification_on = false

Definition at line 185 of file viewer.h.

std::shared_ptr<notifications_model> rs2::viewer_model::not_model = std::make_shared<notifications_model>()

Definition at line 133 of file viewer.h.

bool rs2::viewer_model::occlusion_invalidation = true

Definition at line 183 of file viewer.h.

temporal_event rs2::viewer_model::origin_occluded { std::chrono::milliseconds(3000) }

Definition at line 253 of file viewer.h.

float2 rs2::viewer_model::overflow = { 0.f, 0.f }

Definition at line 244 of file viewer.h.

const float rs2::viewer_model::panel_width = 340.f

Definition at line 63 of file viewer.h.

const float rs2::viewer_model::panel_y = 50.f

Definition at line 64 of file viewer.h.

bool rs2::viewer_model::paused = false

Definition at line 135 of file viewer.h.

float3 rs2::viewer_model::pos = { 0.0f, 0.0f, -0.5f }

Definition at line 231 of file viewer.h.

press_button_model rs2::viewer_model::pose_info_object_button { u8"\uf05a", u8"\uf05a", "Show pose stream info overlay", "Hide pose stream info overlay", false }

Definition at line 189 of file viewer.h.

post_processing_filters rs2::viewer_model::ppf

Definition at line 130 of file viewer.h.

std::array<float3, 4> rs2::viewer_model::roi_rect

Definition at line 153 of file viewer.h.

bool rs2::viewer_model::select_3d_source = false

Definition at line 179 of file viewer.h.

bool rs2::viewer_model::select_shader_source = false

Definition at line 181 of file viewer.h.

bool rs2::viewer_model::select_tex_source = false

Definition at line 180 of file viewer.h.

int rs2::viewer_model::selected_depth_source_uid = -1

Definition at line 162 of file viewer.h.

shader_type rs2::viewer_model::selected_shader = shader_type::diffuse

Definition at line 173 of file viewer.h.

stream_model* rs2::viewer_model::selected_stream = nullptr

Definition at line 128 of file viewer.h.

int rs2::viewer_model::selected_tex_source_uid = -1

Definition at line 163 of file viewer.h.

bool rs2::viewer_model::show_help_screen = false

Definition at line 182 of file viewer.h.

bool rs2::viewer_model::show_skybox = true

Definition at line 255 of file viewer.h.

std::map<int, stream_model> rs2::viewer_model::streams

Definition at line 125 of file viewer.h.

std::mutex rs2::viewer_model::streams_mutex

Definition at line 124 of file viewer.h.

std::map<int, int> rs2::viewer_model::streams_origin

Definition at line 126 of file viewer.h.

bool rs2::viewer_model::support_non_syncronized_mode = true

Definition at line 157 of file viewer.h.

std::shared_ptr<syncer_model> rs2::viewer_model::syncer

Definition at line 129 of file viewer.h.

std::atomic<bool> rs2::viewer_model::synchronization_enable

Definition at line 158 of file viewer.h.

std::atomic<bool> rs2::viewer_model::synchronization_enable_prev_state

Definition at line 159 of file viewer.h.

float3 rs2::viewer_model::target = { 0.0f, 0.0f, 0.0f }

Definition at line 232 of file viewer.h.

GLint rs2::viewer_model::texture_border_mode = GL_CLAMP_TO_EDGE

Definition at line 237 of file viewer.h.

double rs2::viewer_model::texture_update_time = 0.0

Definition at line 165 of file viewer.h.

press_button_model rs2::viewer_model::trajectory_button { u8"\uf1b0", u8"\uf1b0","Draw trajectory", "Stop drawing trajectory", true }

Definition at line 187 of file viewer.h.

float3 rs2::viewer_model::up

Definition at line 233 of file viewer.h.

std::shared_ptr<updates_model> rs2::viewer_model::updates

Definition at line 193 of file viewer.h.

float rs2::viewer_model::view[16]

Definition at line 236 of file viewer.h.

std::atomic<int> rs2::viewer_model::zo_sensors

Definition at line 160 of file viewer.h.

The documentation for this class was generated from the following files:

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