Open3D (C++ API)  0.18.0
Gui.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2023 www.open3d.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 namespace open3d {
11 namespace visualization {
12 namespace gui {
13 
14 struct Point {
15  int x;
16  int y;
17 
18  Point();
19  Point(int x_, int y_);
20 };
21 
22 struct Size {
23  int width;
24  int height;
25 
26  Size();
27  Size(int w, int h);
28 };
29 
30 struct Rect {
31  int x;
32  int y;
33  int width;
34  int height;
35 
36  Rect();
37  Rect(int x_, int y_, int w_, int h_);
38 
39  int GetTop() const;
40  int GetBottom() const;
41  int GetLeft() const;
42  int GetRight() const;
43 
44  bool Contains(int x, int y) const;
45  bool Contains(const Point& pt) const;
46 
47  Rect UnionedWith(const Rect& r) const;
48 
49  bool operator==(const Rect& other) const;
50  bool operator!=(const Rect& other) const;
51 };
52 
53 enum class BorderShape { NONE = 0, RECT, ROUNDED_RECT };
54 
55 enum class Alignment : unsigned int {
56  LEFT = 1,
57  HCENTER = 2,
58  RIGHT = 3,
59  TOP = (1 << 4),
60  VCENTER = (2 << 4),
61  BOTTOM = (3 << 4),
62  CENTER = (2 | (2 << 4))
63 };
65  return Alignment((unsigned int)(x) | (unsigned int)(y));
66 }
67 
68 using FontId = unsigned int;
69 
70 enum class FontStyle {
71  NORMAL = 0,
72  BOLD = 1,
73  ITALIC = 2,
74  BOLD_ITALIC = 3
75 };
76 
77 class FontContext {
78 public:
79  virtual ~FontContext(){};
80 
81  virtual void* GetFont(FontId font_id) = 0;
82 };
83 
84 } // namespace gui
85 } // namespace visualization
86 } // namespace open3d
virtual ~FontContext()
Definition: Gui.h:79
virtual void * GetFont(FontId font_id)=0
const char const char value recording_handle imu_sample recording_handle uint8_t size_t data_size k4a_record_configuration_t config target_format k4a_capture_t capture_handle k4a_imu_sample_t imu_sample playback_handle k4a_logging_message_cb_t void min_level device_handle k4a_imu_sample_t timeout_in_ms capture_handle capture_handle capture_handle image_handle temperature_c int
Definition: K4aPlugin.cpp:474
constexpr Alignment operator|(Alignment x, Alignment y)
Definition: Gui.h:64
FontStyle
Definition: Gui.h:70
Alignment
Definition: Gui.h:55
BorderShape
Definition: Gui.h:53
unsigned int FontId
Definition: Gui.h:68
Definition: PinholeCameraIntrinsic.cpp:16
Point()
Definition: Gui.cpp:16
int x
Definition: Gui.h:15
int y
Definition: Gui.h:16
int y
Definition: Gui.h:32
Rect UnionedWith(const Rect &r) const
Definition: Gui.cpp:46
int width
Definition: Gui.h:33
int GetRight() const
Definition: Gui.cpp:37
bool Contains(int x, int y) const
Definition: Gui.cpp:39
int GetLeft() const
Definition: Gui.cpp:35
bool operator==(const Rect &other) const
Definition: Gui.cpp:54
int GetTop() const
Definition: Gui.cpp:31
bool operator!=(const Rect &other) const
Definition: Gui.cpp:59
Rect()
Definition: Gui.cpp:26
int height
Definition: Gui.h:34
int x
Definition: Gui.h:31
int GetBottom() const
Definition: Gui.cpp:33
int height
Definition: Gui.h:24
int width
Definition: Gui.h:23
Size()
Definition: Gui.cpp:21