Open3D (C++ API)  0.18.0+252c867
RadioButton.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 <functional>
11 #include <string>
12 
14 
15 namespace open3d {
16 namespace visualization {
17 namespace gui {
18 
19 class RadioButton : public Widget {
20 public:
24  enum Type { VERT, HORIZ };
25 
26  explicit RadioButton(Type type);
27  ~RadioButton() override;
28 
29  void SetItems(const std::vector<std::string>& items);
30  int GetSelectedIndex() const;
31  const char* GetSelectedValue() const;
32  void SetSelectedIndex(int index);
33 
36  void SetOnSelectionChanged(std::function<void(int)> callback);
37 
39  const Constraints& constraints) const override;
40 
41  DrawResult Draw(const DrawContext& context) override;
42 
43 private:
44  struct Impl;
45  std::unique_ptr<Impl> impl_;
46 };
47 
48 } // namespace gui
49 } // namespace visualization
50 } // namespace open3d
std::function< void(std::shared_ptr< core::Tensor >)> callback
Definition: FilamentRenderer.cpp:182
ImGuiContext * context
Definition: Window.cpp:76
Definition: RadioButton.h:19
DrawResult Draw(const DrawContext &context) override
Definition: RadioButton.cpp:94
RadioButton(Type type)
Definition: RadioButton.cpp:35
int GetSelectedIndex() const
Definition: RadioButton.cpp:47
void SetItems(const std::vector< std::string > &items)
Definition: RadioButton.cpp:42
const char * GetSelectedValue() const
Definition: RadioButton.cpp:49
void SetOnSelectionChanged(std::function< void(int)> callback)
Definition: RadioButton.cpp:64
Size CalcPreferredSize(const LayoutContext &context, const Constraints &constraints) const override
Definition: RadioButton.cpp:68
void SetSelectedIndex(int index)
Definition: RadioButton.cpp:58
Type
Definition: RadioButton.h:24
@ VERT
Definition: RadioButton.h:24
@ HORIZ
Definition: RadioButton.h:24
Definition: Widget.h:49
DrawResult
Definition: Widget.h:95
char type
Definition: FilePCD.cpp:41
Definition: PinholeCameraIntrinsic.cpp:16
Definition: RadioButton.cpp:27