ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
Label3D.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 
10 #include <memory>
11 
13 namespace cloudViewer {
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
19 // CloudViewerScene class. See CloudViewerScene::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 
33  Color GetTextColor() const;
34  void SetTextColor(const Color& color);
35 
36 private:
37  struct Impl;
38  std::unique_ptr<Impl> impl_;
39 };
40 
41 } // namespace gui
42 } // namespace visualization
43 } // namespace cloudViewer
math::float4 color
void SetText(const char *text)
Sets the text of the label (copies text)
Definition: Label3D.cpp:36
void SetPosition(const Eigen::Vector3f &pos)
Definition: Label3D.cpp:40
void SetTextColor(const Color &color)
Definition: Label3D.cpp:46
Eigen::Vector3f GetPosition() const
Definition: Label3D.cpp:38
Label3D(const Eigen::Vector3f &pos, const char *text=nullptr)
Copies text.
Definition: Label3D.cpp:24
Generic file read and write utility for python interface.