Open3D (C++ API)
Data Structures | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
open3d::visualization::VisualizerWithVertexSelection Class Reference

#include <VisualizerWithVertexSelection.h>

Inheritance diagram for open3d::visualization::VisualizerWithVertexSelection:
open3d::visualization::Visualizer

Data Structures

struct  PickedPoint
 

Public Types

enum  SelectionMode { SelectionMode::None = 0, SelectionMode::Point = 1, SelectionMode::Rectangle = 2, SelectionMode::Moving = 3 }
 

Public Member Functions

 VisualizerWithVertexSelection ()
 
 ~VisualizerWithVertexSelection () override
 
 VisualizerWithVertexSelection (const VisualizerWithVertexSelection &)=delete
 
VisualizerWithVertexSelectionoperator= (const VisualizerWithVertexSelection &)=delete
 
bool AddGeometry (std::shared_ptr< const geometry::Geometry > geometry_ptr, bool reset_bounding_box=true) override
 Function to add geometry to the scene and create corresponding shaders. More...
 
bool UpdateGeometry (std::shared_ptr< const geometry::Geometry > geometry_ptr=nullptr) override
 Function to update geometry. More...
 
void PrintVisualizerHelp () override
 
void UpdateWindowTitle () override
 
void BuildUtilities () override
 
void SetPointSize (double size)
 
std::vector< int > PickPoints (double x, double y, double w, double h)
 
std::vector< PickedPointGetPickedPoints () const
 
void ClearPickedPoints ()
 
void RegisterSelectionChangedCallback (std::function< void()> f)
 
void RegisterSelectionMovingCallback (std::function< void()> f)
 
void RegisterSelectionMovedCallback (std::function< void()> f)
 
- 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 HasGeometry () const
 
virtual void UpdateRender ()
 Function to inform render needed to be updated. More...
 
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
 

Protected Types

enum  DragType { DRAG_MOVING, DRAG_END }
 

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 AddPickedPoints (const std::vector< int > indices)
 
void RemovePickedPoints (const std::vector< int > indices)
 
float GetDepth (int winX, int winY)
 
Eigen::Vector3d CalcDragDelta (double winX, double winY)
 
void DragSelectedPoints (const Eigen::Vector3d &delta, DragType type)
 
const std::vector< Eigen::Vector3d > * GetGeometryPoints (std::shared_ptr< const geometry::Geometry > geometry)
 
- Protected Member Functions inherited from open3d::visualization::Visualizer
virtual bool InitOpenGL ()
 Function to initialize OpenGL. More...
 
virtual void Render ()
 
void CopyViewStatusToClipboard ()
 
void CopyViewStatusFromClipboard ()
 
virtual void WindowRefreshCallback (GLFWwindow *window)
 
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
 
Eigen::Vector2d mouse_down_pos_
 
std::vector< int > points_in_rect_
 
float drag_depth_
 
std::shared_ptr< PointCloudPickerpointcloud_picker_ptr_
 
std::shared_ptr< glsl::PointCloudPickerRendererpointcloud_picker_renderer_ptr_
 
std::shared_ptr< const geometry::Geometrygeometry_ptr_
 
std::shared_ptr< glsl::GeometryRenderergeometry_renderer_ptr_
 
RenderOption pick_point_opts_
 
std::shared_ptr< geometry::PointCloudui_points_geometry_ptr_
 
std::shared_ptr< glsl::GeometryRendererui_points_renderer_ptr_
 
std::unordered_map< int, Eigen::Vector3d > selected_points_
 
std::unordered_map< int, Eigen::Vector3d > selected_points_before_drag_
 
std::shared_ptr< geometry::PointCloudui_selected_points_geometry_ptr_
 
std::shared_ptr< glsl::GeometryRendererui_selected_points_renderer_ptr_
 
std::function< void()> on_selection_changed_
 
std::function< void()> on_selection_moving_
 
std::function< void()> on_selection_moved_
 
- Protected Attributes inherited from open3d::visualization::Visualizer
GLFWwindow * window_ = NULL
 
