Open3D (C++ API)  0.18.0+252c867
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
open3d::visualization::VisualizerWithEditing Class Reference

Visualizer with editing capabilities. More...

#include <VisualizerWithEditing.h>

Inheritance diagram for open3d::visualization::VisualizerWithEditing:
open3d::visualization::Visualizer

Public Types

enum class  SelectionMode { None = 0 , Rectangle = 1 , Polygon = 2 }
 

Public Member Functions

 VisualizerWithEditing (double voxel_size=-1.0, bool use_dialog=true, const std::string &directory="")
 
 ~VisualizerWithEditing () override
 
 VisualizerWithEditing (const VisualizerWithEditing &)=delete
 
VisualizerWithEditingoperator= (const VisualizerWithEditing &)=delete
 
bool AddGeometry (std::shared_ptr< const geometry::Geometry > geometry_ptr, bool reset_bounding_box=true) override
 
void PrintVisualizerHelp () override
 
void UpdateWindowTitle () override
 
void BuildUtilities () override
 
int PickPoint (double x, double y)
 
std::vector< size_t > & GetPickedPoints ()
 
std::shared_ptr< geometry::GeometryGetCroppedGeometry () const
 
- Public Member Functions inherited from open3d::visualization::Visualizer
 Visualizer ()
 
virtual ~Visualizer ()
 
 Visualizer (Visualizer &&)=delete
 
 Visualizer (const Visualizer &)=delete
 
Visualizeroperator= (const Visualizer &)=delete
 
bool CreateVisualizerWindow (const std::string &window_name="Open3D", const int width=640, const int height=480, const int left=50, const int top=50, const bool visible=true)
 Function to create a window and initialize GLFW. More...
 
void DestroyVisualizerWindow ()
 Function to destroy a window. More...
 
void RegisterAnimationCallback (std::function< bool(Visualizer *)> callback_func)
 Function to register a callback function for animation. More...
 
void Run ()
 Function to activate the window. More...
 
void Close ()
 Function to to notify the window to be closed. More...
 
bool WaitEvents ()
 Function to process the event queue and return if the window is closed. More...
 
bool PollEvents ()
 
virtual bool RemoveGeometry (std::shared_ptr< const geometry::Geometry > geometry_ptr, bool reset_bounding_box=true)
 Function to remove geometry from the scene. More...
 
virtual bool ClearGeometries ()
 
virtual bool UpdateGeometry (std::shared_ptr< const geometry::Geometry > geometry_ptr=nullptr)
 Function to update geometry. More...
 
virtual bool HasGeometry () const
 
virtual void UpdateRender ()
 Function to inform render needed to be updated. More...
 
virtual void SetFullScreen (bool fullscreen)
 Functions to change between fullscreen and windowed modes. More...
 
virtual void ToggleFullScreen ()
 
virtual bool IsFullScreen ()
 
ViewControlGetViewControl ()
 Function to retrieve the associated ViewControl. More...
 
RenderOptionGetRenderOption ()
 Function to retrieve the associated RenderOption. More...
 
std::shared_ptr< geometry::ImageCaptureScreenFloatBuffer (bool do_render=true)
 Function to capture screen and store RGB in a float buffer. More...
 
void CaptureScreenImage (const std::string &filename="", bool do_render=true)
 Function to capture and save a screen image. More...
 
std::shared_ptr< geometry::ImageCaptureDepthFloatBuffer (bool do_render=true)
 
void CaptureDepthImage (const std::string &filename="", bool do_render=true, double depth_scale=1000.0)
 
void CaptureDepthPointCloud (const std::string &filename="", bool do_render=true, bool convert_to_world_coordinate=false)
 Function to capture and save local point cloud. More...
 
void CaptureRenderOption (const std::string &filename="")
 
void ResetViewPoint (bool reset_bounding_box=false)
 Function to reset view point. More...
 
const std::string & GetWindowName () const
 
std::string GetViewStatus ()
 Get the current view status as a json string of ViewTrajectory. More...
 
void SetViewStatus (const std::string &view_status_str)
 Set the current view status from a json string of ViewTrajectory. More...
 

Protected Member Functions

bool InitViewControl () override
 Function to initialize ViewControl. More...
 
bool InitRenderOption () override
 Function to initialize RenderOption. More...
 
void WindowResizeCallback (GLFWwindow *window, int w, int h) override
 
void MouseMoveCallback (GLFWwindow *window, double x, double y) override
 
void MouseScrollCallback (GLFWwindow *window, double x, double y) override
 
void MouseButtonCallback (GLFWwindow *window, int button, int action, int mods) override
 
void KeyPressCallback (GLFWwindow *window, int key, int scancode, int action, int mods) override
 
void InvalidateSelectionPolygon ()
 
void InvalidatePicking ()
 
void SaveCroppingResult (const std::string &filename="")
 
