Open3D (C++ API)  0.18.0+5c982c7
Data Structures | Public Types | Public Member Functions | Protected Member Functions
open3d::visualization::visualizer::O3DVisualizer Class Reference

#include <O3DVisualizer.h>

Inheritance diagram for open3d::visualization::visualizer::O3DVisualizer:
open3d::visualization::gui::Window

Data Structures

struct  DrawObject
 
struct  Impl
 
struct  UIState
 

Public Types

enum class  Shader { STANDARD , UNLIT , NORMALS , DEPTH }
 
enum class  TickResult { NO_CHANGE , REDRAW }
 

Public Member Functions

 O3DVisualizer (const std::string &title, int width, int height)
 
virtual ~O3DVisualizer ()
 
void AddAction (const std::string &name, std::function< void(O3DVisualizer &)> callback)
 
void SetBackground (const Eigen::Vector4f &bg_color, std::shared_ptr< geometry::Image > bg_image=nullptr)
 
void SetShader (Shader shader)
 
void AddGeometry (const std::string &name, std::shared_ptr< geometry::Geometry3D > geom, const rendering::MaterialRecord *material=nullptr, const std::string &group="", double time=0.0, bool is_visible=true)
 Adds a legacy geometry to the Visualizer. More...
 
void AddGeometry (const std::string &name, std::shared_ptr< t::geometry::Geometry > tgeom, const rendering::MaterialRecord *material=nullptr, const std::string &group="", double time=0.0, bool is_visible=true)
 
void AddGeometry (const std::string &name, std::shared_ptr< rendering::TriangleMeshModel > tgeom, const rendering::MaterialRecord *material=nullptr, const std::string &group="", double time=0.0, bool is_visible=true)
 Adds a triangle mesh model to the Visualizer. More...
 
void RemoveGeometry (const std::string &name)
 Removes the named geometry from the Visualizer. More...
 
void UpdateGeometry (const std::string &name, std::shared_ptr< t::geometry::Geometry > tgeom, uint32_t update_flags)
 
void ShowGeometry (const std::string &name, bool show)
 Show/hide the named geometry. More...
 
DrawObject GetGeometry (const std::string &name) const
 Returns Visualizer's internal DrawObject for the named geometry. More...
 
rendering::MaterialRecord GetGeometryMaterial (const std::string &name) const
 
void ModifyGeometryMaterial (const std::string &name, const rendering::MaterialRecord *material)
 
void Add3DLabel (const Eigen::Vector3f &pos, const char *text)
 Adds a label with text text at the 3D position pos. More...
 
void Clear3DLabels ()
 Clears all 3D labels created with Add3DLabel More...
 
void SetupCamera (float fov, const Eigen::Vector3f &center, const Eigen::Vector3f &eye, const Eigen::Vector3f &up)
 
void SetupCamera (const camera::PinholeCameraIntrinsic &intrinsic, const Eigen::Matrix4d &extrinsic)
 
void SetupCamera (const Eigen::Matrix3d &intrinsic, const Eigen::Matrix4d &extrinsic, int intrinsic_width_px, int intrinsic_height_px)
 
void ResetCameraToDefault ()
 
void ShowSettings (bool show)
 
void ShowSkybox (bool show)
 
void SetIBL (const std::string &path)
 
void SetIBLIntensity (float intensity)
 
void ShowAxes (bool show)
 
void ShowGround (bool show)
 
void SetGroundPlane (rendering::Scene::GroundPlane plane)
 
void EnableSunFollowsCamera (bool enable)
 
void EnableBasicMode (bool enable)
 
void EnableWireframeMode (bool enable)
 
void SetPointSize (int point_size)
 
void SetLineWidth (int line_width)
 
void EnableGroup (const std::string &group, bool enable)
 
void SetMouseMode (gui::SceneWidget::Controls mode)
 
std::vector< O3DVisualizerSelections::SelectionSetGetSelectionSets () const
 
double GetAnimationFrameDelay () const
 
void SetAnimationFrameDelay (double secs)
 
double GetAnimationTimeStep () const
 
