open3d.visualization.VisualizerWithKeyCallback#
- class open3d.visualization.VisualizerWithKeyCallback#
Visualizer with custom key callback capabilities.
- __init__(self: open3d.visualization.VisualizerWithKeyCallback) None #
Default constructor
- add_geometry(self: open3d.visualization.Visualizer, geometry: open3d.geometry.Geometry, reset_bounding_box: bool = True) bool #
Function to add geometry to the scene and create corresponding shaders
- Parameters:
geometry (open3d.geometry.Geometry) – The
Geometry
object.reset_bounding_box (bool, optional, default=True) – Set to
False
to keep current viewpoint
- Returns:
bool
- capture_depth_float_buffer(self: open3d.visualization.Visualizer, do_render: bool = False) open3d.geometry.Image #
Function to capture depth in a float buffer
- Parameters:
do_render (bool, optional, default=False) – Set to
True
to do render.- Returns:
open3d.geometry.Image
- capture_depth_image(self: open3d.visualization.Visualizer, filename: os.PathLike, do_render: bool = False, depth_scale: float = 1000.0) None #
Function to capture and save a depth image
- Parameters:
filename (os.PathLike) – Path to file.
do_render (bool, optional, default=False) – Set to
True
to do render.depth_scale (float, optional, default=1000.0) – Scale depth value when capturing the depth image.
- Returns:
None
- capture_depth_point_cloud(self: open3d.visualization.Visualizer, filename: os.PathLike, do_render: bool = False, convert_to_world_coordinate: bool = False) None #
Function to capture and save local point cloud
- Parameters:
filename (os.PathLike) – Path to file.
do_render (bool, optional, default=False) – Set to
True
to do render.convert_to_world_coordinate (bool, optional, default=False) – Set to
True
to convert to world coordinates
- Returns:
None
- capture_screen_float_buffer(self: open3d.visualization.Visualizer, do_render: bool = False) open3d.geometry.Image #
Function to capture screen and store RGB in a float buffer
- Parameters:
do_render (bool, optional, default=False) – Set to
True
to do render.- Returns:
open3d.geometry.Image
- capture_screen_image(self: open3d.visualization.Visualizer, filename: os.PathLike, do_render: bool = False) None #
Function to capture and save a screen image
- Parameters:
filename (os.PathLike) – Path to file.
do_render (bool, optional, default=False) – Set to
True
to do render.
- Returns:
None
- clear_geometries(self: open3d.visualization.Visualizer) bool #
Function to clear geometries from the visualizer
- close(self: open3d.visualization.Visualizer) None #
Function to notify the window to be closed
- Returns:
None
- create_window(self: open3d.visualization.Visualizer, window_name: str = 'Open3D', width: int = 1920, height: int = 1080, left: int = 50, top: int = 50, visible: bool = True) bool #
Function to create a window and initialize GLFW
- Parameters:
window_name (str, optional, default='Open3D') – Window title name.
width (int, optional, default=1920) – Width of the window.
height (int, optional, default=1080) – Height of window.
left (int, optional, default=50) – Left margin of the window to the screen.
top (int, optional, default=50) – Top margin of the window to the screen.
visible (bool, optional, default=True) – Whether the window is visible.
- Returns:
bool
- destroy_window(self: open3d.visualization.Visualizer) None #
Function to destroy a window. This function MUST be called from the main thread.
- Returns:
None
- get_render_option(self: open3d.visualization.Visualizer) open3d.visualization.RenderOption #
Function to retrieve the associated
RenderOption
- Returns:
open3d.visualization.RenderOption
- get_view_control(self: open3d.visualization.Visualizer) open3d.visualization.ViewControl #
Function to retrieve the associated
ViewControl
- Returns:
open3d.visualization.ViewControl
- get_view_status(self: open3d.visualization.Visualizer) str #
Get the current view status as a json string of ViewTrajectory.
- get_window_name(self: open3d.visualization.Visualizer) str #
- Returns:
str
- is_full_screen(self: open3d.visualization.Visualizer) bool #
Function to query whether in fullscreen mode
- Returns:
bool
- poll_events(self: open3d.visualization.Visualizer) bool #
Function to poll events
- Returns:
bool
- register_animation_callback(self: open3d.visualization.Visualizer, callback_func: Callable[[open3d.visualization.Visualizer], bool]) None #
Function to register a callback function for animation. The callback function returns if UpdateGeometry() needs to be run.
- Parameters:
callback_func (Callable[[open3d.visualization.Visualizer], bool]) – The call back function.
- Returns:
None
- register_key_action_callback(self: open3d.visualization.VisualizerWithKeyCallback, key: int, callback_func: Callable[[open3d.visualization.Visualizer, int, int], bool]) None #
Function to register a callback function for a key action event. The callback function takes Visualizer, action and mods as input and returns a boolean indicating if UpdateGeometry() needs to be run. The action can be one of GLFW_RELEASE (0), GLFW_PRESS (1) or GLFW_REPEAT (2), see GLFW input interface. The mods specifies the modifier key, see GLFW modifier key
- register_key_callback(self: open3d.visualization.VisualizerWithKeyCallback, key: int, callback_func: Callable[[open3d.visualization.Visualizer], bool]) None #
Function to register a callback function for a key press event
- register_mouse_button_callback(self: open3d.visualization.VisualizerWithKeyCallback, callback_func: Callable[[open3d.visualization.Visualizer, int, int, int], bool]) None #
Function to register a callback function for a mouse button event. The callback function takes Visualizer, button, action and mods as input and returns a boolean indicating UpdateGeometry() needs to be run. The action can be one of GLFW_RELEASE (0), GLFW_PRESS (1) or GLFW_REPEAT (2), see GLFW input interface. The mods specifies the modifier key, see GLFW modifier key.
- register_mouse_move_callback(self: open3d.visualization.VisualizerWithKeyCallback, callback_func: Callable[[open3d.visualization.Visualizer, float, float], bool]) None #
Function to register a callback function for a mouse move event. The callback function takes Visualizer, x and y mouse position inside the window as input and returns a boolean indicating if UpdateGeometry() needs to be run. GLFW mouse position for more details.
- register_mouse_scroll_callback(self: open3d.visualization.VisualizerWithKeyCallback, callback_func: Callable[[open3d.visualization.Visualizer, float, float], bool]) None #
Function to register a callback function for a mouse scroll event. The callback function takes Visualizer, x and y mouse scroll offset as input and returns a boolean indicating if UpdateGeometry() needs to be run. GLFW mouse scrolling for more details.
- remove_geometry(self: open3d.visualization.Visualizer, geometry: open3d.geometry.Geometry, reset_bounding_box: bool = True) bool #
Function to remove geometry
- Parameters:
geometry (open3d.geometry.Geometry) – The
Geometry
object.reset_bounding_box (bool, optional, default=True) – Set to
False
to keep current viewpoint
- Returns:
bool
- reset_view_point(self: open3d.visualization.Visualizer, reset_bounding_box: bool = False) None #
Function to reset view point
- Parameters:
reset_bounding_box (bool, optional, default=False) – Set to
False
to keep current viewpoint- Returns:
None
- run(self: open3d.visualization.Visualizer) None #
Function to activate the window. This function will block the current thread until the window is closed.
- Returns:
None
- set_full_screen(self: open3d.visualization.Visualizer, fullscreen: bool) None #
Function to change between fullscreen and windowed
- Parameters:
fullscreen (bool) –
- Returns:
None
- set_view_status(self: open3d.visualization.Visualizer, view_status_str: str) None #
Set the current view status from a json string of ViewTrajectory.
- toggle_full_screen(self: open3d.visualization.Visualizer) None #
Function to toggle between fullscreen and windowed
- Returns:
None
- update_geometry(self: open3d.visualization.Visualizer, geometry: open3d.geometry.Geometry) bool #
Function to update geometry. This function must be called when geometry has been changed. Otherwise the behavior of Visualizer is undefined.
- Parameters:
geometry (open3d.geometry.Geometry) – The
Geometry
object.- Returns:
bool
- update_renderer(self: open3d.visualization.Visualizer) None #
Function to inform render needed to be updated
- Returns:
None