- Protected Member Functions inherited from open3d::visualization::Visualizer
virtual bool InitOpenGL ()
 Function to initialize OpenGL. More...
 
virtual void Render (bool render_screen=false)
 
void CopyViewStatusToClipboard ()
 Copy the current view status to clipboard. More...
 
void CopyViewStatusFromClipboard ()
 Apply the view point from clipboard. More...
 
virtual void WindowRefreshCallback (GLFWwindow *window)
 Callback functions. More...
 
virtual void WindowCloseCallback (GLFWwindow *window)
 Function to notify the window to be closed. More...
 

Protected Attributes

std::shared_ptr< SelectionPolygonselection_polygon_ptr_
 
std::shared_ptr< glsl::SelectionPolygonRendererselection_polygon_renderer_ptr_
 
SelectionMode selection_mode_ = SelectionMode::None
 
std::shared_ptr< PointCloudPickerpointcloud_picker_ptr_
 
std::shared_ptr< glsl::PointCloudPickerRendererpointcloud_picker_renderer_ptr_
 
std::shared_ptr< const geometry::Geometryoriginal_geometry_ptr_
 
std::shared_ptr< geometry::Geometryediting_geometry_ptr_
 
std::shared_ptr< glsl::GeometryRendererediting_geometry_renderer_ptr_
 
double voxel_size_ = -1.0
 
bool use_dialog_ = true
 
std::string default_directory_
 
unsigned int crop_action_count_ = 0
 
- Protected Attributes inherited from open3d::visualization::Visualizer
GLFWwindow * window_ = NULL
 
std::string window_name_ = "Open3D"
 
std::shared_ptr< GLFWContextglfw_context_ = nullptr
 Shared GLFW context. More...
 
Eigen::Vector2i saved_window_size_ = Eigen::Vector2i::Zero()
 
Eigen::Vector2i saved_window_pos_ = Eigen::Vector2i::Zero()
 
std::function< bool(Visualizer *)> animation_callback_func_ = nullptr
 
std::function< bool(Visualizer *)> animation_callback_func_in_loop_
 
MouseControl mouse_control_
 
bool is_redraw_required_ = true
 
bool is_initialized_ = false
 
GLuint vao_id_ = 0
 
GLuint render_fbo_ = 0
 
GLuint render_rgb_tex_ = 0
 
GLuint render_depth_stencil_rbo_ = 0
 
std::unique_ptr< ViewControlview_control_ptr_
 
std::unique_ptr< RenderOptionrender_option_ptr_
 
std::unordered_set< std::shared_ptr< const geometry::Geometry > > geometry_ptrs_
 
std::unordered_set< std::shared_ptr< glsl::GeometryRenderer > > geometry_renderer_ptrs_
 
std::vector< std::shared_ptr< const geometry::Geometry > > utility_ptrs_
 
std::vector< std::shared_ptr< glsl::GeometryRenderer > > utility_renderer_ptrs_
 
std::unordered_map< std::shared_ptr< glsl::GeometryRenderer >, RenderOptionutility_renderer_opts_
 
std::shared_ptr< geometry::TriangleMeshcoordinate_frame_mesh_ptr_
 
std::shared_ptr< glsl::CoordinateFrameRenderercoordinate_frame_mesh_renderer_ptr_
 

Detailed Description

Visualizer with editing capabilities.

Member Enumeration Documentation

◆ SelectionMode

Enumerator
None 
Rectangle 
Polygon 

Constructor & Destructor Documentation

◆ VisualizerWithEditing() [1/2]

open3d::visualization::VisualizerWithEditing::VisualizerWithEditing ( double  voxel_size = -1.0,
bool  use_dialog = true,
const std::string &  directory = "" 
)
inline

◆ ~VisualizerWithEditing()

open3d::visualization::VisualizerWithEditing::~VisualizerWithEditing ( )
inlineoverride

◆ VisualizerWithEditing() [2/2]

open3d::visualization::VisualizerWithEditing::VisualizerWithEditing ( const VisualizerWithEditing )
delete

Member Function Documentation

◆ AddGeometry()

bool open3d::visualization::VisualizerWithEditing::AddGeometry ( std::shared_ptr< const geometry::Geometry geometry_ptr,
bool  reset_bounding_box = true 
)
overridevirtual

Function to add geometry to the scene and create corresponding shaders.

Parameters
geometry_ptrThe Geometry object.

Reimplemented from open3d::visualization::Visualizer.

◆ BuildUtilities()

void open3d::visualization::VisualizerWithEditing::BuildUtilities ( )
overridevirtual

Reimplemented from open3d::visualization::Visualizer.

◆ GetCroppedGeometry()

std::shared_ptr< geometry::Geometry > open3d::visualization::VisualizerWithEditing::GetCroppedGeometry ( ) const

◆ GetPickedPoints()