void SetAnimationTimeStep (double time_step)
 
double GetAnimationDuration () const
 
void SetAnimationDuration (double sec)
 
double GetCurrentTime () const
 
void SetCurrentTime (double t)
 
bool GetIsAnimating () const
 
void SetAnimating (bool is_animating)
 
void SetOnAnimationFrame (std::function< void(O3DVisualizer &, double)> cb)
 
void SetOnAnimationTick (std::function< TickResult(O3DVisualizer &, double, double)> cb)
 
void ExportCurrentImage (const std::string &path)
 
UIState GetUIState () const
 
rendering::Open3DSceneGetScene () const
 
void StartRPCInterface (const std::string &address, int timeout)
 Starts the RPC interface. See io/rpc/ZMQReceiver for the parameters. More...
 
void StopRPCInterface ()
 
- Public Member Functions inherited from open3d::visualization::gui::Window
 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::rendering::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 SetOnMenuItemActivated (Menu::ItemId item_id, std::function< void()> callback)
 
void SetOnTickEvent (std::function< bool()> callback)
 
void SetOnClose (std::function< bool()> callback)
 
void SetOnKeyEvent (std::function< bool(const KeyEvent &)> callback)
 
void ShowDialog (std::shared_ptr< Dialog > dlg)
 
void CloseDialog ()
 Closes the dialog. More...
 
void ShowMessageBox (const char *title, const char *message)
 
void DestroyWindow ()
 
virtual void OnMenuItemSelected (Menu::ItemId item_id)
 
virtual void OnDragDropped (const char *path)
 
void ShowMenu (bool show)
 
int GetMouseMods () const
 
std::string GetWebRTCUID () const
 
void OnDraw ()
 
void OnResize ()
 
void OnMouseEvent (const MouseEvent &e)
 
void OnKeyEvent (const KeyEvent &e)
 
void OnTextInput (const TextInputEvent &e)
 
void OnTickEvent (const TickEvent &e)
 
WindowSystem::OSWindow GetOSWindow () const
 

Protected Member Functions

void Layout (const gui::LayoutContext &context)
 
- Protected Member Functions inherited from open3d::visualization::gui::Window
virtual Size CalcPreferredSize ()
 
LayoutContext GetLayoutContext ()
 
const std::vector< std::shared_ptr< Widget > > & GetChildren () const
 

Additional Inherited Members

- Static Public Attributes inherited from open3d::visualization::gui::Window
static const int FLAG_HIDDEN = (1 << 0)
 
static const int FLAG_TOPMOST = (1 << 1)
 

Member Enumeration Documentation

◆ Shader

Enumerator
STANDARD 
UNLIT 
NORMALS 
DEPTH 

◆ TickResult

Enumerator
NO_CHANGE 
REDRAW 

Constructor & Destructor Documentation

◆ O3DVisualizer()

open3d::visualization::visualizer::O3DVisualizer::O3DVisualizer ( const std::string &  title,
int  width,
int  height 
)

◆ ~O3DVisualizer()

open3d::visualization::visualizer::O3DVisualizer::~O3DVisualizer ( )
virtual

Member Function Documentation

◆ Add3DLabel()

void open3d::visualization::visualizer::O3DVisualizer::Add3DLabel ( const Eigen::Vector3f &  pos,
const char *  text 
)

Adds a label with text text at the 3D position pos.

◆ AddAction()

void open3d::visualization::visualizer::O3DVisualizer::AddAction ( const std::string &  name,
std::function< void(O3DVisualizer &)>  callback 
)

◆ AddGeometry() [1/3]

void open3d::visualization::visualizer::O3DVisualizer::AddGeometry ( const std::string &  name,
std::shared_ptr< geometry::Geometry3D geom,
const rendering::MaterialRecord material = nullptr,
const std::string &  group = "",
double  time = 0.0,
bool  is_visible = true 
)

Adds a legacy geometry to the Visualizer.

◆ AddGeometry() [2/3]

