ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
RadioButton.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 <functional>
11 #include <string>
12 
14 
15 namespace cloudViewer {
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 cloudViewer
std::function< void(std::shared_ptr< core::Tensor >)> callback
char type
void SetOnSelectionChanged(std::function< void(int)> callback)
Definition: RadioButton.cpp:64
void SetItems(const std::vector< std::string > &items)
Definition: RadioButton.cpp:42
DrawResult Draw(const DrawContext &context) override
Definition: RadioButton.cpp:94
Size CalcPreferredSize(const LayoutContext &context, const Constraints &constraints) const override
Definition: RadioButton.cpp:68
ImGuiContext * context
Definition: Window.cpp:76
Generic file read and write utility for python interface.