std::string window_name_ = "Open3D"
 
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_
 
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_
 

Member Enumeration Documentation

◆ DragType

Enumerator
DRAG_MOVING 
DRAG_END 

◆ SelectionMode

Enumerator
None 
Point 
Rectangle 
Moving 

Constructor & Destructor Documentation

◆ VisualizerWithVertexSelection() [1/2]

open3d::visualization::VisualizerWithVertexSelection::VisualizerWithVertexSelection ( )
inline

◆ ~VisualizerWithVertexSelection()

open3d::visualization::VisualizerWithVertexSelection::~VisualizerWithVertexSelection ( )
inlineoverride

◆ VisualizerWithVertexSelection() [2/2]

open3d::visualization::VisualizerWithVertexSelection::VisualizerWithVertexSelection ( const VisualizerWithVertexSelection )
delete

Member Function Documentation

◆ AddGeometry()

bool open3d::visualization::VisualizerWithVertexSelection::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.

  1. After calling this function, the Visualizer owns the geometry object.
  2. This function MUST be called after CreateVisualizerWindow().
  3. This function returns FALSE when the geometry is of an unsupported type.
  4. If an added geometry is changed, the behavior of Visualizer is undefined. Programmers are responsible for calling Geometry() to notify the Visualizer that the geometry has been changed and the Visualizer should be updated accordingly.
Parameters
geometry_ptrThe Geometry object.

Reimplemented from open3d::visualization::Visualizer.

◆ AddPickedPoints()

void open3d::visualization::VisualizerWithVertexSelection::AddPickedPoints ( const std::vector< int >  indices)
protected

◆ BuildUtilities()

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

Reimplemented from open3d::visualization::Visualizer.

◆ CalcDragDelta()

Eigen::Vector3d open3d::visualization::VisualizerWithVertexSelection::CalcDragDelta ( double  winX,
double  winY 
)
protected

◆ ClearPickedPoints()

void open3d::visualization::VisualizerWithVertexSelection::ClearPickedPoints ( )

◆ DragSelectedPoints()

void open3d::visualization::VisualizerWithVertexSelection::DragSelectedPoints ( const Eigen::Vector3d &  delta,
DragType  type 
)
protected

◆ GetDepth()

float open3d::visualization::VisualizerWithVertexSelection::GetDepth ( int  winX,
int  winY 
)
protected

◆ GetGeometryPoints()

const std::vector< Eigen::Vector3d > * open3d::visualization::VisualizerWithVertexSelection::GetGeometryPoints ( std::shared_ptr< const geometry::Geometry geometry)
protected

◆ GetPickedPoints()

std::vector< VisualizerWithVertexSelection::PickedPoint > open3d::visualization::VisualizerWithVertexSelection::GetPickedPoints ( ) const

◆ InitRenderOption()

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

Function to initialize RenderOption.

Reimplemented from open3d::visualization::Visualizer.

◆ InitViewControl()

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

Function to initialize ViewControl.

Reimplemented from open3d::visualization::Visualizer.

◆ InvalidatePicking()

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

◆ InvalidateSelectionPolygon()

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

◆ KeyPressCallback()

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

Reimplemented from open3d::visualization::Visualizer.

◆ MouseButtonCallback()

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

Reimplemented from open3d::visualization::Visualizer.

◆ MouseMoveCallback()

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

Reimplemented from open3d::visualization::Visualizer.

◆ MouseScrollCallback()

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

Reimplemented from open3d::visualization::Visualizer.

◆ operator=()

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

◆ PickPoints()

std::vector< int > open3d::visualization::VisualizerWithVertexSelection::PickPoints ( double  x,
double  y,
double  w,
double  h 
)

◆ PrintVisualizerHelp()

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

Reimplemented from open3d::visualization::Visualizer.

◆ RegisterSelectionChangedCallback()

void open3d::visualization::VisualizerWithVertexSelection::RegisterSelectionChangedCallback ( std::function< void()>  f)

