Open3D (C++ API)  0.18.0+252c867
Data Structures | Public Member Functions | Friends
open3d::visualization::gui::Menu Class Reference

#include <Menu.h>

Inheritance diagram for open3d::visualization::gui::Menu:
open3d::visualization::gui::MenuBase

Data Structures

struct  Impl
 

Public Member Functions

 Menu ()
 
virtual ~Menu ()
 
void AddItem (const char *name, ItemId item_id=NO_ITEM, KeyName key=KEY_NONE) override
 
void AddMenu (const char *name, std::shared_ptr< MenuBase > submenu) override
 
void AddSeparator () override
 
void InsertItem (int index, const char *name, ItemId item_id=NO_ITEM, KeyName key=KEY_NONE) override
 
void InsertMenu (int index, const char *name, std::shared_ptr< MenuBase > submenu) override
 
void InsertSeparator (int index) override
 
int GetNumberOfItems () const override
 
bool IsEnabled (ItemId item_id) const override
 
void SetEnabled (ItemId item_id, bool enabled) override
 
bool IsChecked (ItemId item_id) const override
 
void SetChecked (ItemId item_id, bool checked) override
 
int CalcHeight (const Theme &theme) const override
 
bool CheckVisibilityChange () const override
 Returns true if submenu visibility changed on last call to DrawMenuBar. More...
 
ItemId DrawMenuBar (const DrawContext &context, bool is_enabled) override
 
ItemId Draw (const DrawContext &context, const char *name, bool is_enabled) override
 
void * GetNativePointer () override
 
- Public Member Functions inherited from open3d::visualization::gui::MenuBase
 MenuBase ()
 
virtual ~MenuBase ()
 

Friends

class Application
 

Additional Inherited Members

- Public Types inherited from open3d::visualization::gui::MenuBase
using ItemId = int
 
- Static Public Attributes inherited from open3d::visualization::gui::MenuBase
static constexpr ItemId NO_ITEM = -1
 

Detailed Description

The menu item action is handled by Window, rather than by registering a a callback function with (non-existent) Menu::SetOnClicked(). This is because on macOS the menubar is global over all application windows, so any callback would need to go find the data object corresponding to the active window.

Constructor & Destructor Documentation

◆ Menu()

open3d::visualization::gui::Menu::Menu ( )

◆ ~Menu()

open3d::visualization::gui::Menu::~Menu ( )
virtual

Member Function Documentation

◆ AddItem()

void open3d::visualization::gui::Menu::AddItem ( const char *  name,
ItemId  item_id = NO_ITEM,
KeyName  key = KEY_NONE 
)
overridevirtual

◆ AddMenu()

void open3d::visualization::gui::Menu::AddMenu ( const char *  name,
std::shared_ptr< MenuBase submenu 
)
overridevirtual

◆ AddSeparator()

void open3d::visualization::gui::Menu::AddSeparator ( )
overridevirtual

◆ CalcHeight()

int open3d::visualization::gui::Menu::CalcHeight ( const Theme theme) const
overridevirtual

◆ CheckVisibilityChange()

bool open3d::visualization::gui::Menu::CheckVisibilityChange ( ) const
overridevirtual

Returns true if submenu visibility changed on last call to DrawMenuBar.

Implements open3d::visualization::gui::MenuBase.

◆ Draw()

MenuBase::ItemId open3d::visualization::gui::Menu::Draw ( const DrawContext context,
const char *  name,
bool  is_enabled 
)
overridevirtual

◆ DrawMenuBar()

MenuBase::ItemId open3d::visualization::gui::Menu::DrawMenuBar ( const DrawContext context,
bool  is_enabled 
)
overridevirtual

◆ GetNativePointer()

void * open3d::visualization::gui::Menu::GetNativePointer ( )
overridevirtual

◆ GetNumberOfItems()

int open3d::visualization::gui::Menu::GetNumberOfItems ( ) const
overridevirtual

◆ InsertItem()

void open3d::visualization::gui::Menu::InsertItem ( int  index,
const char *  name,
ItemId  item_id = NO_ITEM,
KeyName  key = KEY_NONE 
)
overridevirtual

◆ InsertMenu()

void open3d::visualization::gui::Menu::InsertMenu ( int  index,
const char *  name,
std::shared_ptr< MenuBase submenu 
)
overridevirtual

◆ InsertSeparator()

void open3d::visualization::gui::Menu::InsertSeparator ( int  index)
overridevirtual

◆ IsChecked()

bool open3d::visualization::gui::Menu::IsChecked ( ItemId  item_id) const
overridevirtual

◆ IsEnabled()

bool open3d::visualization::gui::Menu::IsEnabled ( ItemId  item_id) const
overridevirtual

Searches the menu hierarchy down from this menu to find the item and returns true if the item is enabled.

Implements open3d::visualization::gui::MenuBase.

◆ SetChecked()

void open3d::visualization::gui::Menu::SetChecked ( ItemId  item_id,
bool  checked 
)
overridevirtual

◆ SetEnabled()

void open3d::visualization::gui::Menu::SetEnabled ( ItemId  item_id,
bool  enabled 
)
overridevirtual

Searches the menu hierarchy down from this menu to find the item and set it enabled according to enabled.

Implements open3d::visualization::gui::MenuBase.

Friends And Related Function Documentation

◆ Application

friend class Application
friend

The documentation for this class was generated from the following files: