Open3D (C++ API)
0.18.0+252c867
|
The main Visualizer class. More...
#include <Visualizer.h>
Data Structures | |
struct | MouseControl |
Public Member Functions | |
Visualizer () | |
virtual | ~Visualizer () |
Visualizer (Visualizer &&)=delete | |
Visualizer (const Visualizer &)=delete | |
Visualizer & | operator= (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 | AddGeometry (std::shared_ptr< const geometry::Geometry > geometry_ptr, bool reset_bounding_box=true) |
Function to add geometry to the scene and create corresponding shaders. More... | |
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 () |
virtual void | PrintVisualizerHelp () |
virtual void | UpdateWindowTitle () |
virtual void | BuildUtilities () |
ViewControl & | GetViewControl () |
Function to retrieve the associated ViewControl. More... | |
RenderOption & | GetRenderOption () |
Function to retrieve the associated RenderOption. More... | |
std::shared_ptr< geometry::Image > | CaptureScreenFloatBuffer (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::Image > | CaptureDepthFloatBuffer (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 | |
virtual bool | InitOpenGL () |
Function to initialize OpenGL. More... | |
virtual bool | InitViewControl () |
Function to initialize ViewControl. More... | |
virtual bool | InitRenderOption () |
Function to initialize RenderOption. 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 | WindowResizeCallback (GLFWwindow *window, int w, int h) |
virtual void | MouseMoveCallback (GLFWwindow *window, double x, double y) |
virtual void | MouseScrollCallback (GLFWwindow *window, double x, double y) |
virtual void | MouseButtonCallback (GLFWwindow *window, int button, int action, int mods) |
virtual void | KeyPressCallback (GLFWwindow *window, int key, int scancode, int action, int mods) |
virtual void | WindowCloseCallback (GLFWwindow *window) |
Function to notify the window to be closed. More... | |
The main Visualizer class.
open3d::visualization::Visualizer::Visualizer | ( | ) |
|
virtual |
|
delete |
|
delete |
|
virtual |
Function to add geometry to the scene and create corresponding shaders.
geometry_ptr | The Geometry object. |
reset_bounding_box | Reset viewpoint to view all geometries. |
Reimplemented in open3d::visualization::VisualizerWithVertexSelection, and open3d::visualization::VisualizerWithEditing.
|
virtual |
Reimplemented in open3d::visualization::VisualizerWithVertexSelection, and open3d::visualization::VisualizerWithEditing.
std::shared_ptr< geometry::Image > open3d::visualization::Visualizer::CaptureDepthFloatBuffer | ( | bool | do_render = true | ) |
Function to capture depth in a float buffer.
do_render | Set to true to do render. |
void open3d::visualization::Visualizer::CaptureDepthImage | ( | const std::string & | filename = "" , |
bool | do_render = true , |
||
double | depth_scale = 1000.0 |
||
) |
Function to capture and save a depth image.
filename | Path to file. |
do_render | Set to true to do render. |
depth_scale | Scale depth value when capturing the depth image. |
void open3d::visualization::Visualizer::CaptureDepthPointCloud | ( | const std::string & | filename = "" , |
bool | do_render = true , |
||
bool | convert_to_world_coordinate = false |
||
) |
Function to capture and save local point cloud.
filename | Path to file. |
do_render | Set to true to do render. |
convert_to_world_coordinate | Set to true to convert to world coordinates. |
void open3d::visualization::Visualizer::CaptureRenderOption | ( | const std::string & | filename = "" | ) |
std::shared_ptr< geometry::Image > open3d::visualization::Visualizer::CaptureScreenFloatBuffer | ( | bool | do_render = true | ) |
Function to capture screen and store RGB in a float buffer.
do_render | Set to true to do render. |
void open3d::visualization::Visualizer::CaptureScreenImage | ( | const std::string & | filename = "" , |
bool | do_render = true |
||
) |
Function to capture and save a screen image.
filename | Path to file. |
do_render | Set to true to do render. |
|
virtual |
Function to remove all geometries from the scene. After calling this function, the Visualizer releases the pointer of all geometry objects.
void open3d::visualization::Visualizer::Close | ( | ) |
Function to to notify the window to be closed.
|
protected |
Apply the view point from clipboard.
|
protected |
Copy the current view status to clipboard.
bool open3d::visualization::Visualizer::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.
This function MUST be called from the main thread.
window_name | Window title name. |
width | Width of the window. |
height | Height of window. |
left | Left margin of the window to the screen. |
top | Top margin of the window to the screen. |
visible | Whether the window is visible. |
void open3d::visualization::Visualizer::DestroyVisualizerWindow | ( | ) |
Function to destroy a window.
This function MUST be called from the main thread.
|
inline |
Function to retrieve the associated RenderOption.
|
inline |
Function to retrieve the associated ViewControl.
std::string open3d::visualization::Visualizer::GetViewStatus | ( | ) |
Get the current view status as a json string of ViewTrajectory.
|
inline |
|
virtual |
|
protectedvirtual |
Function to initialize OpenGL.
|
protectedvirtual |
Function to initialize RenderOption.
Reimplemented in open3d::visualization::VisualizerWithVertexSelection, and open3d::visualization::VisualizerWithEditing.
|
protectedvirtual |
Function to initialize ViewControl.
Reimplemented in open3d::visualization::VisualizerWithVertexSelection, open3d::visualization::VisualizerWithEditing, and open3d::visualization::VisualizerWithCustomAnimation.
|
virtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
delete |
bool open3d::visualization::Visualizer::PollEvents | ( | ) |
Function to process the event queue and return if the window is closed.
Use this function if you want to manage the while loop yourself. This function will NOT block the thread. Thus it is suitable for computation heavy task behind the scene.
|
virtual |
void open3d::visualization::Visualizer::RegisterAnimationCallback | ( | std::function< bool(Visualizer *)> | callback_func | ) |
Function to register a callback function for animation.
The callback function returns if UpdateGeometry() needs to be run.
callback_func | The call back function. |
|
virtual |
Function to remove geometry from the scene.
geometry_ptr | The Geometry object. |
reset_bounding_box | Reset viewpoint to view all geometries. |
|
protectedvirtual |
Function to do the main rendering The function first sets view point, then draw geometry (pointclouds and meshes individually).
void open3d::visualization::Visualizer::ResetViewPoint | ( | bool | reset_bounding_box = false | ) |
Function to reset view point.
void open3d::visualization::Visualizer::Run | ( | ) |
Function to activate the window.
This function will block the current thread until the window is closed.
|
virtual |
Functions to change between fullscreen and windowed modes.
void open3d::visualization::Visualizer::SetViewStatus | ( | const std::string & | view_status_str | ) |
Set the current view status from a json string of ViewTrajectory.
|
virtual |
|
virtual |
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 in open3d::visualization::VisualizerWithVertexSelection.
|
virtual |
Function to inform render needed to be updated.
|
virtual |
bool open3d::visualization::Visualizer::WaitEvents | ( | ) |
Function to process the event queue and return if the window is closed.
Use this function if you want to manage the while loop yourself. This function will block the thread.
|
protectedvirtual |
Function to notify the window to be closed.
|
protectedvirtual |
Callback functions.
|
protectedvirtual |
Reimplemented in open3d::visualization::VisualizerWithVertexSelection, and open3d::visualization::VisualizerWithEditing.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Shared GLFW context.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |