ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
PyVisualizer< VisualizerBase > Class Template Reference

#include <visualization_trampoline.h>

Inheritance diagram for PyVisualizer< VisualizerBase >:
Collaboration diagram for PyVisualizer< VisualizerBase >:

Public Member Functions

bool AddGeometry (std::shared_ptr< const ccHObject > 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 ccHObject > geometry_ptr=nullptr) override
 Function to update geometry. More...
 
bool HasGeometry () const override
 
void UpdateRender () override
 Function to inform render needed to be updated. More...
 
void PrintVisualizerHelp () override
 
void UpdateWindowTitle () override
 
void BuildUtilities () override
 
- Public Member Functions inherited from cloudViewer::visualization::Visualizer
 Visualizer ()
 
virtual ~Visualizer ()
 
 Visualizer (Visualizer &&)=delete
 
 Visualizer (const Visualizer &)=delete
 
Visualizeroperator= (const Visualizer &)=delete
 
bool CreateVisualizerWindow (const std::string &window_name="CloudViewer", 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 ccHObject > geometry_ptr, bool reset_bounding_box=true)
 Function to remove geometry from the scene. More...
 
virtual bool ClearGeometries ()
 
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
 

Additional Inherited Members

- Protected Member Functions inherited from cloudViewer::visualization::Visualizer
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 ()
 
void CopyViewStatusFromClipboard ()
 
virtual void WindowRefreshCallback (GLFWwindow *window)
 
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...
 
- Protected Attributes inherited from cloudViewer::visualization::Visualizer
GLFWwindow * window_ = nullptr
 
std::string window_name_ = "CloudViewer"
 
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 ccHObject > > geometry_ptrs_
 
std::unordered_set< std::shared_ptr< glsl::GeometryRenderer > > geometry_renderer_ptrs_
 
std::vector< std::shared_ptr< const ccHObject > > 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< ccMeshcoordinate_frame_mesh_ptr_
 
std::shared_ptr< glsl::CoordinateFrameRenderer > coordinate_frame_mesh_renderer_ptr_
 

Detailed Description

template<class VisualizerBase = visualization::Visualizer>
class PyVisualizer< VisualizerBase >

Definition at line 20 of file visualization_trampoline.h.

Member Function Documentation

◆ AddGeometry()

template<class VisualizerBase = visualization::Visualizer>
bool PyVisualizer< VisualizerBase >::AddGeometry ( std::shared_ptr< const ccHObject geometry_ptr,
bool  reset_bounding_box = true 
)
inlineoverridevirtual

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 cloudViewer::visualization::Visualizer.

Definition at line 23 of file visualization_trampoline.h.

◆ BuildUtilities()

template<class VisualizerBase = visualization::Visualizer>
void PyVisualizer< VisualizerBase >::BuildUtilities ( )
inlineoverridevirtual

Reimplemented from cloudViewer::visualization::Visualizer.

Definition at line 43 of file visualization_trampoline.h.

◆ HasGeometry()

template<class VisualizerBase = visualization::Visualizer>
bool PyVisualizer< VisualizerBase >::HasGeometry ( ) const
inlineoverridevirtual

Reimplemented from cloudViewer::visualization::Visualizer.

Definition at line 31 of file visualization_trampoline.h.

◆ PrintVisualizerHelp()

template<class VisualizerBase = visualization::Visualizer>
void PyVisualizer< VisualizerBase >::PrintVisualizerHelp ( )
inlineoverridevirtual

Reimplemented from cloudViewer::visualization::Visualizer.

Definition at line 37 of file visualization_trampoline.h.

◆ UpdateGeometry()

template<class VisualizerBase = visualization::Visualizer>
bool PyVisualizer< VisualizerBase >::UpdateGeometry ( std::shared_ptr< const ccHObject geometry_ptr = nullptr)
inlineoverridevirtual

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 cloudViewer::visualization::Visualizer.

Definition at line 27 of file visualization_trampoline.h.

◆ UpdateRender()

template<class VisualizerBase = visualization::Visualizer>
void PyVisualizer< VisualizerBase >::UpdateRender ( )
inlineoverridevirtual

Function to inform render needed to be updated.

Reimplemented from cloudViewer::visualization::Visualizer.

Definition at line 34 of file visualization_trampoline.h.

◆ UpdateWindowTitle()

template<class VisualizerBase = visualization::Visualizer>
void PyVisualizer< VisualizerBase >::UpdateWindowTitle ( )
inlineoverridevirtual

Reimplemented from cloudViewer::visualization::Visualizer.

Definition at line 40 of file visualization_trampoline.h.


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