Open3D (C++ API)  0.18.0+5c982c7
Label.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 
11 
12 namespace open3d {
13 namespace visualization {
14 namespace gui {
15 
16 class Label : public Widget {
17  using Super = Widget;
18 
19 public:
21  explicit Label(const char* text = nullptr);
22  ~Label();
23 
24  const char* GetText() const;
26  void SetText(const char* text);
27 
28  Color GetTextColor() const;
29  void SetTextColor(const Color& color);
30 
31  FontId GetFontId() const;
32  void SetFontId(const FontId font_id);
33 
35  const Constraints& constraints) const override;
36 
37  DrawResult Draw(const DrawContext& context) override;
38 
39 private:
40  struct Impl;
41  std::unique_ptr<Impl> impl_;
42 };
43 
44 } // namespace gui
45 } // namespace visualization
46 } // namespace open3d
math::float4 color
Definition: LineSetBuffers.cpp:45
ImGuiContext * context
Definition: Window.cpp:76
Definition: Color.h:16
Definition: Label.h:16
~Label()
Definition: Label.cpp:48
DrawResult Draw(const DrawContext &context) override
Definition: Label.cpp:115
void SetFontId(const FontId font_id)
Definition: Label.cpp:63
Size CalcPreferredSize(const LayoutContext &context, const Constraints &constraints) const override
Definition: Label.cpp:65
void SetText(const char *text)
Sets the text of the label (copies text)
Definition: Label.cpp:52
const char * GetText() const
Definition: Label.cpp:50
Color GetTextColor() const
Definition: Label.cpp:57
void SetTextColor(const Color &color)
Definition: Label.cpp:59
Label(const char *text=nullptr)
Copies text.
Definition: Label.cpp:42
FontId GetFontId() const
Definition: Label.cpp:61
Definition: Widget.h:49
Widget()
Definition: Widget.cpp:34
DrawResult
Definition: Widget.h:95
unsigned int FontId
Definition: Gui.h:68
Definition: PinholeCameraIntrinsic.cpp:16