Open3D (C++ API)
0.18.0+3975044
|
#include <TreeView.h>
Data Structures | |
struct | Impl |
Public Types | |
using | ItemId = int |
Public Types inherited from open3d::visualization::gui::Widget | |
enum class | DrawResult { NONE , REDRAW , RELAYOUT } |
enum class | EventResult { IGNORED , CONSUMED , 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< Widget > | GetItem (ItemId item_id) const |
Returns item, or nullptr if item_id cannot be found. More... | |
std::vector< ItemId > | GetItemChildren (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 LayoutContext &context, const Constraints &constraints) const override |
Size | CalcMinimumSize (const LayoutContext &context) const override |
void | Layout (const LayoutContext &context) 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 () |
virtual void | AddChild (std::shared_ptr< Widget > child) |
virtual const std::vector< std::shared_ptr< Widget > > | GetChildren () const |
virtual const Rect & | GetFrame () const |
Returns the frame size in pixels. More... | |
virtual void | SetFrame (const Rect &f) |
virtual const Color & | GetBackgroundColor () const |
virtual bool | IsDefaultBackgroundColor () const |
virtual void | SetBackgroundColor (const Color &color) |
virtual bool | IsVisible () const |
virtual void | SetVisible (bool vis) |
virtual bool | IsEnabled () const |
virtual void | SetEnabled (bool enabled) |
virtual void | SetTooltip (const char *text) |
virtual const char * | GetTooltip () const |
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 () |
void | DrawImGuiTooltip () |
using open3d::visualization::gui::TreeView::ItemId = int |
open3d::visualization::gui::TreeView::TreeView | ( | ) |
open3d::visualization::gui::TreeView::~TreeView | ( | ) |
TreeView::ItemId open3d::visualization::gui::TreeView::AddItem | ( | ItemId | parent_id, |
std::shared_ptr< Widget > | item | ||
) |
Adds an item to the tree.
TreeView::ItemId open3d::visualization::gui::TreeView::AddTextItem | ( | ItemId | parent_id, |
const char * | text | ||
) |
Adds a text item to the tree.
|
overridevirtual |
Reimplemented from open3d::visualization::gui::Widget.
|
overridevirtual |
Reimplemented from open3d::visualization::gui::Widget.
void open3d::visualization::gui::TreeView::Clear | ( | ) |
Clears all the items.
|
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.
bool open3d::visualization::gui::TreeView::GetCanSelectItemsWithChildren | ( | ) | const |
Returns item, or nullptr if item_id cannot be found.
std::vector< TreeView::ItemId > open3d::visualization::gui::TreeView::GetItemChildren | ( | ItemId | parent_id | ) | const |
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.
TreeView::ItemId open3d::visualization::gui::TreeView::GetSelectedItemId | ( | ) | const |
Returns the currently selected item id in the tree.
|
overridevirtual |
Reimplemented from open3d::visualization::gui::Widget.
void open3d::visualization::gui::TreeView::RemoveItem | ( | ItemId | item_id | ) |
Removes an item an all its children (if any) from the tree.
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.
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.
void open3d::visualization::gui::TreeView::SetSelectedItemId | ( | ItemId | item_id | ) |
Selects the indicated item of the list. Does not call onValueChanged.