void open3d::visualization::visualizer::O3DVisualizer::AddGeometry ( const std::string &  name,
std::shared_ptr< rendering::TriangleMeshModel tgeom,
const rendering::MaterialRecord material = nullptr,
const std::string &  group = "",
double  time = 0.0,
bool  is_visible = true 
)

Adds a triangle mesh model to the Visualizer.

◆ AddGeometry() [3/3]

void open3d::visualization::visualizer::O3DVisualizer::AddGeometry ( const std::string &  name,
std::shared_ptr< t::geometry::Geometry tgeom,
const rendering::MaterialRecord material = nullptr,
const std::string &  group = "",
double  time = 0.0,
bool  is_visible = true 
)

Adds a t-geometry to the Visualizer, only DrawableGeometries are supported.

◆ Clear3DLabels()

void open3d::visualization::visualizer::O3DVisualizer::Clear3DLabels ( )

Clears all 3D labels created with Add3DLabel

◆ EnableBasicMode()

void open3d::visualization::visualizer::O3DVisualizer::EnableBasicMode ( bool  enable)

◆ EnableGroup()

void open3d::visualization::visualizer::O3DVisualizer::EnableGroup ( const std::string &  group,
bool  enable 
)

◆ EnableSunFollowsCamera()

void open3d::visualization::visualizer::O3DVisualizer::EnableSunFollowsCamera ( bool  enable)

◆ EnableWireframeMode()

void open3d::visualization::visualizer::O3DVisualizer::EnableWireframeMode ( bool  enable)

◆ ExportCurrentImage()

void open3d::visualization::visualizer::O3DVisualizer::ExportCurrentImage ( const std::string &  path)

◆ GetAnimationDuration()

double open3d::visualization::visualizer::O3DVisualizer::GetAnimationDuration ( ) const

◆ GetAnimationFrameDelay()

double open3d::visualization::visualizer::O3DVisualizer::GetAnimationFrameDelay ( ) const

◆ GetAnimationTimeStep()

double open3d::visualization::visualizer::O3DVisualizer::GetAnimationTimeStep ( ) const

◆ GetCurrentTime()

double open3d::visualization::visualizer::O3DVisualizer::GetCurrentTime ( ) const

◆ GetGeometry()

O3DVisualizer::DrawObject open3d::visualization::visualizer::O3DVisualizer::GetGeometry ( const std::string &  name) const

Returns Visualizer's internal DrawObject for the named geometry.

◆ GetGeometryMaterial()

MaterialRecord open3d::visualization::visualizer::O3DVisualizer::GetGeometryMaterial ( const std::string &  name) const

◆ GetIsAnimating()

bool open3d::visualization::visualizer::O3DVisualizer::GetIsAnimating ( ) const

◆ GetScene()

Open3DScene * open3d::visualization::visualizer::O3DVisualizer::GetScene ( ) const

◆ GetSelectionSets()

std::vector< O3DVisualizerSelections::SelectionSet > open3d::visualization::visualizer::O3DVisualizer::GetSelectionSets ( ) const

◆ GetUIState()

O3DVisualizer::UIState open3d::visualization::visualizer::O3DVisualizer::GetUIState ( ) const

◆ Layout()

void open3d::visualization::visualizer::O3DVisualizer::Layout ( const gui::LayoutContext context)
protectedvirtual

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

Reimplemented from open3d::visualization::gui::Window.

◆ ModifyGeometryMaterial()

void open3d::visualization::visualizer::O3DVisualizer::ModifyGeometryMaterial ( const std::string &  name,
const rendering::MaterialRecord material 
)

◆ RemoveGeometry()

void open3d::visualization::visualizer::O3DVisualizer::RemoveGeometry ( const std::string &  name)

Removes the named geometry from the Visualizer.

◆ ResetCameraToDefault()

void open3d::visualization::visualizer::O3DVisualizer::ResetCameraToDefault ( )

◆ SetAnimating()

void open3d::visualization::visualizer::O3DVisualizer::SetAnimating ( bool  is_animating)

◆ SetAnimationDuration()

void open3d::visualization::visualizer::O3DVisualizer::SetAnimationDuration ( double  sec)

◆ SetAnimationFrameDelay()

