ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
VectorEdit.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 <Eigen/Geometry>
11 
13 
14 namespace cloudViewer {
15 namespace visualization {
16 namespace gui {
17 
18 class VectorEdit : public Widget {
19  using Super = Widget;
20 
21 public:
22  VectorEdit();
23  ~VectorEdit();
24 
25  Eigen::Vector3f GetValue() const;
27  void SetValue(const Eigen::Vector3f& val);
28 
31  void SetOnValueChanged(
32  std::function<void(const Eigen::Vector3f&)> on_changed);
33 
35  const Constraints& constraints) const override;
36  Widget::DrawResult Draw(const DrawContext& context) override;
37 
38 private:
39  struct Impl;
40  std::unique_ptr<Impl> impl_;
41 };
42 
43 } // namespace gui
44 } // namespace visualization
45 } // namespace cloudViewer
Size CalcPreferredSize(const LayoutContext &context, const Constraints &constraints) const override
Definition: VectorEdit.cpp:51
Widget::DrawResult Draw(const DrawContext &context) override
Definition: VectorEdit.cpp:58
void SetValue(const Eigen::Vector3f &val)
Sets the value of the widget. Does not call onValueChanged.
Definition: VectorEdit.cpp:38
void SetOnValueChanged(std::function< void(const Eigen::Vector3f &)> on_changed)
Definition: VectorEdit.cpp:46
ImGuiContext * context
Definition: Window.cpp:76
Generic file read and write utility for python interface.