open3d.visualization.gui.SceneWidget

class open3d.visualization.gui.SceneWidget

Displays 3D content

class Constraints

Constraints object for Widget.calc_preferred_size()

__init__(self: open3d.cpu.pybind.visualization.gui.Widget.Constraints)None
property height
property width
class Controls

Enum class describing mouse interaction.

FLY = Controls.FLY
PICK_POINTS = Controls.PICK_POINTS
ROTATE_CAMERA = Controls.ROTATE_CAMERA
ROTATE_CAMERA_SPHERE = Controls.ROTATE_CAMERA_SPHERE
ROTATE_IBL = Controls.ROTATE_IBL
ROTATE_MODEL = Controls.ROTATE_MODEL
ROTATE_SUN = Controls.ROTATE_SUN
class EventCallbackResult

Returned by event handlers

Members:

IGNORED : Event handler ignored the event, widget will handle event normally

HANDLED : Event handler handled the event, but widget will still handle the event normally. This is useful when you are augmenting base functionality

CONSUMED : Event handler consumed the event, event handling stops, widget will not handle the event. This is useful when you are replacing functionality

CONSUMED = EventCallbackResult.CONSUMED
HANDLED = EventCallbackResult.HANDLED
IGNORED = EventCallbackResult.IGNORED
__init__(self: open3d.cpu.pybind.visualization.gui.SceneWidget)None

Creates an empty SceneWidget. Assign a Scene with the ‘scene’ property

add_3d_label(self: open3d.cpu.pybind.visualization.gui.SceneWidget, arg0: numpy.ndarray[float32[3, 1]], arg1: str)open3d.cpu.pybind.visualization.gui.Label3D

Add a 3D text label to the scene. The label will be anchored at the specified 3D point.

add_child(self: open3d.cpu.pybind.visualization.gui.Widget, arg0: open3d.cpu.pybind.visualization.gui.Widget)None

Adds a child widget

calc_preferred_size(self: open3d.cpu.pybind.visualization.gui.Widget, arg0: open3d.cpu.pybind.visualization.gui.LayoutContext, arg1: open3d.cpu.pybind.visualization.gui.Widget.Constraints)open3d.cpu.pybind.visualization.gui.Size

Returns the preferred size of the widget. This is intended to be called only during layout, although it will also work during drawing. Calling it at other times will not work, as it requires some internal setup in order to function properly

enable_scene_caching(self: open3d.cpu.pybind.visualization.gui.SceneWidget, arg0: bool)None

Enable/Disable caching of scene content when the view or model is not changing. Scene caching can help improve UI responsiveness for large models and point clouds

force_redraw(self: open3d.cpu.pybind.visualization.gui.SceneWidget)None

Ensures scene redraws even when scene caching is enabled.

get_children(self: open3d.cpu.pybind.visualization.gui.Widget)List[open3d.cpu.pybind.visualization.gui.Widget]

Returns the array of children. Do not modify.

look_at(self: open3d.cpu.pybind.visualization.gui.SceneWidget, arg0: numpy.ndarray[float32[3, 1]], arg1: numpy.ndarray[float32[3, 1]], arg2: numpy.ndarray[float32[3, 1]])None

look_at(center, eye, up): sets the camera view so that the camera is located at ‘eye’, pointing towards ‘center’, and oriented so that the up vector is ‘up’

remove_3d_label(self: open3d.cpu.pybind.visualization.gui.SceneWidget, arg0: open3d.cpu.pybind.visualization.gui.Label3D)None

Removes the 3D text label from the scene

set_on_key(self: open3d.cpu.pybind.visualization.gui.SceneWidget, arg0: Callable[[open3d.cpu.pybind.visualization.gui.KeyEvent], int])None

Sets a callback for key events. This callback is passed a KeyEvent object. The callback must return EventCallbackResult.IGNORED, EventCallbackResult.HANDLED, or EventCallackResult.CONSUMED.

set_on_mouse(self: open3d.cpu.pybind.visualization.gui.SceneWidget, arg0: Callable[[open3d.cpu.pybind.visualization.gui.MouseEvent], int])None

Sets a callback for mouse events. This callback is passed a MouseEvent object. The callback must return EventCallbackResult.IGNORED, EventCallbackResult.HANDLED, or EventCallackResult.CONSUMED.

set_on_sun_direction_changed(self: open3d.cpu.pybind.visualization.gui.SceneWidget, arg0: Callable[[numpy.ndarray[float32[3, 1]]], None])None

Callback when user changes sun direction (only called in ROTATE_SUN control mode). Called with one argument, the [i, j, k] vector of the new sun direction

set_view_controls(self: open3d.cpu.pybind.visualization.gui.SceneWidget, arg0: open3d.cpu.pybind.visualization.gui.SceneWidget.Controls)None

Sets mouse interaction, e.g. ROTATE_OBJ

setup_camera(*args, **kwargs)

Overloaded function.

  1. setup_camera(self: open3d.cpu.pybind.visualization.gui.SceneWidget, arg0: float, arg1: open3d.cpu.pybind.geometry.AxisAlignedBoundingBox, arg2: numpy.ndarray[float32[3, 1]]) -> None

Configure the camera: setup_camera(field_of_view, model_bounds, center_of_rotation)

  1. setup_camera(self: open3d.cpu.pybind.visualization.gui.SceneWidget, arg0: open3d.cpu.pybind.camera.PinholeCameraIntrinsic, arg1: numpy.ndarray[float64[4, 4]], arg2: open3d.cpu.pybind.geometry.AxisAlignedBoundingBox) -> None

setup_camera(intrinsics, extrinsic_matrix, model_bounds): sets the camera view

  1. setup_camera(self: open3d.cpu.pybind.visualization.gui.SceneWidget, arg0: numpy.ndarray[float64[3, 3]], arg1: numpy.ndarray[float64[4, 4]], arg2: int, arg3: int, arg4: open3d.cpu.pybind.geometry.AxisAlignedBoundingBox) -> None

setup_camera(intrinsic_matrix, extrinsic_matrix, intrinsic_width_px, intrinsic_height_px, model_bounds): sets the camera view

CONSUMED = EventCallbackResult.CONSUMED
FLY = Controls.FLY
HANDLED = EventCallbackResult.HANDLED
IGNORED = EventCallbackResult.IGNORED
PICK_POINTS = Controls.PICK_POINTS
ROTATE_CAMERA = Controls.ROTATE_CAMERA
ROTATE_CAMERA_SPHERE = Controls.ROTATE_CAMERA_SPHERE
ROTATE_IBL = Controls.ROTATE_IBL
ROTATE_MODEL = Controls.ROTATE_MODEL
ROTATE_SUN = Controls.ROTATE_SUN
property background_color

Background color of the widget

property center_of_rotation

Current center of rotation (for ROTATE_CAMERA and ROTATE_CAMERA_SPHERE)

property enabled

True if widget is enabled, False if disabled

property frame

The widget’s frame. Setting this value will be overridden if the frame is within a layout.

property scene

The rendering.Open3DScene that the SceneWidget renders

property tooltip

Widget’s tooltip that is displayed on mouseover

property visible

True if widget is visible, False otherwise