Open3D (C++ API)  0.18.0+fcf98ee
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2023
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
8 #pragma once
12 struct GLFWwindow;
14 namespace open3d {
15 namespace visualization {
16 namespace gui {
19 public:
23  void Initialize() override;
24  void Uninitialize() override;
26  void WaitEventsTimeout(double timeout_secs) override;
28  Size GetScreenSize(OSWindow w) override;
31  int width,
32  int height,
33  const char* title,
34  int flags) override;
35  void DestroyWindow(OSWindow w) override;
37  void PostRedrawEvent(OSWindow w) override;
39  bool GetWindowIsVisible(OSWindow w) const override;
40  void ShowWindow(OSWindow w, bool show) override;
42  void RaiseWindowToTop(OSWindow w) override;
43  bool IsActiveWindow(OSWindow w) const override;
45  Point GetWindowPos(OSWindow w) const override;
46  void SetWindowPos(OSWindow w, int x, int y) override;
48  Size GetWindowSize(OSWindow w) const override;
49  void SetWindowSize(OSWindow w, int width, int height) override;
51  Size GetWindowSizePixels(OSWindow w) const override;
52  void SetWindowSizePixels(OSWindow w, const Size& size) override;
54  float GetWindowScaleFactor(OSWindow w) const override;
55  float GetUIScaleFactor(OSWindow w) const override;
57  void SetWindowTitle(OSWindow w, const char* title) override;
59  Point GetMousePosInWindow(OSWindow w) const override;
60  int GetMouseButtons(OSWindow w) const override;
62  void CancelUserClose(OSWindow w) override;
64  void* GetNativeDrawable(OSWindow w) override;
68  void ResizeRenderer(OSWindow w,
69  rendering::FilamentRenderer* renderer) override;
71  MenuBase* CreateOSMenu() override;
73 private:
74  static void DrawCallback(GLFWwindow* window);
75  static void ResizeCallback(GLFWwindow* window, int os_width, int os_height);
76  static void WindowMovedCallback(GLFWwindow* window, int os_x, int os_y);
77  static void RescaleCallback(GLFWwindow* window, float xscale, float yscale);
78  static void MouseMoveCallback(GLFWwindow* window, double x, double y);
79  static void MouseButtonCallback(GLFWwindow* window,
80  int button,
81  int action,
82  int mods);
83  static void MouseScrollCallback(GLFWwindow* window, double dx, double dy);
84  static void KeyCallback(
85  GLFWwindow* window, int key, int scancode, int action, int mods);
86  static void CharCallback(GLFWwindow* window, unsigned int utf32char);
87  static void DragDropCallback(GLFWwindow*, int count, const char* paths[]);
88  static void CloseCallback(GLFWwindow* window);
89 };
91 } // namespace gui
92 } // namespace visualization
93 } // namespace open3d
Window * o3d_window
Definition: BitmapWindowSystem.cpp:29
Definition: GLFWWindowSystem.h:18
Point GetWindowPos(OSWindow w) const override
Definition: GLFWWindowSystem.cpp:223
void WaitEventsTimeout(double timeout_secs) override
Definition: GLFWWindowSystem.cpp:123
Point GetMousePosInWindow(OSWindow w) const override
Definition: GLFWWindowSystem.cpp:279
void SetWindowTitle(OSWindow w, const char *title) override
Definition: GLFWWindowSystem.cpp:275
bool IsActiveWindow(OSWindow w) const override
Definition: GLFWWindowSystem.cpp:219
void SetWindowSize(OSWindow w, int width, int height) override
Definition: GLFWWindowSystem.cpp:239
void CancelUserClose(OSWindow w) override
Definition: GLFWWindowSystem.cpp:301
void * GetNativeDrawable(OSWindow w) override
Definition: GLFWWindowSystem.cpp:521
Size GetWindowSize(OSWindow w) const override
Definition: GLFWWindowSystem.cpp:233
rendering::FilamentRenderer * CreateRenderer(OSWindow w) override
Definition: GLFWWindowSystem.cpp:525
bool GetWindowIsVisible(OSWindow w) const override
Definition: GLFWWindowSystem.cpp:203
Size GetScreenSize(OSWindow w) override
Definition: GLFWWindowSystem.cpp:131
Definition: GLFWWindowSystem.cpp:103
void ShowWindow(OSWindow w, bool show) override
Definition: GLFWWindowSystem.cpp:207
Definition: GLFWWindowSystem.cpp:105
void SetWindowSizePixels(OSWindow w, const Size &size) override
Definition: GLFWWindowSystem.cpp:249
void RaiseWindowToTop(OSWindow w) override
Definition: GLFWWindowSystem.cpp:215
void SetWindowPos(OSWindow w, int x, int y) override
Definition: GLFWWindowSystem.cpp:229
int GetMouseButtons(OSWindow w) const override
Definition: GLFWWindowSystem.cpp:286
Size GetWindowSizePixels(OSWindow w) const override
Definition: GLFWWindowSystem.cpp:243
void Initialize() override
Definition: GLFWWindowSystem.cpp:107
float GetUIScaleFactor(OSWindow w) const override
Definition: GLFWWindowSystem.cpp:269
void ResizeRenderer(OSWindow w, rendering::FilamentRenderer *renderer) override
Definition: GLFWWindowSystem.cpp:531
void Uninitialize() override
Definition: GLFWWindowSystem.cpp:121
void PostRedrawEvent(OSWindow w) override
Definition: GLFWWindowSystem.cpp:199
float GetWindowScaleFactor(OSWindow w) const override
Definition: GLFWWindowSystem.cpp:254
MenuBase * CreateOSMenu() override
Definition: GLFWWindowSystem.cpp:541
OSWindow CreateOSWindow(Window *o3d_window, int width, int height, const char *title, int flags) override
Definition: GLFWWindowSystem.cpp:154
void DestroyWindow(OSWindow w) override
Definition: GLFWWindowSystem.cpp:195
Definition: MenuBase.h:26
Definition: Window.h:30
Definition: WindowSystem.h:27
void * OSWindow
Definition: WindowSystem.h:29
int width
Definition: FilePCD.cpp:52
int size
Definition: FilePCD.cpp:40
int height
Definition: FilePCD.cpp:53
int count
Definition: FilePCD.cpp:42
Definition: PinholeCameraIntrinsic.cpp:16