Open3D (C++ API)  0.11.0
Data Structures | Public Types | Public Member Functions
open3d::visualization::gui::TreeView Class Reference

#include <TreeView.h>

Inheritance diagram for open3d::visualization::gui::TreeView:
open3d::visualization::gui::Widget

Data Structures

struct  Impl
 

Public Types

using ItemId = int
 
- Public Types inherited from open3d::visualization::gui::Widget
enum  DrawResult { DrawResult::NONE, DrawResult::REDRAW, DrawResult::RELAYOUT }
 
enum  EventResult { EventResult::IGNORED, EventResult::CONSUMED, EventResult::DISCARD }
 

Public Member Functions

 TreeView ()
 
 ~TreeView ()
 
ItemId GetRootItem () const
 
ItemId AddItem (ItemId parent_id, std::shared_ptr< Widget > item)
 Adds an item to the tree. More...
 
ItemId AddTextItem (ItemId parent_id, const char *text)
 Adds a text item to the tree. More...
 
void RemoveItem (ItemId item_id)
 Removes an item an all its children (if any) from the tree. More...
 
void Clear ()
 Clears all the items. More...
 
std::shared_ptr< WidgetGetItem (ItemId item_id) const
 Returns item, or nullptr if item_id cannot be found. More...
 
std::vector< ItemIdGetItemChildren (ItemId parent_id) const
 
bool GetCanSelectItemsWithChildren () const
 
void SetCanSelectItemsWithChildren (bool can_select)
 
ItemId GetSelectedItemId () const
 Returns the currently selected item id in the tree. More...
 
void SetSelectedItemId (ItemId item_id)
 Selects the indicated item of the list. Does not call onValueChanged. More...
 
Size CalcPreferredSize (const Theme &theme) const override
 
void Layout (const Theme &theme) override
 
DrawResult Draw (const DrawContext &context) override
 
void SetOnSelectionChanged (std::function< void(ItemId)> on_selection_changed)
 
- Public Member Functions inherited from open3d::visualization::gui::Widget
 Widget ()
 
 Widget (const std::vector< std::shared_ptr< Widget >> &children)
 
virtual ~Widget ()
 
void AddChild (std::shared_ptr< Widget > child)
 
const std::vector< std::shared_ptr< Widget > > GetChildren () const
 
const RectGetFrame () const
 Returns the frame size in pixels. More...
 
virtual void SetFrame (const Rect &f)
 
const ColorGetBackgroundColor () const
 
bool IsDefaultBackgroundColor () const
 
void SetBackgroundColor (const Color &color)
 
bool IsVisible () const
 
virtual void SetVisible (bool vis)
 
bool IsEnabled () const
 
virtual void SetEnabled (bool enabled)
 
virtual EventResult Mouse (const MouseEvent &e)
 
virtual EventResult Key (const KeyEvent &e)
 
virtual DrawResult Tick (const TickEvent &e)
 

Additional Inherited Members

- Static Public Attributes inherited from open3d::visualization::gui::Widget
static constexpr int DIM_GROW = 10000
 
- Protected Member Functions inherited from open3d::visualization::gui::Widget
void DrawImGuiPushEnabledState ()
 
void DrawImGuiPopEnabledState ()
 

Member Typedef Documentation

◆ ItemId

Constructor & Destructor Documentation

◆ TreeView()

open3d::visualization::gui::TreeView::TreeView ( )

◆ ~TreeView()

open3d::visualization::gui::TreeView::~TreeView ( )

Member Function Documentation

◆ AddItem()

TreeView::ItemId open3d::visualization::gui::TreeView::AddItem ( ItemId  parent_id,
std::shared_ptr< Widget item 
)

Adds an item to the tree.

◆ AddTextItem()

TreeView::ItemId open3d::visualization::gui::TreeView::AddTextItem ( ItemId  parent_id,
const char *  text 
)

Adds a text item to the tree.

◆ CalcPreferredSize()

Size open3d::visualization::gui::TreeView::CalcPreferredSize ( const Theme theme) const
overridevirtual

◆ Clear()

void open3d::visualization::gui::TreeView::Clear ( )

Clears all the items.

◆ Draw()

Widget::DrawResult open3d::visualization::gui::TreeView::Draw ( const DrawContext context)
overridevirtual

Draws the widget. If this is a Dear ImGUI widget, this is where the actual event processing happens. Return NONE if no action needs to be taken, REDRAW if the widget needs to be redrawn (e.g. its value changed), and RELAYOUT if the widget wishes to change size.

Reimplemented from open3d::visualization::gui::Widget.

◆ GetCanSelectItemsWithChildren()

bool open3d::visualization::gui::TreeView::GetCanSelectItemsWithChildren ( ) const

◆ GetItem()

std::shared_ptr< Widget > open3d::visualization::gui::TreeView::GetItem ( ItemId  item_id) const

Returns item, or nullptr if item_id cannot be found.

◆ GetItemChildren()

std::vector< TreeView::ItemId > open3d::visualization::gui::TreeView::GetItemChildren ( ItemId  parent_id) const

◆ GetRootItem()

TreeView::ItemId open3d::visualization::gui::TreeView::GetRootItem ( ) const

Returns the ID of the root item, that is, AddItem(GetRootItem(), ...) will be a top-level item.

◆ GetSelectedItemId()

TreeView::ItemId open3d::visualization::gui::TreeView::GetSelectedItemId ( ) const

Returns the currently selected item id in the tree.

◆ Layout()

void open3d::visualization::gui::TreeView::Layout ( const Theme theme)
overridevirtual

◆ RemoveItem()

void open3d::visualization::gui::TreeView::RemoveItem ( ItemId  item_id)

Removes an item an all its children (if any) from the tree.

◆ SetCanSelectItemsWithChildren()

void open3d::visualization::gui::TreeView::SetCanSelectItemsWithChildren ( bool  can_select)

If true, enables selecting items that have children. Items can be toggled open/closed with the triangles or by double-clicking. Default is false.

◆ SetOnSelectionChanged()

void open3d::visualization::gui::TreeView::SetOnSelectionChanged ( std::function< void(ItemId)>  on_selection_changed)

Calls onSelectionChanged(const char *sel_text, ItemId sel_item_id) when the list selection changes because of user action.

◆ SetSelectedItemId()

void open3d::visualization::gui::TreeView::SetSelectedItemId ( ItemId  item_id)

Selects the indicated item of the list. Does not call onValueChanged.


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