Open3D (C++ API)  0.18.0
MenuImgui.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 
11 
12 namespace open3d {
13 namespace visualization {
14 namespace gui {
15 
16 class MenuImgui : public MenuBase {
17 public:
18  MenuImgui();
19  virtual ~MenuImgui();
20 
21  void AddItem(const char* name,
22  ItemId item_id = NO_ITEM,
23  KeyName key = KEY_NONE) override;
24  void AddMenu(const char* name, std::shared_ptr<MenuBase> submenu) override;
25  void AddSeparator() override;
26 
27  void InsertItem(int index,
28  const char* name,
29  ItemId item_id = NO_ITEM,
30  KeyName key = KEY_NONE) override;
31  void InsertMenu(int index,
32  const char* name,
33  std::shared_ptr<MenuBase> submenu) override;
34  void InsertSeparator(int index) override;
35 
36  int GetNumberOfItems() const override;
37 
38  bool IsEnabled(ItemId item_id) const override;
39  void SetEnabled(ItemId item_id, bool enabled) override;
40 
41  bool IsChecked(ItemId item_id) const override;
42  void SetChecked(ItemId item_id, bool checked) override;
43 
44  int CalcHeight(const Theme& theme) const override;
45 
46  bool CheckVisibilityChange() const override;
47 
48  ItemId DrawMenuBar(const DrawContext& context, bool is_enabled) override;
50  const char* name,
51  bool is_enabled) override;
52 
53  void* GetNativePointer() override;
54 
55 private:
56  struct Impl;
57  std::unique_ptr<Impl> impl_;
58 };
59 
60 } // namespace gui
61 } // namespace visualization
62 } // namespace open3d
ImGuiContext * context
Definition: Window.cpp:76
const Theme * theme
Definition: Window.cpp:74
Definition: MenuBase.h:26
static constexpr ItemId NO_ITEM
Definition: MenuBase.h:29
int ItemId
Definition: MenuBase.h:28
Definition: MenuImgui.h:16
void AddItem(const char *name, ItemId item_id=NO_ITEM, KeyName key=KEY_NONE) override
Definition: MenuImgui.cpp:85
bool IsEnabled(ItemId item_id) const override
Definition: MenuImgui.cpp:138
bool IsChecked(ItemId item_id) const override
Definition: MenuImgui.cpp:153
void AddMenu(const char *name, std::shared_ptr< MenuBase > submenu) override
Definition: MenuImgui.cpp:91
void SetChecked(ItemId item_id, bool checked) override
Definition: MenuImgui.cpp:161
void SetEnabled(ItemId item_id, bool enabled) override
Definition: MenuImgui.cpp:146
virtual ~MenuImgui()
Definition: MenuImgui.cpp:81
bool CheckVisibilityChange() const override
Returns true if submenu visibility changed on last call to DrawMenuBar.
Definition: MenuImgui.cpp:174
void * GetNativePointer() override
Definition: MenuImgui.cpp:83
ItemId DrawMenuBar(const DrawContext &context, bool is_enabled) override
Definition: MenuImgui.cpp:178
ItemId Draw(const DrawContext &context, const char *name, bool is_enabled) override
Definition: MenuImgui.cpp:221
int GetNumberOfItems() const override
Definition: MenuImgui.cpp:136
MenuImgui()
Definition: MenuImgui.cpp:79
void InsertSeparator(int index) override
Definition: MenuImgui.cpp:125
void AddSeparator() override
Definition: MenuImgui.cpp:95
void InsertMenu(int index, const char *name, std::shared_ptr< MenuBase > submenu) override
Definition: MenuImgui.cpp:111
int CalcHeight(const Theme &theme) const override
Definition: MenuImgui.cpp:168
void InsertItem(int index, const char *name, ItemId item_id=NO_ITEM, KeyName key=KEY_NONE) override
Definition: MenuImgui.cpp:97
std::string name
Definition: FilePCD.cpp:39
KeyName
Definition: Events.h:96
@ KEY_NONE
Definition: Events.h:97
Definition: PinholeCameraIntrinsic.cpp:16
Definition: Theme.h:20