Open3D (C++ API)  0.17.0
Label3D.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 #include <memory>
11 
13 namespace open3d {
14 namespace visualization {
15 namespace gui {
16 
17 // Label3D is a helper class for labels (like UI Labels) at 3D points as opposed
18 // to screen points. It is NOT a UI widget but is instead used via Open3DScene
19 // class. See Open3DScene::AddLabel/RemoveLabel.
20 class Label3D {
21 public:
23  explicit Label3D(const Eigen::Vector3f& pos, const char* text = nullptr);
24  ~Label3D();
25 
26  const char* GetText() const;
28  void SetText(const char* text);
29 
30  Eigen::Vector3f GetPosition() const;
31  void SetPosition(const Eigen::Vector3f& pos);
32 
34  Color GetTextColor() const;
35 
37  void SetTextColor(const Color& color);
38 
40  float GetTextScale() const;
41 
45  void SetTextScale(float scale);
46 
47 private:
48  struct Impl;
49  std::unique_ptr<Impl> impl_;
50 };
51 
52 } // namespace gui
53 } // namespace visualization
54 } // namespace open3d
math::float4 color
Definition: LineSetBuffers.cpp:45
Definition: Color.h:16
Definition: Label3D.h:20
Color GetTextColor() const
Returns the color with which the text will be drawn.
Definition: Label3D.cpp:45
const char * GetText() const
Definition: Label3D.cpp:35
Label3D(const Eigen::Vector3f &pos, const char *text=nullptr)
Copies text.
Definition: Label3D.cpp:25
float GetTextScale() const
Get the current scale. See not below on meaning of scale.
Definition: Label3D.cpp:49
~Label3D()
Definition: Label3D.cpp:33
void SetPosition(const Eigen::Vector3f &pos)
Definition: Label3D.cpp:41
void SetTextScale(float scale)
Definition: Label3D.cpp:51
Eigen::Vector3f GetPosition() const
Definition: Label3D.cpp:39
void SetTextColor(const Color &color)
Set the color with which the text will be drawn.
Definition: Label3D.cpp:47
void SetText(const char *text)
Sets the text of the label (copies text)
Definition: Label3D.cpp:37
Definition: PinholeCameraIntrinsic.cpp:16