std::vector< size_t > & open3d::visualization::VisualizerWithEditing::GetPickedPoints ( )

◆ InitRenderOption()

bool open3d::visualization::VisualizerWithEditing::InitRenderOption ( )
overrideprotectedvirtual

Function to initialize RenderOption.

Reimplemented from open3d::visualization::Visualizer.

◆ InitViewControl()

bool open3d::visualization::VisualizerWithEditing::InitViewControl ( )
overrideprotectedvirtual

Function to initialize ViewControl.

Reimplemented from open3d::visualization::Visualizer.

◆ InvalidatePicking()

void open3d::visualization::VisualizerWithEditing::InvalidatePicking ( )
protected

◆ InvalidateSelectionPolygon()

void open3d::visualization::VisualizerWithEditing::InvalidateSelectionPolygon ( )
protected

◆ KeyPressCallback()

void open3d::visualization::VisualizerWithEditing::KeyPressCallback ( GLFWwindow *  window,
int  key,
int  scancode,
int  action,
int  mods 
)
overrideprotectedvirtual

Reimplemented from open3d::visualization::Visualizer.

◆ MouseButtonCallback()

void open3d::visualization::VisualizerWithEditing::MouseButtonCallback ( GLFWwindow *  window,
int  button,
int  action,
int  mods 
)
overrideprotectedvirtual

Reimplemented from open3d::visualization::Visualizer.

◆ MouseMoveCallback()

void open3d::visualization::VisualizerWithEditing::MouseMoveCallback ( GLFWwindow *  window,
double  x,
double  y 
)
overrideprotectedvirtual

Reimplemented from open3d::visualization::Visualizer.

◆ MouseScrollCallback()

void open3d::visualization::VisualizerWithEditing::MouseScrollCallback ( GLFWwindow *  window,
double  x,
double  y 
)
overrideprotectedvirtual

Reimplemented from open3d::visualization::Visualizer.

◆ operator=()

VisualizerWithEditing& open3d::visualization::VisualizerWithEditing::operator= ( const VisualizerWithEditing )
delete

◆ PickPoint()

int open3d::visualization::VisualizerWithEditing::PickPoint ( double  x,
double  y 
)

◆ PrintVisualizerHelp()

void open3d::visualization::VisualizerWithEditing::PrintVisualizerHelp ( )
overridevirtual

Reimplemented from open3d::visualization::Visualizer.

◆ SaveCroppingResult()

void open3d::visualization::VisualizerWithEditing::SaveCroppingResult ( const std::string &  filename = "")
protected

◆ UpdateWindowTitle()

void open3d::visualization::VisualizerWithEditing::UpdateWindowTitle ( )
overridevirtual

Reimplemented from open3d::visualization::Visualizer.

◆ WindowResizeCallback()

void open3d::visualization::VisualizerWithEditing::WindowResizeCallback ( GLFWwindow *  window,
int  w,
int  h 
)
overrideprotectedvirtual

Reimplemented from open3d::visualization::Visualizer.

Field Documentation

◆ crop_action_count_

unsigned int open3d::visualization::VisualizerWithEditing::crop_action_count_ = 0
protected

◆ default_directory_

std::string open3d::visualization::VisualizerWithEditing::default_directory_
protected

◆ editing_geometry_ptr_

std::shared_ptr<geometry::Geometry> open3d::visualization::VisualizerWithEditing::editing_geometry_ptr_
protected

◆ editing_geometry_renderer_ptr_

std::shared_ptr<glsl::GeometryRenderer> open3d::visualization::VisualizerWithEditing::editing_geometry_renderer_ptr_
protected

◆ original_geometry_ptr_

std::shared_ptr<const geometry::Geometry> open3d::visualization::VisualizerWithEditing::original_geometry_ptr_
protected

◆ pointcloud_picker_ptr_

std::shared_ptr<PointCloudPicker> open3d::visualization::VisualizerWithEditing::pointcloud_picker_ptr_
protected

◆ pointcloud_picker_renderer_ptr_

std::shared_ptr<glsl::PointCloudPickerRenderer> open3d::visualization::VisualizerWithEditing::pointcloud_picker_renderer_ptr_
protected

◆ selection_mode_

SelectionMode open3d::visualization::VisualizerWithEditing::selection_mode_ = SelectionMode::None
protected

◆ selection_polygon_ptr_

std::shared_ptr<SelectionPolygon> open3d::visualization::VisualizerWithEditing::selection_polygon_ptr_
protected

◆ selection_polygon_renderer_ptr_

std::shared_ptr<glsl::SelectionPolygonRenderer> open3d::visualization::VisualizerWithEditing::selection_polygon_renderer_ptr_
protected

◆ use_dialog_

bool open3d::visualization::VisualizerWithEditing::use_dialog_ = true
protected

◆ voxel_size_

double open3d::visualization::VisualizerWithEditing::voxel_size_ = -1.0
protected

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