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

#include <Window.h>

Inheritance diagram for open3d::gui::Window:
open3d::visualization::GuiVisualizer

Data Structures

struct  Impl
 

Public Member Functions

 Window (const std::string &title, int flags=0)
 
 Window (const std::string &title, int width, int height, int flags=0)
 
 Window (const std::string &title, int x, int y, int width, int height, int flags=0)
 
virtual ~Window ()
 
const ThemeGetTheme () const
 
visualization::RendererGetRenderer () const
 
Rect GetOSFrame () const
 
void SetOSFrame (const Rect &r)
 
const char * GetTitle () const
 
void SetTitle (const char *title)
 
void SizeToFit ()
 
void SetSize (const Size &size)
 Sets the size of the window in pixels. Includes menubar on Linux. More...
 
Size GetSize () const
 
Rect GetContentRect () const
 
float GetScaling () const
 Returns the scaling factor from OS pixels to device pixels. More...
 
Point GlobalToWindowCoord (int global_x, int global_y)
 Returns the global point (in OS pixels) in window local coordinates. More...
 
bool IsVisible () const
 
void Show (bool vis=true)
 
void Close ()
 
void SetNeedsLayout ()
 Instructs the window to relayout before the next draw. More...
 
void PostRedraw ()
 
void SetTopmost (bool topmost)
 
void RaiseToTop () const
 
bool IsActiveWindow () const
 
void SetFocusWidget (Widget *w)
 Sets. More...
 
void AddChild (std::shared_ptr< Widget > w)
 
void ShowDialog (std::shared_ptr< Dialog > dlg)
 
void CloseDialog ()
 Closes the dialog. More...
 
void ShowMessageBox (const char *title, const char *message)
 

Static Public Attributes

static const int FLAG_TOPMOST = (1 << 0)
 

Protected Member Functions

virtual Size CalcPreferredSize ()
 
virtual void Layout (const Theme &theme)
 
virtual void OnMenuItemSelected (Menu::ItemId item_id)
 
virtual void OnDragDropped (const char *path)
 

Friends

class Application
 
class Renderer
 

Constructor & Destructor Documentation

◆ Window() [1/3]

open3d::gui::Window::Window ( const std::string &  title,
int  flags = 0 
)
explicit

Creates a Window that is auto-sized and centered. Window creation is NOT thread-safe. Window must be created on the same thread that calls Application::Run().

◆ Window() [2/3]

open3d::gui::Window::Window ( const std::string &  title,
int  width,
int  height,
int  flags = 0 
)

Creates a Window that is centered. Window creation is NOT thread-safe. Window must be created on the same thread that calls Application::Run().

◆ Window() [3/3]

open3d::gui::Window::Window ( const std::string &  title,
int  x,
int  y,
int  width,
int  height,
int  flags = 0 
)

Creates a Window. Window creation is NOT thread-safe. Window must be created on the same thread that calls Application::Run().

◆ ~Window()

open3d::gui::Window::~Window ( )
virtual

Member Function Documentation

◆ AddChild()

void open3d::gui::Window::AddChild ( std::shared_ptr< Widget w)

◆ CalcPreferredSize()

Size open3d::gui::Window::CalcPreferredSize ( )
protectedvirtual

Returns the preferred size of the window. The window is not obligated to honor this size. If all children of the window are layouts, this function does not need to be overridden. This function can only be called after MakeDrawContextCurrent() has been called.

◆ Close()

void open3d::gui::Window::Close ( )

Closes the window and destroys it. (Same as calling Application::RemoveWindow())

◆ CloseDialog()

void open3d::gui::Window::CloseDialog ( )

Closes the dialog.

◆ GetContentRect()

Rect open3d::gui::Window::GetContentRect ( ) const

Returns the rectangle that is available to widgets to use; excludes the menubar.

◆ GetOSFrame()

Rect open3d::gui::Window::GetOSFrame ( ) const

Gets the window's size and position in OS pixels, not actual device pixels.

◆ GetRenderer()

visualization::Renderer & open3d::gui::Window::GetRenderer ( ) const

◆ GetScaling()

float open3d::gui::Window::GetScaling ( ) const

Returns the scaling factor from OS pixels to device pixels.

◆ GetSize()

Size open3d::gui::Window::GetSize ( ) const

Returns the total interior size of window, in pixels. On Linux this includes the menubar.

◆ GetTheme()

const Theme & open3d::gui::Window::GetTheme ( ) const

◆ GetTitle()

const char * open3d::gui::Window::GetTitle ( ) const

◆ GlobalToWindowCoord()

Point open3d::gui::Window::GlobalToWindowCoord ( int  global_x,
int  global_y 
)

Returns the global point (in OS pixels) in window local coordinates.

◆ IsActiveWindow()

bool open3d::gui::Window::IsActiveWindow ( ) const

◆ IsVisible()

bool open3d::gui::Window::IsVisible ( ) const

◆ Layout()

void open3d::gui::Window::Layout ( const Theme theme)
protectedvirtual

Lays out all the widgets in the window. If all children of the window are layouts, this function does not need to be overriden.

Reimplemented in open3d::visualization::GuiVisualizer.

◆ OnDragDropped()

void open3d::gui::Window::OnDragDropped ( const char *  path)
protectedvirtual

◆ OnMenuItemSelected()

void open3d::gui::Window::OnMenuItemSelected ( Menu::ItemId  item_id)
protectedvirtual

◆ PostRedraw()

void open3d::gui::Window::PostRedraw ( )

Sends a draw event to the window through the operating system's event queue.

◆ RaiseToTop()

void open3d::gui::Window::RaiseToTop ( ) const

◆ SetFocusWidget()

void open3d::gui::Window::SetFocusWidget ( Widget w)

Sets.

Parameters
was widget with text focus.

◆ SetNeedsLayout()

void open3d::gui::Window::SetNeedsLayout ( )

Instructs the window to relayout before the next draw.

◆ SetOSFrame()

void open3d::gui::Window::SetOSFrame ( const Rect r)

Sets the window's size and position in OS pixels, not actual device pixels.

◆ SetSize()

void open3d::gui::Window::SetSize ( const Size size)

Sets the size of the window in pixels. Includes menubar on Linux.

◆ SetTitle()

void open3d::gui::Window::SetTitle ( const char *  title)

◆ SetTopmost()

void open3d::gui::Window::SetTopmost ( bool  topmost)

◆ Show()

void open3d::gui::Window::Show ( bool  vis = true)

◆ ShowDialog()

void open3d::gui::Window::ShowDialog ( std::shared_ptr< Dialog dlg)

Shows the dialog. If a dialog is currently being shown it will be closed.

◆ ShowMessageBox()

void open3d::gui::Window::ShowMessageBox ( const char *  title,
const char *  message 
)

◆ SizeToFit()

void open3d::gui::Window::SizeToFit ( )

Auto-sizes the window to the results of CalcPreferredSize(), which by default is the size that the layouts of the window want.

Friends And Related Function Documentation

◆ Application

friend class Application
friend

◆ Renderer

friend class Renderer
friend

Field Documentation

◆ FLAG_TOPMOST

const int open3d::gui::Window::FLAG_TOPMOST = (1 << 0)
static

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