|
iridescence
|
Viewer context. More...
#include <light_viewer_context.hpp>


Public Member Functions | |
| LightViewerContext (const std::string &context_name) | |
| virtual | ~LightViewerContext () |
| void | draw_ui () |
| void | draw_gl () |
| bool | init_canvas (const Eigen::Vector2i &size) |
| void | set_size (const Eigen::Vector2i &size) |
| void | set_clear_color (const Eigen::Vector4f &color) |
| void | set_pos (const Eigen::Vector2i &pos, ImGuiCond cond=ImGuiCond_FirstUseEver, ImGuiWindowFlags=0) |
| void | show () |
| void | hide () |
| virtual void | clear () |
| Clear everything in the viewer (callbacks, filters, drawables, texts). | |
| virtual void | clear_text () |
| Clear texts. | |
| virtual void | append_text (const std::string &text) |
| Append debug text to the viewer. This method is thread-safe. | |
| virtual void | register_ui_callback (const std::string &name, const std::function< void()> &callback=0) |
| Register a UI callback function. | |
| void | remove_ui_callback (const std::string &name) |
| Remove a UI callback function. | |
| guik::ShaderSetting & | shader_setting () |
| Global shader setting. | |
| const guik::ShaderSetting & | shader_setting () const |
| Global shader setting. | |
| void | disable_xy_grid () |
| Disable XY grid drawing. | |
| void | enable_xy_grid () |
| Enable XY grid drawing. | |
| void | set_draw_xy_grid (bool draw_xy_grid) |
| Set enable/disable XY grid drawing. | |
| void | set_colormap (glk::COLORMAP colormap) |
| Set colormap used for RAINBOW and VERTEX_COLORMAP modes. | |
| void | set_screen_effect (const std::shared_ptr< glk::ScreenEffect > &effect) |
| Set screen effect. | |
| const std::shared_ptr< glk::ScreenEffect > & | get_screen_effect () const |
| Get screen effect. | |
| void | set_bg_texture (const std::shared_ptr< glk::Texture > &bg_texture) |
| Set background texture. | |
| void | set_rainbow_range (const Eigen::Vector2f &minmax_z) |
| Set range of color mapping for RAINBOW mode. | |
| void | set_rainbow_axis (const Eigen::Vector3f &axis) |
| Set axis of color mapping for RAINBOW mode. | |
| void | set_colormap_range (const Eigen::Vector2f &minmax) |
| Set range of color mapping for VERTEX_COLORMAP mode. | |
| void | set_point_shape (float point_size=1.0f, bool metric=true, bool circle=true) |
| Set point shape properties. | |
| void | enable_normal_buffer () |
| Enable normal buffer. | |
| void | enable_info_buffer () |
| Enable info buffer. | |
| void | enable_decimal_rendering () |
| Enable partial rendering (This method will be deprecated). | |
| void | enable_partial_rendering (double clear_thresh=1e-6) |
| Enable partial rendering. | |
| void | disable_partial_rendering () |
| Disable partial rendering. | |
| void | enable_backface_culling () |
| Enable backface culling. Fragments with back-facing normals will not be rendered. | |
| void | disable_backface_culling () |
| Disable backface culling. | |
| void | set_backface_culling_range (const Eigen::Vector2f &range) |
| Set the range of normal.z for backface culling. Fragments with normal.z outside the range will be culled when backface culling is enabled. | |
| bool | normal_buffer_enabled () const |
| Whether normal buffer is enabled. | |
| bool | info_buffer_enabled () const |
| Whether info buffer is enabled. | |
| bool | partial_rendering_enabled () const |
| Whether partial rendering is enabled. | |
| bool | backface_culling_enabled () const |
| Whether backface culling is enabled. | |
| const glk::Texture & | color_buffer () const |
| Color buffer. | |
| const glk::Texture & | depth_buffer () const |
| Depth buffer. | |
| const glk::Texture & | normal_buffer () const |
| Normal buffer. | |
| const glk::Texture & | info_buffer () const |
| Info buffer. | |
| const glk::Texture & | dynamic_flag_buffer () const |
| Dynamic flag buffer. | |
| void | clear_drawables () |
| Clear all drawables. | |
| void | clear_drawables (const std::function< bool(const std::string &)> &fn) |
| Clear drawables that satisfy the given condition. | |
| std::unordered_map< std::string, std::pair< ShaderSetting::Ptr, glk::Drawable::ConstPtr > > & | get_drawables () |
| Get all drawables. | |
| std::pair< ShaderSetting::Ptr, glk::Drawable::ConstPtr > | find_drawable (const std::string &name) |
| Find a drawable by name. | |
| void | remove_drawable (const std::string &name) |
| Remove a drawable by name. | |
| void | remove_drawable (const std::regex ®ex) |
| Remove all drawables that match the given regex. | |
| void | update_drawable (const std::string &name, const glk::Drawable::ConstPtr &drawable, const ShaderSetting &shader_setting=ShaderSetting()) |
| Update a drawable. | |
| void | clear_drawable_filters () |
| Clear all drawable filters. | |
| void | register_drawable_filter (const std::string &filter_name, const std::function< bool(const std::string &)> &filter=0) |
| Register a drawable filter. | |
| void | remove_drawable_filter (const std::string &filter_name) |
| Remove a drawable filter. | |
| void | clear_partial_rendering () |
| Clear partial rendering buffer. | |
| const std::shared_ptr< CameraControl > & | get_camera_control () const |
| Get camera control (model matrix control). | |
| const std::shared_ptr< ProjectionControl > & | get_projection_control () const |
| Get projection control (projection matrix control). | |
| void | set_camera_control (const std::shared_ptr< CameraControl > &camera_control) |
| Set camera control (model matrix control). | |
| void | set_projection_control (const std::shared_ptr< ProjectionControl > &projection_control) |
| Set projection control (projection matrix control). | |
| bool | save_camera_settings (const std::string &path) const |
| Save camera settings to a file. | |
| bool | load_camera_settings (const std::string &path) |
| Load camera settings from a file. | |
| void | reset_center () |
| Reset camera center to the center of the screen. | |
| void | lookat (const Eigen::Vector3f &pt) |
| Make the camera look at a point. | |
| void | lookat (const Eigen::Isometry3f &T_world_sensor) |
| Make the camera look at a transform. | |
| void | lookat (const Eigen::Isometry3d &T_world_sensor) |
| Make the camera look at a transform. | |
| template<typename Vector> | |
| void | lookat (const Vector &pt) |
| Make the camera look at a point. | |
| std::shared_ptr< OrbitCameraControlXY > | use_orbit_camera_control (double distance=80.0, double theta=0.0, double phi=-60.0f *M_PI/180.0f) |
| Use orbit camera control (XY plane) useful for systems in which XYZ = front-left-up like LiDAR odometry. | |
| std::shared_ptr< OrbitCameraControlXZ > | use_orbit_camera_control_xz (double distance=80.0, double theta=0.0, double phi=0.0) |
| Use orbit camera control (XZ plane) useful for systems in which XYZ = right-down-forward like visual odometry. | |
| std::shared_ptr< TopDownCameraControl > | use_topdown_camera_control (double distance=80.0, double theta=0.0) |
| Use top-down camera control useful for 2D SLAM. | |
| std::shared_ptr< ArcBallCameraControl > | use_arcball_camera_control (double distance=80.0, double theta=0.0, double phi=-60.0f *M_PI/180.0f) |
| Use arcball camera control. | |
| std::shared_ptr< FPSCameraControl > | use_fps_camera_control (double fovy_deg=60.0) |
| Use FPS game-like camera control. | |
| std::shared_ptr< SensorViewCameraControl > | use_sensor_view_camera_control (const Eigen::Isometry3f &T_sensor_camera=Eigen::Translation3f(-5.0f, 0.0f, 0.1f) *Eigen::Isometry3f::Identity(), double smoothing_factor_trans=0.75, double smoothing_factor_rot=0.9) |
| Use sensor-view camera control that follows a given sensor pose. | |
| std::shared_ptr< BasicProjectionControl > | use_perspective_projection_control (float fovy_deg=30.0f, float near_=1.0f, float far_=1000.0f) |
| Use perspective projection control. | |
| std::shared_ptr< BasicProjectionControl > | use_orthographic_projection_control (float width=10.0f, float near_=1.0f, float far_=1000.0f) |
| Use orthographic projection control. | |
| guik::GLCanvas & | get_canvas () |
| Get underlying GLCanvas. | |
| Eigen::Vector2i | canvas_tl () const |
| Eigen::Vector2i | canvas_br () const |
| Get bottom right corner of the canvas rectangle. | |
| Eigen::Vector2i | canvas_size () const |
| Get canvas size. | |
| Eigen::Matrix4f | view_matrix () const |
| Get view matrix. | |
| Eigen::Matrix4f | projection_matrix () const |
| Get projection matrix. | |
| Eigen::Vector4i | pick_info (const Eigen::Vector2i &p, int window=2) const |
| Pick info from the info buffer. | |
| float | pick_depth (const Eigen::Vector2i &p, int window=2) const |
| Pick depth from the depth buffer. | |
| Eigen::Vector3f | unproject (const Eigen::Vector2i &p, float depth) const |
| Unproject a pixel to a 3D point. | |
| std::optional< Eigen::Vector3f > | pick_point (int button=0, int window=2, Eigen::Vector4i *info=nullptr) const |
| Pick a 3D point from the depth buffer. | |
| std::vector< unsigned char > | read_color_buffer () const |
| Read color buffer values. | |
| std::vector< float > | read_depth_buffer (bool real_scale=true) |
| Read depth buffer values. | |
| bool | save_color_buffer (const std::string &filename) |
| Save color buffer to an image file (PNG). | |
| bool | save_depth_buffer (const std::string &filename, bool real_scale=true) |
| Save depth buffer to a file (PNG). | |
| AsyncLightViewerContext | async () |
| Get an asynchronous light viewer context. | |
| std::shared_ptr< glk::PointCloudBuffer > | update_points (const std::string &name, const float *data, int stride, int num_points, const ShaderSetting &shader_setting) |
| Register or update a point cloud buffer. | |
| template<typename Scalar, int Dim> | |
| std::shared_ptr< glk::PointCloudBuffer > | update_points (const std::string &name, const Eigen::Matrix< Scalar, Dim, 1 > *points, int num_points, const ShaderSetting &shader_setting) |
| Register or update a point cloud buffer. | |
| template<typename Scalar, int Dim, typename Allocator> | |
| std::shared_ptr< glk::PointCloudBuffer > | update_points (const std::string &name, const std::vector< Eigen::Matrix< Scalar, Dim, 1 >, Allocator > &points, const ShaderSetting &shader_setting) |
| Register or update a point cloud buffer. | |
| template<typename Scalar, int Dim> | |
| void | update_normal_dists (const std::string &name, const Eigen::Matrix< Scalar, Dim, 1 > *points, const Eigen::Matrix< Scalar, Dim, Dim > *covs, int num_points, float sigma, const ShaderSetting &shader_setting) |
| Register or update a normal distribution set. | |
| template<typename Scalar, int Dim, typename Alloc1, typename Alloc2> | |
| void | update_normal_dists (const std::string &name, const std::vector< Eigen::Matrix< Scalar, Dim, 1 >, Alloc1 > &points, const std::vector< Eigen::Matrix< Scalar, Dim, Dim >, Alloc2 > &covs, float sigma, const ShaderSetting &shader_setting) |
| Register or update a normal distribution set. | |
| std::shared_ptr< glk::ThinLines > | update_thin_lines (const std::string &name, const float *vertices, const float *colors, int num_vertices, const unsigned int *indices, int num_indices, bool line_strip, float line_width, const ShaderSetting &shader_setting) |
| Register or update a thin lines drawable. | |
| std::shared_ptr< glk::ThinLines > | update_thin_lines (const std::string &name, const float *vertices, const float *colors, int num_vertices, const unsigned int *indices, int num_indices, bool line_strip, const ShaderSetting &shader_setting) |
| Register or update a thin lines drawable. | |
| template<typename Scalar, int Dim> | |
| std::shared_ptr< glk::ThinLines > | update_thin_lines (const std::string &name, const Eigen::Matrix< Scalar, Dim, 1 > *points, int num_points, bool line_strip, const ShaderSetting &shader_setting) |
| Register or update a thin lines drawable. | |
| template<typename ScalarV, int DimV, typename ScalarC, int DimC> | |
| std::shared_ptr< glk::ThinLines > | update_thin_lines (const std::string &name, const Eigen::Matrix< ScalarV, DimV, 1 > *points, const Eigen::Matrix< ScalarC, DimC, 1 > *colors, int num_points, bool line_strip, const ShaderSetting &shader_setting) |
| Register or update a thin lines drawable. | |
| template<typename ScalarV, int DimV, typename ScalarC, int DimC> | |
| std::shared_ptr< glk::ThinLines > | update_thin_lines (const std::string &name, const Eigen::Matrix< ScalarV, DimV, 1 > *points, const Eigen::Matrix< ScalarC, DimC, 1 > *colors, int num_points, const unsigned int *indices, int num_indices, bool line_strip, const ShaderSetting &shader_setting) |
| Register or update a thin lines drawable. | |
| template<typename Point, typename Alloc> | |
| std::shared_ptr< glk::ThinLines > | update_thin_lines (const std::string &name, const std::vector< Point, Alloc > &points, bool line_strip, const ShaderSetting &shader_setting) |
| Register or update a thin lines drawable. | |
| template<typename Point, typename Alloc> | |
| std::shared_ptr< glk::ThinLines > | update_thin_lines (const std::string &name, const std::vector< Point, Alloc > &points, const std::vector< unsigned int > &indices, bool line_strip, const ShaderSetting &shader_setting) |
| Register or update a thin lines drawable. | |
| template<typename Point, typename AllocP, typename Color, typename AllocC> | |
| std::shared_ptr< glk::ThinLines > | update_thin_lines (const std::string &name, const std::vector< Point, AllocP > &points, const std::vector< Color, AllocC > &colors, bool line_strip, const ShaderSetting &shader_setting) |
| Register or update a thin lines drawable. | |
| template<typename Point, typename AllocP, typename Color, typename AllocC> | |
| std::shared_ptr< glk::ThinLines > | update_thin_lines (const std::string &name, const std::vector< Point, AllocP > &points, const std::vector< Color, AllocC > &colors, const std::vector< unsigned int > &indices, bool line_strip, const ShaderSetting &shader_setting) |
| Register or update a thin lines drawable. | |
| template<typename Scalar, int Dim> | |
| std::shared_ptr< glk::ThinLines > | update_thin_lines (const std::string &name, const Eigen::Matrix< Scalar, Dim, 1 > *points, int num_points, bool line_strip, float line_width, const ShaderSetting &shader_setting) |
| Register or update a thin lines drawable. | |
| template<typename ScalarV, int DimV, typename ScalarC, int DimC> | |
| std::shared_ptr< glk::ThinLines > | update_thin_lines (const std::string &name, const Eigen::Matrix< ScalarV, DimV, 1 > *points, const Eigen::Matrix< ScalarC, DimC, 1 > *colors, int num_points, bool line_strip, float line_width, const ShaderSetting &shader_setting) |
| Register or update a thin lines drawable. | |
| template<typename ScalarV, int DimV, typename ScalarC, int DimC> | |
| std::shared_ptr< glk::ThinLines > | update_thin_lines (const std::string &name, const Eigen::Matrix< ScalarV, DimV, 1 > *points, const Eigen::Matrix< ScalarC, DimC, 1 > *colors, int num_points, const unsigned int *indices, int num_indices, bool line_strip, float line_width, const ShaderSetting &shader_setting) |
| Register or update a thin lines drawable. | |
| template<typename Point, typename Alloc> | |
| std::shared_ptr< glk::ThinLines > | update_thin_lines (const std::string &name, const std::vector< Point, Alloc > &points, bool line_strip, float line_width, const ShaderSetting &shader_setting) |
| Register or update a thin lines drawable. | |
| template<typename Point, typename Alloc> | |
| std::shared_ptr< glk::ThinLines > | update_thin_lines (const std::string &name, const std::vector< Point, Alloc > &points, const std::vector< unsigned int > &indices, bool line_strip, float line_width, const ShaderSetting &shader_setting) |
| Register or update a thin lines drawable. | |
| template<typename Point, typename AllocP, typename Color, typename AllocC> | |
| std::shared_ptr< glk::ThinLines > | update_thin_lines (const std::string &name, const std::vector< Point, AllocP > &points, const std::vector< Color, AllocC > &colors, bool line_strip, float line_width, const ShaderSetting &shader_setting) |
| Register or update a thin lines drawable. | |
| template<typename Point, typename AllocP, typename Color, typename AllocC> | |
| std::shared_ptr< glk::ThinLines > | update_thin_lines (const std::string &name, const std::vector< Point, AllocP > &points, const std::vector< Color, AllocC > &colors, const std::vector< unsigned int > &indices, bool line_strip, float line_width, const ShaderSetting &shader_setting) |
| Register or update a thin lines drawable. | |
| void | update_icosahedron (const std::string &name, const ShaderSetting &shader_setting) |
| Register or update an icosahedron primitive. | |
| void | update_sphere (const std::string &name, const ShaderSetting &shader_setting) |
| Register or update a sphere primitive. | |
| void | update_cube (const std::string &name, const ShaderSetting &shader_setting) |
| Register or update a cube primitive. | |
| void | update_cone (const std::string &name, const ShaderSetting &shader_setting) |
| Register or update a cone primitive. | |
| void | update_frustum (const std::string &name, const ShaderSetting &shader_setting) |
| Register or update a frustum primitive. | |
| void | update_coord (const std::string &name, const ShaderSetting &shader_setting) |
| Register or update a coordinate axes primitive. | |
| void | update_wire_icosahedron (const std::string &name, const ShaderSetting &shader_setting) |
| Register or update a wireframe icosahedron primitive. | |
| void | update_wire_sphere (const std::string &name, const ShaderSetting &shader_setting) |
| Register or update a wireframe sphere primitive. | |
| void | update_wire_cube (const std::string &name, const ShaderSetting &shader_setting) |
| Register or update a wireframe cube primitive. | |
| void | update_wire_cone (const std::string &name, const ShaderSetting &shader_setting) |
| Register or update a wireframe cone primitive. | |
| void | update_wire_frustum (const std::string &name, const ShaderSetting &shader_setting) |
| Register or update a wireframe frustum primitive. | |
Protected Attributes | |
| std::string | context_name |
| Viewer context name. | |
| Eigen::Vector2i | canvas_rect_min |
| Top-left corner of the canvas rectangle. | |
| Eigen::Vector2i | canvas_rect_max |
| Bottom-right corner of the canvas rectangle. | |
| std::unique_ptr< guik::GLCanvas > | canvas |
| GL canvas. | |
| guik::ShaderSetting | global_shader_setting |
| Global shader setting. | |
| bool | show_window |
| bool | draw_xy_grid |
| bool | decimal_rendering |
| Eigen::Matrix4f | last_projection_view_matrix |
| std::unordered_map< std::string, std::function< bool(const std::string &)> > | drawable_filters |
| std::unordered_map< std::string, std::pair< ShaderSetting::Ptr, glk::Drawable::ConstPtr > > | drawables |
| std::mutex | sub_texts_mutex |
| std::deque< std::string > | sub_texts |
| std::vector< std::pair< std::string, std::function< void()> > > | sub_ui_callbacks |
Viewer context.
| guik::LightViewerContext::LightViewerContext | ( | const std::string & | context_name | ) |
|
virtual |
|
virtual |
Append debug text to the viewer. This method is thread-safe.
Reimplemented in guik::LightViewer.
| AsyncLightViewerContext guik::LightViewerContext::async | ( | ) |
Get an asynchronous light viewer context.
| bool guik::LightViewerContext::backface_culling_enabled | ( | ) | const |
Whether backface culling is enabled.
|
inline |
Get bottom right corner of the canvas rectangle.
|
inline |
Get canvas size.
|
inline |
|
virtual |
Clear everything in the viewer (callbacks, filters, drawables, texts).
Reimplemented in guik::LightViewer.
| void guik::LightViewerContext::clear_drawable_filters | ( | ) |
Clear all drawable filters.
| void guik::LightViewerContext::clear_drawables | ( | ) |
Clear all drawables.
| void guik::LightViewerContext::clear_drawables | ( | const std::function< bool(const std::string &)> & | fn | ) |
Clear drawables that satisfy the given condition.
| fn | Condition function |
| void guik::LightViewerContext::clear_partial_rendering | ( | ) |
Clear partial rendering buffer.
|
virtual |
Clear texts.
Reimplemented in guik::LightViewer.
| const glk::Texture & guik::LightViewerContext::color_buffer | ( | ) | const |
Color buffer.
| const glk::Texture & guik::LightViewerContext::depth_buffer | ( | ) | const |
Depth buffer.
| void guik::LightViewerContext::disable_backface_culling | ( | ) |
Disable backface culling.
| void guik::LightViewerContext::disable_partial_rendering | ( | ) |
Disable partial rendering.
|
inline |
Disable XY grid drawing.
| void guik::LightViewerContext::draw_gl | ( | ) |
| void guik::LightViewerContext::draw_ui | ( | ) |
| const glk::Texture & guik::LightViewerContext::dynamic_flag_buffer | ( | ) | const |
Dynamic flag buffer.
| void guik::LightViewerContext::enable_backface_culling | ( | ) |
Enable backface culling. Fragments with back-facing normals will not be rendered.
| void guik::LightViewerContext::enable_decimal_rendering | ( | ) |
Enable partial rendering (This method will be deprecated).
| void guik::LightViewerContext::enable_info_buffer | ( | ) |
Enable info buffer.
| void guik::LightViewerContext::enable_normal_buffer | ( | ) |
Enable normal buffer.
| void guik::LightViewerContext::enable_partial_rendering | ( | double | clear_thresh = 1e-6 | ) |
Enable partial rendering.
| clear_thresh | Threshold for clearing the partial rendering buffer. |
|
inline |
Enable XY grid drawing.
| std::pair< ShaderSetting::Ptr, glk::Drawable::ConstPtr > guik::LightViewerContext::find_drawable | ( | const std::string & | name | ) |
Find a drawable by name.
| name | Drawable name |
| const std::shared_ptr< CameraControl > & guik::LightViewerContext::get_camera_control | ( | ) | const |
Get camera control (model matrix control).
| guik::GLCanvas & guik::LightViewerContext::get_canvas | ( | ) |
Get underlying GLCanvas.
| std::unordered_map< std::string, std::pair< ShaderSetting::Ptr, glk::Drawable::ConstPtr > > & guik::LightViewerContext::get_drawables | ( | ) |
Get all drawables.
| const std::shared_ptr< ProjectionControl > & guik::LightViewerContext::get_projection_control | ( | ) | const |
Get projection control (projection matrix control).
| const std::shared_ptr< glk::ScreenEffect > & guik::LightViewerContext::get_screen_effect | ( | ) | const |
Get screen effect.
| void guik::LightViewerContext::hide | ( | ) |
| const glk::Texture & guik::LightViewerContext::info_buffer | ( | ) | const |
Info buffer.
| bool guik::LightViewerContext::info_buffer_enabled | ( | ) | const |
Whether info buffer is enabled.
| bool guik::LightViewerContext::init_canvas | ( | const Eigen::Vector2i & | size | ) |
| bool guik::LightViewerContext::load_camera_settings | ( | const std::string & | path | ) |
Load camera settings from a file.
| void guik::LightViewerContext::lookat | ( | const Eigen::Isometry3d & | T_world_sensor | ) |
Make the camera look at a transform.
| void guik::LightViewerContext::lookat | ( | const Eigen::Isometry3f & | T_world_sensor | ) |
Make the camera look at a transform.
| void guik::LightViewerContext::lookat | ( | const Eigen::Vector3f & | pt | ) |
Make the camera look at a point.
|
inline |
Make the camera look at a point.
| const glk::Texture & guik::LightViewerContext::normal_buffer | ( | ) | const |
Normal buffer.
| bool guik::LightViewerContext::normal_buffer_enabled | ( | ) | const |
Whether normal buffer is enabled.
| bool guik::LightViewerContext::partial_rendering_enabled | ( | ) | const |
Whether partial rendering is enabled.
| float guik::LightViewerContext::pick_depth | ( | const Eigen::Vector2i & | p, |
| int | window = 2 ) const |
Pick depth from the depth buffer.
| p | Pixel coordinates |
| window | Window size for finding a valid pixel neighboring p |
| Eigen::Vector4i guik::LightViewerContext::pick_info | ( | const Eigen::Vector2i & | p, |
| int | window = 2 ) const |
Pick info from the info buffer.
| p | Pixel coordinates |
| window | Window size for finding a valid pixel neighboring p |
| std::optional< Eigen::Vector3f > guik::LightViewerContext::pick_point | ( | int | button = 0, |
| int | window = 2, | ||
| Eigen::Vector4i * | info = nullptr ) const |
Pick a 3D point from the depth buffer.
| p | Pixel coordinates |
| window | Window size for finding a valid pixel neighboring p |
| info | If not null, the info vector is stored here. |
|
inline |
Get projection matrix.
| std::vector< unsigned char > guik::LightViewerContext::read_color_buffer | ( | ) | const |
Read color buffer values.
| std::vector< float > guik::LightViewerContext::read_depth_buffer | ( | bool | real_scale = true | ) |
Read depth buffer values.
| real_scale | If true, depth values are scaled to real-world values. Otherwise, raw depth buffer values are returned. |
| void guik::LightViewerContext::register_drawable_filter | ( | const std::string & | filter_name, |
| const std::function< bool(const std::string &)> & | filter = 0 ) |
Register a drawable filter.
| filter_name | Filter name |
| filter | Filter function. If null, the filter with the given name is removed. |
|
virtual |
Register a UI callback function.
| name | Callback name |
| callback | Callback function. If null, the callback with the given name is removed. |
Reimplemented in guik::LightViewer.
| void guik::LightViewerContext::remove_drawable | ( | const std::regex & | regex | ) |
Remove all drawables that match the given regex.
| void guik::LightViewerContext::remove_drawable | ( | const std::string & | name | ) |
Remove a drawable by name.
| void guik::LightViewerContext::remove_drawable_filter | ( | const std::string & | filter_name | ) |
Remove a drawable filter.
| void guik::LightViewerContext::remove_ui_callback | ( | const std::string & | name | ) |
Remove a UI callback function.
| name | Callback name |
| void guik::LightViewerContext::reset_center | ( | ) |
Reset camera center to the center of the screen.
| bool guik::LightViewerContext::save_camera_settings | ( | const std::string & | path | ) | const |
Save camera settings to a file.
| bool guik::LightViewerContext::save_color_buffer | ( | const std::string & | filename | ) |
Save color buffer to an image file (PNG).
| bool guik::LightViewerContext::save_depth_buffer | ( | const std::string & | filename, |
| bool | real_scale = true ) |
Save depth buffer to a file (PNG).
| void guik::LightViewerContext::set_backface_culling_range | ( | const Eigen::Vector2f & | range | ) |
Set the range of normal.z for backface culling. Fragments with normal.z outside the range will be culled when backface culling is enabled.
| range | [min, max] range of normal.z for backface culling |
| void guik::LightViewerContext::set_bg_texture | ( | const std::shared_ptr< glk::Texture > & | bg_texture | ) |
Set background texture.
| void guik::LightViewerContext::set_camera_control | ( | const std::shared_ptr< CameraControl > & | camera_control | ) |
Set camera control (model matrix control).
| void guik::LightViewerContext::set_clear_color | ( | const Eigen::Vector4f & | color | ) |
| void guik::LightViewerContext::set_colormap | ( | glk::COLORMAP | colormap | ) |
Set colormap used for RAINBOW and VERTEX_COLORMAP modes.
| void guik::LightViewerContext::set_colormap_range | ( | const Eigen::Vector2f & | minmax | ) |
Set range of color mapping for VERTEX_COLORMAP mode.
| void guik::LightViewerContext::set_draw_xy_grid | ( | bool | draw_xy_grid | ) |
Set enable/disable XY grid drawing.
| void guik::LightViewerContext::set_point_shape | ( | float | point_size = 1.0f, |
| bool | metric = true, | ||
| bool | circle = true ) |
Set point shape properties.
| point_size | Point size |
| metric | If true, point size is in the metric unit [m], otherwise in pixel unit. |
| circle | If true, points are rendered as circles, otherwise as squares. |
| void guik::LightViewerContext::set_pos | ( | const Eigen::Vector2i & | pos, |
| ImGuiCond | cond = ImGuiCond_FirstUseEver, | ||
| ImGuiWindowFlags | = 0 ) |
| void guik::LightViewerContext::set_projection_control | ( | const std::shared_ptr< ProjectionControl > & | projection_control | ) |
Set projection control (projection matrix control).
| void guik::LightViewerContext::set_rainbow_axis | ( | const Eigen::Vector3f & | axis | ) |
Set axis of color mapping for RAINBOW mode.
| void guik::LightViewerContext::set_rainbow_range | ( | const Eigen::Vector2f & | minmax_z | ) |
Set range of color mapping for RAINBOW mode.
| void guik::LightViewerContext::set_screen_effect | ( | const std::shared_ptr< glk::ScreenEffect > & | effect | ) |
Set screen effect.
| void guik::LightViewerContext::set_size | ( | const Eigen::Vector2i & | size | ) |
|
inline |
Global shader setting.
|
inline |
Global shader setting.
| void guik::LightViewerContext::show | ( | ) |
| Eigen::Vector3f guik::LightViewerContext::unproject | ( | const Eigen::Vector2i & | p, |
| float | depth ) const |
Unproject a pixel to a 3D point.
| p | Pixel coordinates |
| depth | Depth value |
| void guik::LightViewerContext::update_cone | ( | const std::string & | name, |
| const ShaderSetting & | shader_setting ) |
Register or update a cone primitive.
| void guik::LightViewerContext::update_coord | ( | const std::string & | name, |
| const ShaderSetting & | shader_setting ) |
Register or update a coordinate axes primitive.
| void guik::LightViewerContext::update_cube | ( | const std::string & | name, |
| const ShaderSetting & | shader_setting ) |
Register or update a cube primitive.
| void guik::LightViewerContext::update_drawable | ( | const std::string & | name, |
| const glk::Drawable::ConstPtr & | drawable, | ||
| const ShaderSetting & | shader_setting = ShaderSetting() ) |
Update a drawable.
| name | Drawable name |
| drawable | Drawable |
| shader_setting | Shader setting |
| void guik::LightViewerContext::update_frustum | ( | const std::string & | name, |
| const ShaderSetting & | shader_setting ) |
Register or update a frustum primitive.
| void guik::LightViewerContext::update_icosahedron | ( | const std::string & | name, |
| const ShaderSetting & | shader_setting ) |
Register or update an icosahedron primitive.
| void guik::LightViewerContext::update_normal_dists | ( | const std::string & | name, |
| const Eigen::Matrix< Scalar, Dim, 1 > * | points, | ||
| const Eigen::Matrix< Scalar, Dim, Dim > * | covs, | ||
| int | num_points, | ||
| float | sigma, | ||
| const ShaderSetting & | shader_setting ) |
Register or update a normal distribution set.
| name | Drawable name |
| points | Point mean array |
| covs | Point covariance array |
| num_points | Number of points |
| sigma | Size of the ellipsoids in standard deviations (e.g., 3.0 renders 3-sigma ellipsoids) |
| shader_setting | Shader setting |
| void guik::LightViewerContext::update_normal_dists | ( | const std::string & | name, |
| const std::vector< Eigen::Matrix< Scalar, Dim, 1 >, Alloc1 > & | points, | ||
| const std::vector< Eigen::Matrix< Scalar, Dim, Dim >, Alloc2 > & | covs, | ||
| float | sigma, | ||
| const ShaderSetting & | shader_setting ) |
Register or update a normal distribution set.
| std::shared_ptr< glk::PointCloudBuffer > guik::LightViewerContext::update_points | ( | const std::string & | name, |
| const Eigen::Matrix< Scalar, Dim, 1 > * | points, | ||
| int | num_points, | ||
| const ShaderSetting & | shader_setting ) |
Register or update a point cloud buffer.
| std::shared_ptr< glk::PointCloudBuffer > guik::LightViewerContext::update_points | ( | const std::string & | name, |
| const float * | data, | ||
| int | stride, | ||
| int | num_points, | ||
| const ShaderSetting & | shader_setting ) |
Register or update a point cloud buffer.
| name | Drawable name |
| data | Pointer to point data (float array) |
| stride | Stride (in bytes) between points |
| num_points | Number of points |
| shader_setting | Shader setting |
| std::shared_ptr< glk::PointCloudBuffer > guik::LightViewerContext::update_points | ( | const std::string & | name, |
| const std::vector< Eigen::Matrix< Scalar, Dim, 1 >, Allocator > & | points, | ||
| const ShaderSetting & | shader_setting ) |
Register or update a point cloud buffer.
| void guik::LightViewerContext::update_sphere | ( | const std::string & | name, |
| const ShaderSetting & | shader_setting ) |
Register or update a sphere primitive.
| std::shared_ptr< glk::ThinLines > guik::LightViewerContext::update_thin_lines | ( | const std::string & | name, |
| const Eigen::Matrix< Scalar, Dim, 1 > * | points, | ||
| int | num_points, | ||
| bool | line_strip, | ||
| const ShaderSetting & | shader_setting ) |
Register or update a thin lines drawable.
| std::shared_ptr< glk::ThinLines > guik::LightViewerContext::update_thin_lines | ( | const std::string & | name, |
| const Eigen::Matrix< Scalar, Dim, 1 > * | points, | ||
| int | num_points, | ||
| bool | line_strip, | ||
| float | line_width, | ||
| const ShaderSetting & | shader_setting ) |
Register or update a thin lines drawable.
| std::shared_ptr< glk::ThinLines > guik::LightViewerContext::update_thin_lines | ( | const std::string & | name, |
| const Eigen::Matrix< ScalarV, DimV, 1 > * | points, | ||
| const Eigen::Matrix< ScalarC, DimC, 1 > * | colors, | ||
| int | num_points, | ||
| bool | line_strip, | ||
| const ShaderSetting & | shader_setting ) |
Register or update a thin lines drawable.
| std::shared_ptr< glk::ThinLines > guik::LightViewerContext::update_thin_lines | ( | const std::string & | name, |
| const Eigen::Matrix< ScalarV, DimV, 1 > * | points, | ||
| const Eigen::Matrix< ScalarC, DimC, 1 > * | colors, | ||
| int | num_points, | ||
| bool | line_strip, | ||
| float | line_width, | ||
| const ShaderSetting & | shader_setting ) |
Register or update a thin lines drawable.
| std::shared_ptr< glk::ThinLines > guik::LightViewerContext::update_thin_lines | ( | const std::string & | name, |
| const Eigen::Matrix< ScalarV, DimV, 1 > * | points, | ||
| const Eigen::Matrix< ScalarC, DimC, 1 > * | colors, | ||
| int | num_points, | ||
| const unsigned int * | indices, | ||
| int | num_indices, | ||
| bool | line_strip, | ||
| const ShaderSetting & | shader_setting ) |
Register or update a thin lines drawable.
| std::shared_ptr< glk::ThinLines > guik::LightViewerContext::update_thin_lines | ( | const std::string & | name, |
| const Eigen::Matrix< ScalarV, DimV, 1 > * | points, | ||
| const Eigen::Matrix< ScalarC, DimC, 1 > * | colors, | ||
| int | num_points, | ||
| const unsigned int * | indices, | ||
| int | num_indices, | ||
| bool | line_strip, | ||
| float | line_width, | ||
| const ShaderSetting & | shader_setting ) |
Register or update a thin lines drawable.
| std::shared_ptr< glk::ThinLines > guik::LightViewerContext::update_thin_lines | ( | const std::string & | name, |
| const float * | vertices, | ||
| const float * | colors, | ||
| int | num_vertices, | ||
| const unsigned int * | indices, | ||
| int | num_indices, | ||
| bool | line_strip, | ||
| const ShaderSetting & | shader_setting ) |
Register or update a thin lines drawable.
| std::shared_ptr< glk::ThinLines > guik::LightViewerContext::update_thin_lines | ( | const std::string & | name, |
| const float * | vertices, | ||
| const float * | colors, | ||
| int | num_vertices, | ||
| const unsigned int * | indices, | ||
| int | num_indices, | ||
| bool | line_strip, | ||
| float | line_width, | ||
| const ShaderSetting & | shader_setting ) |
Register or update a thin lines drawable.
| name | Drawable name |
| vertices | Pointer to vertex data (array of float3) |
| colors | Pointer to color data (array of float4). If null, no vertex colors are assigned.. |
| num_vertices | Number of vertices |
| indices | Pointer to index data (array of unsigned int). If null, non-indexed drawing is used. |
| num_indices | Number of indices |
| line_strip | If true, line strip mode is used. Otherwise, line list mode is used. |
| line_width | Width of the lines in pixels. |
| shader_setting | Shader setting |
| std::shared_ptr< glk::ThinLines > guik::LightViewerContext::update_thin_lines | ( | const std::string & | name, |
| const std::vector< Point, Alloc > & | points, | ||
| bool | line_strip, | ||
| const ShaderSetting & | shader_setting ) |
Register or update a thin lines drawable.
| std::shared_ptr< glk::ThinLines > guik::LightViewerContext::update_thin_lines | ( | const std::string & | name, |
| const std::vector< Point, Alloc > & | points, | ||
| bool | line_strip, | ||
| float | line_width, | ||
| const ShaderSetting & | shader_setting ) |
Register or update a thin lines drawable.
| std::shared_ptr< glk::ThinLines > guik::LightViewerContext::update_thin_lines | ( | const std::string & | name, |
| const std::vector< Point, Alloc > & | points, | ||
| const std::vector< unsigned int > & | indices, | ||
| bool | line_strip, | ||
| const ShaderSetting & | shader_setting ) |
Register or update a thin lines drawable.
| std::shared_ptr< glk::ThinLines > guik::LightViewerContext::update_thin_lines | ( | const std::string & | name, |
| const std::vector< Point, Alloc > & | points, | ||
| const std::vector< unsigned int > & | indices, | ||
| bool | line_strip, | ||
| float | line_width, | ||
| const ShaderSetting & | shader_setting ) |
Register or update a thin lines drawable.
| std::shared_ptr< glk::ThinLines > guik::LightViewerContext::update_thin_lines | ( | const std::string & | name, |
| const std::vector< Point, AllocP > & | points, | ||
| const std::vector< Color, AllocC > & | colors, | ||
| bool | line_strip, | ||
| const ShaderSetting & | shader_setting ) |
Register or update a thin lines drawable.
| std::shared_ptr< glk::ThinLines > guik::LightViewerContext::update_thin_lines | ( | const std::string & | name, |
| const std::vector< Point, AllocP > & | points, | ||
| const std::vector< Color, AllocC > & | colors, | ||
| bool | line_strip, | ||
| float | line_width, | ||
| const ShaderSetting & | shader_setting ) |
Register or update a thin lines drawable.
| std::shared_ptr< glk::ThinLines > guik::LightViewerContext::update_thin_lines | ( | const std::string & | name, |
| const std::vector< Point, AllocP > & | points, | ||
| const std::vector< Color, AllocC > & | colors, | ||
| const std::vector< unsigned int > & | indices, | ||
| bool | line_strip, | ||
| const ShaderSetting & | shader_setting ) |
Register or update a thin lines drawable.
| std::shared_ptr< glk::ThinLines > guik::LightViewerContext::update_thin_lines | ( | const std::string & | name, |
| const std::vector< Point, AllocP > & | points, | ||
| const std::vector< Color, AllocC > & | colors, | ||
| const std::vector< unsigned int > & | indices, | ||
| bool | line_strip, | ||
| float | line_width, | ||
| const ShaderSetting & | shader_setting ) |
Register or update a thin lines drawable.
| void guik::LightViewerContext::update_wire_cone | ( | const std::string & | name, |
| const ShaderSetting & | shader_setting ) |
Register or update a wireframe cone primitive.
| void guik::LightViewerContext::update_wire_cube | ( | const std::string & | name, |
| const ShaderSetting & | shader_setting ) |
Register or update a wireframe cube primitive.
| void guik::LightViewerContext::update_wire_frustum | ( | const std::string & | name, |
| const ShaderSetting & | shader_setting ) |
Register or update a wireframe frustum primitive.
| void guik::LightViewerContext::update_wire_icosahedron | ( | const std::string & | name, |
| const ShaderSetting & | shader_setting ) |
Register or update a wireframe icosahedron primitive.
| void guik::LightViewerContext::update_wire_sphere | ( | const std::string & | name, |
| const ShaderSetting & | shader_setting ) |
Register or update a wireframe sphere primitive.
| std::shared_ptr< ArcBallCameraControl > guik::LightViewerContext::use_arcball_camera_control | ( | double | distance = 80.0, |
| double | theta = 0.0, | ||
| double | phi = -60.0f *M_PI/180.0f ) |
Use arcball camera control.
| std::shared_ptr< FPSCameraControl > guik::LightViewerContext::use_fps_camera_control | ( | double | fovy_deg = 60.0 | ) |
Use FPS game-like camera control.
| std::shared_ptr< OrbitCameraControlXY > guik::LightViewerContext::use_orbit_camera_control | ( | double | distance = 80.0, |
| double | theta = 0.0, | ||
| double | phi = -60.0f *M_PI/180.0f ) |
Use orbit camera control (XY plane) useful for systems in which XYZ = front-left-up like LiDAR odometry.
| std::shared_ptr< OrbitCameraControlXZ > guik::LightViewerContext::use_orbit_camera_control_xz | ( | double | distance = 80.0, |
| double | theta = 0.0, | ||
| double | phi = 0.0 ) |
Use orbit camera control (XZ plane) useful for systems in which XYZ = right-down-forward like visual odometry.
| std::shared_ptr< BasicProjectionControl > guik::LightViewerContext::use_orthographic_projection_control | ( | float | width = 10.0f, |
| float | near_ = 1.0f, | ||
| float | far_ = 1000.0f ) |
Use orthographic projection control.
| std::shared_ptr< BasicProjectionControl > guik::LightViewerContext::use_perspective_projection_control | ( | float | fovy_deg = 30.0f, |
| float | near_ = 1.0f, | ||
| float | far_ = 1000.0f ) |
Use perspective projection control.
| std::shared_ptr< SensorViewCameraControl > guik::LightViewerContext::use_sensor_view_camera_control | ( | const Eigen::Isometry3f & | T_sensor_camera = Eigen::Translation3f(-5.0f, 0.0f, 0.1f) *Eigen::Isometry3f::Identity(), |
| double | smoothing_factor_trans = 0.75, | ||
| double | smoothing_factor_rot = 0.9 ) |
Use sensor-view camera control that follows a given sensor pose.
| std::shared_ptr< TopDownCameraControl > guik::LightViewerContext::use_topdown_camera_control | ( | double | distance = 80.0, |
| double | theta = 0.0 ) |
Use top-down camera control useful for 2D SLAM.
|
inline |
Get view matrix.
|
protected |
GL canvas.
|
protected |
Bottom-right corner of the canvas rectangle.
|
protected |
Top-left corner of the canvas rectangle.
|
protected |
Viewer context name.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Global shader setting.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |