![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Visualizer with editing capabilities. More...
#include <VisualizerWithEditing.h>


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 | |
| VisualizerWithEditing & | operator= (const VisualizerWithEditing &)=delete |
| 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... | |
| void | PrintVisualizerHelp () override |
| void | UpdateWindowTitle () override |
| void | BuildUtilities () override |
| int | PickPoint (double x, double y) |
| std::vector< size_t > & | GetPickedPoints () |
Public Member Functions inherited from cloudViewer::visualization::Visualizer | |
| Visualizer () | |
| virtual | ~Visualizer () |
| Visualizer (Visualizer &&)=delete | |
| Visualizer (const Visualizer &)=delete | |
| Visualizer & | operator= (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 bool | UpdateGeometry (std::shared_ptr< const ccHObject > 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 () |
| 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 |
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 cloudViewer::visualization::Visualizer | |
| virtual bool | InitOpenGL () |
| Function to initialize OpenGL. More... | |
| virtual void | Render (bool render_screen=false) |
| 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< SelectionPolygon > | selection_polygon_ptr_ |
| std::shared_ptr< glsl::SelectionPolygonRenderer > | selection_polygon_renderer_ptr_ |
| SelectionMode | selection_mode_ = SelectionMode::None |
| std::shared_ptr< PointCloudPicker > | pointcloud_picker_ptr_ |
| std::shared_ptr< glsl::PointCloudPickerRenderer > | pointcloud_picker_renderer_ptr_ |
| std::shared_ptr< const ccHObject > | original_geometry_ptr_ |
| std::shared_ptr< ccHObject > | editing_geometry_ptr_ |
| std::shared_ptr< glsl::GeometryRenderer > | editing_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 cloudViewer::visualization::Visualizer | |
| GLFWwindow * | window_ = nullptr |
| std::string | window_name_ = "CloudViewer" |
| std::shared_ptr< GLFWContext > | glfw_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< ViewControl > | view_control_ptr_ |
| std::unique_ptr< RenderOption > | render_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 >, RenderOption > | utility_renderer_opts_ |
| std::shared_ptr< ccMesh > | coordinate_frame_mesh_ptr_ |
| std::shared_ptr< glsl::CoordinateFrameRenderer > | coordinate_frame_mesh_renderer_ptr_ |
Visualizer with editing capabilities.
Definition at line 21 of file VisualizerWithEditing.h.
| Enumerator | |
|---|---|
| None | |
| Rectangle | |
| Polygon | |
Definition at line 23 of file VisualizerWithEditing.h.
|
inline |
Function to add geometry to the scene and create corresponding shaders.
| geometry | The Geometry object. |
Definition at line 33 of file VisualizerWithEditing.h.
|
inlineoverride |
Definition at line 39 of file VisualizerWithEditing.h.
|
delete |
|
overridevirtual |
Function to add geometry to the scene and create corresponding shaders.
| geometry_ptr | The Geometry object. |
Reimplemented from cloudViewer::visualization::Visualizer.
Definition at line 32 of file VisualizerWithEditing.cpp.
References CV_TYPES::CUSTOM_H_OBJECT, editing_geometry_ptr_, editing_geometry_renderer_ptr_, cloudViewer::visualization::Visualizer::geometry_ptrs_, cloudViewer::visualization::Visualizer::geometry_renderer_ptrs_, CV_TYPES::HALF_EDGE_MESH, CV_TYPES::IMAGE2, cloudViewer::visualization::Visualizer::is_initialized_, CV_TYPES::LINESET, LogDebug, CV_TYPES::MESH, original_geometry_ptr_, CV_TYPES::POINT_CLOUD, cloudViewer::visualization::Visualizer::ResetViewPoint(), cloudViewer::visualization::Visualizer::UpdateGeometry(), cloudViewer::visualization::Visualizer::view_control_ptr_, and cloudViewer::visualization::Visualizer::window_.
Referenced by cloudViewer::visualization::DrawGeometriesWithEditing(), and main().
|
overridevirtual |
Reimplemented from cloudViewer::visualization::Visualizer.
Definition at line 142 of file VisualizerWithEditing.cpp.
References cloudViewer::visualization::Visualizer::BuildUtilities(), editing_geometry_ptr_, cloudViewer::visualization::Visualizer::geometry_ptrs_, pointcloud_picker_ptr_, pointcloud_picker_renderer_ptr_, selection_polygon_ptr_, selection_polygon_renderer_ptr_, cloudViewer::visualization::Visualizer::utility_ptrs_, and cloudViewer::visualization::Visualizer::utility_renderer_ptrs_.
Referenced by main().
| std::vector< size_t > & cloudViewer::visualization::VisualizerWithEditing::GetPickedPoints | ( | ) |
Definition at line 243 of file VisualizerWithEditing.cpp.
References pointcloud_picker_ptr_.
Referenced by cloudViewer::VisualizerForAlignment::AlignWithManualAnnotation(), cloudViewer::VisualizerForAlignment::LoadSessionFromFile(), cloudViewer::visualization::pybind_visualizer(), and cloudViewer::VisualizerForAlignment::SaveSessionToFile().
|
overrideprotectedvirtual |
Function to initialize RenderOption.
Reimplemented from cloudViewer::visualization::Visualizer.
Definition at line 254 of file VisualizerWithEditing.cpp.
References cloudViewer::visualization::Visualizer::render_option_ptr_.
|
overrideprotectedvirtual |
Function to initialize ViewControl.
Reimplemented from cloudViewer::visualization::Visualizer.
Definition at line 247 of file VisualizerWithEditing.cpp.
References cloudViewer::visualization::Visualizer::ResetViewPoint(), and cloudViewer::visualization::Visualizer::view_control_ptr_.
|
protected |
Definition at line 637 of file VisualizerWithEditing.cpp.
References pointcloud_picker_ptr_, and pointcloud_picker_renderer_ptr_.
Referenced by KeyPressCallback().
|
protected |
Definition at line 629 of file VisualizerWithEditing.cpp.
References None, selection_mode_, selection_polygon_ptr_, and selection_polygon_renderer_ptr_.
Referenced by KeyPressCallback(), MouseButtonCallback(), and WindowResizeCallback().
|
overrideprotectedvirtual |
Reimplemented from cloudViewer::visualization::Visualizer.
Definition at line 260 of file VisualizerWithEditing.cpp.
References crop_action_count_, default_directory_, editing_geometry_ptr_, editing_geometry_renderer_ptr_, filename, format, InvalidatePicking(), InvalidateSelectionPolygon(), cloudViewer::visualization::Visualizer::is_redraw_required_, cloudViewer::visualization::Visualizer::KeyPressCallback(), LogDebug, LogError, LogInfo, LogWarning, CV_TYPES::MESH, mesh_ptr, None, NULL, original_geometry_ptr_, CV_TYPES::POINT_CLOUD, cloudViewer::visualization::SelectionPolygon::Polygon, Polygon, cloudViewer::visualization::Visualizer::render_option_ptr_, SaveCroppingResult(), selection_mode_, selection_polygon_ptr_, selection_polygon_renderer_ptr_, patch::to_string(), cloudViewer::visualization::Visualizer::UpdateGeometry(), UpdateWindowTitle(), use_dialog_, cloudViewer::visualization::Visualizer::view_control_ptr_, voxel_size_, ccPointCloud::VoxelDownSample(), and cloudViewer::visualization::Visualizer::window_.
|
overrideprotectedvirtual |
Reimplemented from cloudViewer::visualization::Visualizer.
Definition at line 512 of file VisualizerWithEditing.cpp.
References editing_geometry_ptr_, InvalidateSelectionPolygon(), cloudViewer::visualization::Visualizer::is_redraw_required_, LogInfo, cloudViewer::visualization::Visualizer::MouseButtonCallback(), None, PickPoint(), pointcloud_picker_ptr_, Polygon, cloudViewer::visualization::SelectionPolygon::Rectangle, Rectangle, selection_mode_, selection_polygon_ptr_, selection_polygon_renderer_ptr_, and cloudViewer::visualization::Visualizer::view_control_ptr_.
|
overrideprotectedvirtual |
Reimplemented from cloudViewer::visualization::Visualizer.
Definition at line 474 of file VisualizerWithEditing.cpp.
References cloudViewer::visualization::Visualizer::is_redraw_required_, cloudViewer::visualization::Visualizer::MouseMoveCallback(), None, Polygon, Rectangle, selection_mode_, selection_polygon_ptr_, selection_polygon_renderer_ptr_, and cloudViewer::visualization::Visualizer::view_control_ptr_.
|
overrideprotectedvirtual |
Reimplemented from cloudViewer::visualization::Visualizer.
Definition at line 502 of file VisualizerWithEditing.cpp.
References cloudViewer::visualization::Visualizer::MouseScrollCallback(), and cloudViewer::visualization::Visualizer::view_control_ptr_.
|
delete |
| int cloudViewer::visualization::VisualizerWithEditing::PickPoint | ( | double | x, |
| double | y | ||
| ) |
Definition at line 177 of file VisualizerWithEditing.cpp.
References cloudViewer::visualization::gl_util::ColorCodeToPickIndex(), editing_geometry_ptr_, cloudViewer::visualization::Visualizer::GetRenderOption(), cloudViewer::visualization::Visualizer::GetViewControl(), LogWarning, and cloudViewer::visualization::Visualizer::view_control_ptr_.
Referenced by MouseButtonCallback().
|
overridevirtual |
Reimplemented from cloudViewer::visualization::Visualizer.
Definition at line 107 of file VisualizerWithEditing.cpp.
References LogInfo, and cloudViewer::visualization::Visualizer::PrintVisualizerHelp().
|
protected |
Definition at line 644 of file VisualizerWithEditing.cpp.
References editing_geometry_ptr_, filename, cloudViewer::utility::filesystem::GetFileNameWithoutExtension(), cloudViewer::visualization::Visualizer::GetViewControl(), CV_TYPES::MESH, CV_TYPES::POINT_CLOUD, selection_polygon_ptr_, cloudViewer::io::WriteIJsonConvertible(), cloudViewer::io::WritePointCloud(), and cloudViewer::io::WriteTriangleMesh().
Referenced by KeyPressCallback().
|
overridevirtual |
Reimplemented from cloudViewer::visualization::Visualizer.
Definition at line 133 of file VisualizerWithEditing.cpp.
References cloudViewer::visualization::Visualizer::view_control_ptr_, cloudViewer::visualization::Visualizer::window_, and cloudViewer::visualization::Visualizer::window_name_.
Referenced by KeyPressCallback().
|
overrideprotectedvirtual |
Reimplemented from cloudViewer::visualization::Visualizer.
Definition at line 467 of file VisualizerWithEditing.cpp.
References InvalidateSelectionPolygon(), and cloudViewer::visualization::Visualizer::WindowResizeCallback().
|
protected |
Definition at line 88 of file VisualizerWithEditing.h.
Referenced by KeyPressCallback().
|
protected |
Definition at line 87 of file VisualizerWithEditing.h.
Referenced by KeyPressCallback().
|
protected |
Definition at line 82 of file VisualizerWithEditing.h.
Referenced by AddGeometry(), BuildUtilities(), KeyPressCallback(), MouseButtonCallback(), PickPoint(), and SaveCroppingResult().
|
protected |
Definition at line 83 of file VisualizerWithEditing.h.
Referenced by AddGeometry(), and KeyPressCallback().
|
protected |
Definition at line 81 of file VisualizerWithEditing.h.
Referenced by AddGeometry(), and KeyPressCallback().
|
protected |
Definition at line 77 of file VisualizerWithEditing.h.
Referenced by BuildUtilities(), GetPickedPoints(), InvalidatePicking(), and MouseButtonCallback().
|
protected |
Definition at line 79 of file VisualizerWithEditing.h.
Referenced by BuildUtilities(), and InvalidatePicking().
|
protected |
Definition at line 75 of file VisualizerWithEditing.h.
Referenced by InvalidateSelectionPolygon(), KeyPressCallback(), MouseButtonCallback(), and MouseMoveCallback().
|
protected |
Definition at line 72 of file VisualizerWithEditing.h.
Referenced by BuildUtilities(), InvalidateSelectionPolygon(), KeyPressCallback(), MouseButtonCallback(), MouseMoveCallback(), and SaveCroppingResult().
|
protected |
Definition at line 74 of file VisualizerWithEditing.h.
Referenced by BuildUtilities(), InvalidateSelectionPolygon(), KeyPressCallback(), MouseButtonCallback(), and MouseMoveCallback().
|
protected |
Definition at line 86 of file VisualizerWithEditing.h.
Referenced by KeyPressCallback().
|
protected |
Definition at line 85 of file VisualizerWithEditing.h.
Referenced by KeyPressCallback().