Open3D (C++ API)  0.17.0
WidgetStack.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 <memory>
12 
14 
15 namespace open3d {
16 namespace visualization {
17 namespace gui {
18 
32 class WidgetStack : public WidgetProxy {
33 public:
34  WidgetStack();
35  ~WidgetStack() override;
36 
43  void PushWidget(std::shared_ptr<Widget> widget);
44 
51  std::shared_ptr<Widget> PopWidget();
52 
58  void SetOnTop(std::function<void(std::shared_ptr<Widget>)> onTopCallback);
59 
60 private:
61  struct Impl;
62  std::unique_ptr<Impl> impl_;
63 };
64 
65 } // namespace gui
66 } // namespace visualization
67 } // namespace open3d
Widget container to delegate any widget dynamically.
Definition: WidgetProxy.h:47
WidgetStack manages multiple widgets in a stack.
Definition: WidgetStack.h:32
void PushWidget(std::shared_ptr< Widget > widget)
Push a widget into stack so the it be the topmost widget.
Definition: WidgetStack.cpp:23
void SetOnTop(std::function< void(std::shared_ptr< Widget >)> onTopCallback)
Setup a callback while a widget is popped out and a new widget becomes the topmost one.
Definition: WidgetStack.cpp:44
std::shared_ptr< Widget > PopWidget()
Pop the top most widget.
Definition: WidgetStack.cpp:28
WidgetStack()
Definition: WidgetStack.cpp:20
Definition: PinholeCameraIntrinsic.cpp:16
Definition: WidgetStack.cpp:15