Open3D (C++ API)  0.18.0+252c867
TabControl.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 
13 
14 namespace open3d {
15 namespace visualization {
16 namespace gui {
17 
18 class TabControl : public Widget {
19  using Super = Widget;
20 
21 public:
22  TabControl();
23  ~TabControl();
24 
25  void AddTab(const char* name, std::shared_ptr<Widget> panel);
26 
28  const Constraints& constraints) const override;
29  void Layout(const LayoutContext& context) override;
30 
31  DrawResult Draw(const DrawContext& context) override;
32 
33  void SetOnSelectedTabChanged(std::function<void(int)> on_changed);
34  void SetSelectedTabIndex(int index);
35  int GetSelectedTabIndex();
36 
37 private:
38  struct Impl;
39  std::unique_ptr<Impl> impl_;
40 };
41 
42 } // namespace gui
43 } // namespace visualization
44 } // namespace open3d
ImGuiContext * context
Definition: Window.cpp:76
Definition: TabControl.h:18
int GetSelectedTabIndex()
Definition: TabControl.cpp:59
void SetSelectedTabIndex(int index)
Definition: TabControl.cpp:54
void SetOnSelectedTabChanged(std::function< void(int)> on_changed)
Definition: TabControl.cpp:51
void AddTab(const char *name, std::shared_ptr< Widget > panel)
Definition: TabControl.cpp:45
~TabControl()
Definition: TabControl.cpp:43
DrawResult Draw(const DrawContext &context) override
Definition: TabControl.cpp:86
TabControl()
Definition: TabControl.cpp:38
Size CalcPreferredSize(const LayoutContext &context, const Constraints &constraints) const override
Definition: TabControl.cpp:61
void Layout(const LayoutContext &context) override
Definition: TabControl.cpp:73
Definition: Widget.h:49
Widget()
Definition: Widget.cpp:34
DrawResult
Definition: Widget.h:95
std::string name
Definition: FilePCD.cpp:39
Definition: PinholeCameraIntrinsic.cpp:16