def __init__(self, context): """Instantiates Open3D plugin. Args: context: A `base_plugin.TBContext` instance. """ self._logdir = context.logdir self.data_reader = Open3DPluginDataReader(self._logdir) self.window_lock = threading.Lock() # protect self._windows self._http_api_lock = threading.Lock() self._windows = {} webrtc_server.disable_http_handshake() # Dummy window to ensure GUI remains active even if all user windows are # closed. self._dummy_window = async_event_loop.run_sync( gui.Application.instance.create_window, "Open3D Dummy Window", 32, 32)
def _start_gui(self): webrtc_server.disable_http_handshake() webrtc_server.enable_webrtc() from open3d.visualization.async_event_loop import async_event_loop self._gui = async_event_loop # Dummy window to ensure GUI remains active even if all user windows are # closed. self._dummy_window = self._gui.run_sync( gui.Application.instance.create_window, "Open3D Dummy Window", 32, 32) webrtc_server.register_data_channel_message_callback( "tensorboard/show_hide_axes", self._show_hide) webrtc_server.register_data_channel_message_callback( "tensorboard/show_hide_ground", self._show_hide) webrtc_server.register_data_channel_message_callback( "tensorboard/sync_view", self._sync_view) webrtc_server.register_data_channel_message_callback( "tensorboard/update_rendering", self._update_rendering)