void open3d::visualization::visualizer::O3DVisualizer::SetAnimationFrameDelay ( double  secs)

◆ SetAnimationTimeStep()

void open3d::visualization::visualizer::O3DVisualizer::SetAnimationTimeStep ( double  time_step)

◆ SetBackground()

void open3d::visualization::visualizer::O3DVisualizer::SetBackground ( const Eigen::Vector4f &  bg_color,
std::shared_ptr< geometry::Image bg_image = nullptr 
)

◆ SetCurrentTime()

void open3d::visualization::visualizer::O3DVisualizer::SetCurrentTime ( double  t)

◆ SetGroundPlane()

void open3d::visualization::visualizer::O3DVisualizer::SetGroundPlane ( rendering::Scene::GroundPlane  plane)

◆ SetIBL()

void open3d::visualization::visualizer::O3DVisualizer::SetIBL ( const std::string &  path)

◆ SetIBLIntensity()

void open3d::visualization::visualizer::O3DVisualizer::SetIBLIntensity ( float  intensity)

◆ SetLineWidth()

void open3d::visualization::visualizer::O3DVisualizer::SetLineWidth ( int  line_width)

◆ SetMouseMode()

void open3d::visualization::visualizer::O3DVisualizer::SetMouseMode ( gui::SceneWidget::Controls  mode)

◆ SetOnAnimationFrame()

void open3d::visualization::visualizer::O3DVisualizer::SetOnAnimationFrame ( std::function< void(O3DVisualizer &, double)>  cb)

◆ SetOnAnimationTick()

void open3d::visualization::visualizer::O3DVisualizer::SetOnAnimationTick ( std::function< TickResult(O3DVisualizer &, double, double)>  cb)

◆ SetPointSize()

void open3d::visualization::visualizer::O3DVisualizer::SetPointSize ( int  point_size)

◆ SetShader()

void open3d::visualization::visualizer::O3DVisualizer::SetShader ( Shader  shader)

◆ SetupCamera() [1/3]

void open3d::visualization::visualizer::O3DVisualizer::SetupCamera ( const camera::PinholeCameraIntrinsic intrinsic,
const Eigen::Matrix4d &  extrinsic 
)

◆ SetupCamera() [2/3]

void open3d::visualization::visualizer::O3DVisualizer::SetupCamera ( const Eigen::Matrix3d &  intrinsic,
const Eigen::Matrix4d &  extrinsic,
int  intrinsic_width_px,
int  intrinsic_height_px 
)

◆ SetupCamera() [3/3]

void open3d::visualization::visualizer::O3DVisualizer::SetupCamera ( float  fov,
const Eigen::Vector3f &  center,
const Eigen::Vector3f &  eye,
const Eigen::Vector3f &  up 
)

◆ ShowAxes()

void open3d::visualization::visualizer::O3DVisualizer::ShowAxes ( bool  show)

◆ ShowGeometry()

void open3d::visualization::visualizer::O3DVisualizer::ShowGeometry ( const std::string &  name,
bool  show 
)

Show/hide the named geometry.

◆ ShowGround()

void open3d::visualization::visualizer::O3DVisualizer::ShowGround ( bool  show)

◆ ShowSettings()

void open3d::visualization::visualizer::O3DVisualizer::ShowSettings ( bool  show)

◆ ShowSkybox()

void open3d::visualization::visualizer::O3DVisualizer::ShowSkybox ( bool  show)

◆ StartRPCInterface()

void open3d::visualization::visualizer::O3DVisualizer::StartRPCInterface ( const std::string &  address,
int  timeout 
)

Starts the RPC interface. See io/rpc/ZMQReceiver for the parameters.

◆ StopRPCInterface()

void open3d::visualization::visualizer::O3DVisualizer::StopRPCInterface ( )

◆ UpdateGeometry()

void open3d::visualization::visualizer::O3DVisualizer::UpdateGeometry ( const std::string &  name,
std::shared_ptr< t::geometry::Geometry tgeom,
uint32_t  update_flags 
)

Updates update_flags attributes of named geometry with the matching attributes from tgeom


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