ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
Label.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
11 
12 namespace cloudViewer {
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 cloudViewer
math::float4 color
const char * GetText() const
Definition: Label.cpp:50
void SetText(const char *text)
Sets the text of the label (copies text)
Definition: Label.cpp:52
void SetTextColor(const Color &color)
Definition: Label.cpp:59
DrawResult Draw(const DrawContext &context) override
Definition: Label.cpp:115
Label(const char *text=nullptr)
Copies text.
Definition: Label.cpp:42
Size CalcPreferredSize(const LayoutContext &context, const Constraints &constraints) const override
Definition: Label.cpp:65
void SetFontId(const FontId font_id)
Definition: Label.cpp:63
ImGuiContext * context
Definition: Window.cpp:76
Generic file read and write utility for python interface.