Open3D (C++ API)  0.11.0
Data Structures | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Friends
open3d::visualization::gui::Menu Class Reference

#include <Menu.h>

Data Structures

struct  Impl
 

Public Types

using ItemId = int
 

Public Member Functions

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

Static Public Attributes

static constexpr ItemId NO_ITEM = -1
 

Protected Member Functions

void * GetNativePointer ()
 

Friends

class Application
 

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.

Member Typedef Documentation

◆ ItemId

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 
)

◆ AddMenu()

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

◆ AddSeparator()

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

◆ CalcHeight()

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

◆ CheckVisibilityChange()

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

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

◆ Draw()

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

◆ DrawMenuBar()

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

◆ GetNativePointer()

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

◆ GetNumberOfItems()

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

◆ InsertItem()

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

◆ InsertMenu()

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

◆ InsertSeparator()

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

◆ IsChecked()

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

◆ IsEnabled()

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

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

◆ SetChecked()

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

◆ SetEnabled()

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

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

Friends And Related Function Documentation

◆ Application

friend class Application
friend

Field Documentation

◆ NO_ITEM

constexpr ItemId open3d::visualization::gui::Menu::NO_ITEM = -1
static

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