Open3D (C++ API)  0.18.0+252c867
Data Structures | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Friends
open3d::visualization::gui::Widget Class Reference

#include <Widget.h>

Inheritance diagram for open3d::visualization::gui::Widget:
open3d::visualization::gui::Button open3d::visualization::gui::CheckableTextTreeCell open3d::visualization::gui::Checkbox open3d::visualization::gui::ColorEdit open3d::visualization::gui::ColormapTreeCell open3d::visualization::gui::Combobox open3d::visualization::gui::Dialog open3d::visualization::gui::ImageWidget open3d::visualization::gui::LUTTreeCell open3d::visualization::gui::Label open3d::visualization::gui::Layout1D open3d::visualization::gui::Layout1D::Fixed open3d::visualization::gui::Layout1D::Stretch open3d::visualization::gui::ListView open3d::visualization::gui::NumberEdit open3d::visualization::gui::ProgressBar open3d::visualization::gui::RadioButton open3d::visualization::gui::SceneWidget open3d::visualization::gui::Slider open3d::visualization::gui::StackedWidget open3d::visualization::gui::TabControl open3d::visualization::gui::TextEdit open3d::visualization::gui::ToggleSwitch open3d::visualization::gui::TreeView open3d::visualization::gui::VGrid open3d::visualization::gui::VectorEdit open3d::visualization::gui::WidgetProxy

Data Structures

struct  Constraints
 
struct  Impl
 

Public Types

enum class  DrawResult { NONE , REDRAW , RELAYOUT }
 
enum class  EventResult { IGNORED , CONSUMED , DISCARD }
 

Public Member Functions

 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 RectGetFrame () const
 Returns the frame size in pixels. More...
 
virtual void SetFrame (const Rect &f)
 
virtual const ColorGetBackgroundColor () 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 Size CalcPreferredSize (const LayoutContext &context, const Constraints &constraints) const
 
virtual Size CalcMinimumSize (const LayoutContext &context) const
 
virtual void Layout (const LayoutContext &context)
 
virtual DrawResult Draw (const DrawContext &context)
 
virtual EventResult Mouse (const MouseEvent &e)
 
virtual EventResult Key (const KeyEvent &e)
 
virtual DrawResult Tick (const TickEvent &e)
 

Static Public Attributes

static constexpr int DIM_GROW = 10000
 

Protected Member Functions

void DrawImGuiPushEnabledState ()
 
void DrawImGuiPopEnabledState ()
 
void DrawImGuiTooltip ()
 

Friends

class Window
 

Member Enumeration Documentation

◆ DrawResult

Enumerator
NONE 
REDRAW 
RELAYOUT 

◆ EventResult

Enumerator
IGNORED 
CONSUMED 
DISCARD 

Constructor & Destructor Documentation

◆ Widget() [1/2]

open3d::visualization::gui::Widget::Widget ( )

◆ Widget() [2/2]

open3d::visualization::gui::Widget::Widget ( const std::vector< std::shared_ptr< Widget >> &  children)
explicit

◆ ~Widget()

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

Member Function Documentation

◆ AddChild()

void open3d::visualization::gui::Widget::AddChild ( std::shared_ptr< Widget child)
virtual

◆ CalcMinimumSize()

Size open3d::visualization::gui::Widget::CalcMinimumSize ( const LayoutContext context) const
virtual

◆ CalcPreferredSize()

Size open3d::visualization::gui::Widget::CalcPreferredSize ( const LayoutContext context,
const Constraints constraints 
) const
virtual

◆ Draw()

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

◆ DrawImGuiPopEnabledState()

void open3d::visualization::gui::Widget::DrawImGuiPopEnabledState ( )
protected

◆ DrawImGuiPushEnabledState()

void open3d::visualization::gui::Widget::DrawImGuiPushEnabledState ( )
protected

◆ DrawImGuiTooltip()

void open3d::visualization::gui::Widget::DrawImGuiTooltip ( )
protected

◆ GetBackgroundColor()

const Color & open3d::visualization::gui::Widget::GetBackgroundColor ( ) const
virtual

◆ GetChildren()

const std::vector< std::shared_ptr< Widget > > open3d::visualization::gui::Widget::GetChildren ( ) const
virtual

◆ GetFrame()

const Rect & open3d::visualization::gui::Widget::GetFrame ( ) const
virtual

Returns the frame size in pixels.

Reimplemented in open3d::visualization::gui::WidgetProxy.

◆ GetTooltip()

const char * open3d::visualization::gui::Widget::GetTooltip ( ) const
virtual

◆ IsDefaultBackgroundColor()

bool open3d::visualization::gui::Widget::IsDefaultBackgroundColor ( ) const
virtual

◆ IsEnabled()

bool open3d::visualization::gui::Widget::IsEnabled ( ) const
virtual

◆ IsVisible()

bool open3d::visualization::gui::Widget::IsVisible ( ) const
virtual

◆ Key()

Widget::EventResult open3d::visualization::gui::Widget::Key ( const KeyEvent e)
virtual

Widgets that use Dear ImGUI should not need to override this, as Dear ImGUI will take care of all the key handling during the Draw().

Reimplemented in open3d::visualization::gui::WidgetProxy, and open3d::visualization::gui::SceneWidget.

◆ Layout()

void open3d::visualization::gui::Widget::Layout ( const LayoutContext context)
virtual

◆ Mouse()

Widget::EventResult open3d::visualization::gui::Widget::Mouse ( const MouseEvent e)
virtual

Widgets that use Dear ImGUI should not need to override this, as Dear ImGUI will take care of all the mouse handling during the Draw().

Reimplemented in open3d::visualization::gui::WidgetProxy, and open3d::visualization::gui::SceneWidget.

◆ SetBackgroundColor()

void open3d::visualization::gui::Widget::SetBackgroundColor ( const Color color)
virtual

◆ SetEnabled()

void open3d::visualization::gui::Widget::SetEnabled ( bool  enabled)
virtual

◆ SetFrame()

void open3d::visualization::gui::Widget::SetFrame ( const Rect f)
virtual

The frame is in pixels. The size of a pixel varies on different and operating systems now frequently scale text sizes on high DPI monitors. Prefer using a Layout to using this function, but if you must use it, it is best to use a multiple of Window::GetTheme().fontSize, which represents 1em and is scaled according to the scaling factor of the window.

Reimplemented in open3d::visualization::gui::WidgetProxy, and open3d::visualization::gui::SceneWidget.

◆ SetTooltip()

void open3d::visualization::gui::Widget::SetTooltip ( const char *  text)
virtual

◆ SetVisible()

void open3d::visualization::gui::Widget::SetVisible ( bool  vis)
virtual

◆ Tick()

Widget::DrawResult open3d::visualization::gui::Widget::Tick ( const TickEvent e)
virtual

Tick events are sent regularly and allow for things like smoothly moving the camera based on keys that are pressed, or animations. Return DrawResult::REDRAW if you want to be redrawn.

Reimplemented in open3d::visualization::gui::WidgetProxy, and open3d::visualization::gui::SceneWidget.

Friends And Related Function Documentation

◆ Window

friend class Window
friend

Field Documentation

◆ DIM_GROW

constexpr int open3d::visualization::gui::Widget::DIM_GROW = 10000
staticconstexpr

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