◆ RegisterSelectionMovedCallback()

void open3d::visualization::VisualizerWithVertexSelection::RegisterSelectionMovedCallback ( std::function< void()>  f)

◆ RegisterSelectionMovingCallback()

void open3d::visualization::VisualizerWithVertexSelection::RegisterSelectionMovingCallback ( std::function< void()>  f)

Do not change the number of vertices in geometry, but can change the vertex values and call UpdateGeometry().

◆ RemovePickedPoints()

void open3d::visualization::VisualizerWithVertexSelection::RemovePickedPoints ( const std::vector< int >  indices)
protected

◆ SetPointSize()

void open3d::visualization::VisualizerWithVertexSelection::SetPointSize ( double  size)

◆ UpdateGeometry()

bool open3d::visualization::VisualizerWithVertexSelection::UpdateGeometry ( std::shared_ptr< const geometry::Geometry geometry_ptr = nullptr)
overridevirtual

Function to update geometry.

This function must be called when geometry has been changed. Otherwise the behavior of Visualizer is undefined. If called without an argument, updates all geometries, otherwise only updates the geometry specified.

Reimplemented from open3d::visualization::Visualizer.

◆ UpdateWindowTitle()

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

Reimplemented from open3d::visualization::Visualizer.

◆ WindowResizeCallback()

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

Reimplemented from open3d::visualization::Visualizer.

Field Documentation

◆ drag_depth_

float open3d::visualization::VisualizerWithVertexSelection::drag_depth_
protected

◆ geometry_ptr_

std::shared_ptr<const geometry::Geometry> open3d::visualization::VisualizerWithVertexSelection::geometry_ptr_
protected

◆ geometry_renderer_ptr_

std::shared_ptr<glsl::GeometryRenderer> open3d::visualization::VisualizerWithVertexSelection::geometry_renderer_ptr_
protected

◆ mouse_down_pos_

Eigen::Vector2d open3d::visualization::VisualizerWithVertexSelection::mouse_down_pos_
protected

◆ on_selection_changed_

std::function<void()> open3d::visualization::VisualizerWithVertexSelection::on_selection_changed_
protected

◆ on_selection_moved_

std::function<void()> open3d::visualization::VisualizerWithVertexSelection::on_selection_moved_
protected

◆ on_selection_moving_

std::function<void()> open3d::visualization::VisualizerWithVertexSelection::on_selection_moving_
protected

◆ pick_point_opts_

RenderOption open3d::visualization::VisualizerWithVertexSelection::pick_point_opts_
protected

◆ pointcloud_picker_ptr_

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

◆ pointcloud_picker_renderer_ptr_

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

◆ points_in_rect_

std::vector<int> open3d::visualization::VisualizerWithVertexSelection::points_in_rect_
protected

◆ selected_points_

std::unordered_map<int, Eigen::Vector3d> open3d::visualization::VisualizerWithVertexSelection::selected_points_
protected

◆ selected_points_before_drag_

std::unordered_map<int, Eigen::Vector3d> open3d::visualization::VisualizerWithVertexSelection::selected_points_before_drag_
protected

◆ selection_mode_

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

◆ selection_polygon_ptr_

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

◆ selection_polygon_renderer_ptr_

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

◆ ui_points_geometry_ptr_

std::shared_ptr<geometry::PointCloud> open3d::visualization::VisualizerWithVertexSelection::ui_points_geometry_ptr_
protected

◆ ui_points_renderer_ptr_

std::shared_ptr<glsl::GeometryRenderer> open3d::visualization::VisualizerWithVertexSelection::ui_points_renderer_ptr_
protected

◆ ui_selected_points_geometry_ptr_

std::shared_ptr<geometry::PointCloud> open3d::visualization::VisualizerWithVertexSelection::ui_selected_points_geometry_ptr_
protected

◆ ui_selected_points_renderer_ptr_

std::shared_ptr<glsl::GeometryRenderer> open3d::visualization::VisualizerWithVertexSelection::ui_selected_points_renderer_ptr_
protected

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