Example #1
0
    def _create_ui(self, title, width, height):
        """Create new Open3D application window and rendering widgets. Must run
        in the GUI thread.

        Args:
            title (str): Window title (unused).
            width (int): Window width.
            height (int): Window height.
        """
        self.window = O3DVisualizer(title, width, height)
        self.window.show_menu(False)
        # Add 3D scene
        self.window.set_background((1, 1, 1, 1), None)  # White background
        # Register frontend callbacks
        class_name_base = "tensorboard/" + self.window.uid
        webrtc_server.register_data_channel_message_callback(
            class_name_base + "/get_run_tags", self._get_run_tags)
        webrtc_server.register_data_channel_message_callback(
            class_name_base + "/update_geometry", self._update_geometry)
        gui.Application.instance.add_window(self.window)
Example #2
0
 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)