14 #include <IJsonConvertibleIO.h>
24 namespace visualization {
27 py::class_<visualization::SelectionPolygonVolume> selection_volume(
28 m,
"SelectionPolygonVolume",
29 "Select a polygon volume for cropping.");
30 py::detail::bind_default_constructor<visualization::SelectionPolygonVolume>(
32 py::detail::bind_copy_functions<visualization::SelectionPolygonVolume>(
41 "input"_a,
"Function to crop point cloud.")
48 "input"_a,
"Function to crop crop triangle mesh.")
55 "input"_a,
"Function to crop 3d point clouds.")
59 "visualization::SelectionPolygonVolume, access "
61 "orthogonal_axis, bounding_polygon, axis_min, "
67 "string: one of ``{x, y, z}``.")
71 "``(n, 3)`` float64 numpy array: Bounding polygon "
73 .def_readwrite(
"axis_min",
75 "float: Minimum axis value.")
76 .def_readwrite(
"axis_max",
78 "float: Maximum axis value.");
81 {{
"input",
"The input point cloud."}});
84 {{
"input",
"The input triangle mesh."}});
87 {{
"input",
"The input point cloud xyz."}});
92 static const std::unordered_map<std::string, std::string>
95 "Call back function to be triggered at a key press "
97 {
"filename",
"The file path."},
98 {
"geometry_list",
"List of geometries to be visualized."},
99 {
"height",
"The height of the visualization window."},
100 {
"key_to_callback",
"Map of key to call back functions."},
101 {
"left",
"The left margin of the visualization window."},
102 {
"optional_view_trajectory_json_file",
103 "Camera trajectory json file path for custom animation."},
104 {
"top",
"The top margin of the visualization window."},
105 {
"width",
"The width of the visualization window."},
106 {
"point_show_normal",
107 "Visualize point normals if set to true."},
108 {
"mesh_show_wireframe",
109 "Visualize mesh wireframe if set to true."},
110 {
"mesh_show_back_face",
111 "Visualize also the back face of the mesh triangles."},
113 "The displayed title of the visualization window."},
114 {
"lookat",
"The lookat vector of the camera."},
115 {
"up",
"The up vector of the camera."},
116 {
"front",
"The front vector of the camera."},
117 {
"zoom",
"The zoom of the camera."}};
122 [](
const std::vector<std::shared_ptr<const ccHObject>>
124 const std::string &window_name,
int width,
int height,
int left,
125 int top,
bool point_show_normal,
bool mesh_show_wireframe,
126 bool mesh_show_back_face,
131 std::string current_dir =
134 top, point_show_normal, mesh_show_wireframe,
142 "Function to draw a list of geometry::Geometry objects",
143 "geometry_list"_a,
"window_name"_a =
"CloudViewer",
144 "width"_a = 1920,
"height"_a = 1080,
"left"_a = 50,
"top"_a = 50,
145 "point_show_normal"_a =
false,
"mesh_show_wireframe"_a =
false,
146 "mesh_show_back_face"_a =
false,
"lookat"_a = py::none(),
147 "up"_a = py::none(),
"front"_a = py::none(),
"zoom"_a = py::none());
152 "draw_geometries_with_custom_animation",
153 [](
const std::vector<std::shared_ptr<const ccHObject>>
155 const std::string &window_name,
int width,
int height,
int left,
156 int top,
const fs::path &json_filename) {
157 std::string current_dir =
160 geometry_ptrs, window_name,
width,
height, left, top,
161 json_filename.string());
165 "Function to draw a list of ccHObject objects with a GUI "
167 "supports animation",
168 "geometry_list"_a,
"window_name"_a =
"cloudViewer",
169 "width"_a = 1920,
"height"_a = 1080,
"left"_a = 50,
"top"_a = 50,
170 "optional_view_trajectory_json_file"_a =
"");
175 "draw_geometries_with_animation_callback",
176 [](
const std::vector<std::shared_ptr<const ccHObject>>
179 const std::string &window_name,
int width,
int height,
int left,
181 std::string current_dir =
184 geometry_ptrs, callback_func, window_name,
width,
189 "Function to draw a list of ccHObject objects with a "
191 "animation callback function",
192 "geometry_list"_a,
"callback_function"_a,
193 "window_name"_a =
"cloudViewer",
"width"_a = 1920,
194 "height"_a = 1080,
"left"_a = 50,
"top"_a = 50,
195 py::return_value_policy::reference);
200 "draw_geometries_with_key_callbacks",
201 [](
const std::vector<std::shared_ptr<const ccHObject>>
206 const std::string &window_name,
int width,
int height,
int left,
208 std::string current_dir =
211 geometry_ptrs, key_to_callback, window_name,
width,
216 "Function to draw a list of ccHObject objects with a "
218 "key-callback mapping",
219 "geometry_list"_a,
"key_to_callback"_a,
220 "window_name"_a =
"cloudViewer",
"width"_a = 1920,
221 "height"_a = 1080,
"left"_a = 50,
"top"_a = 50);
226 "draw_geometries_with_editing",
227 [](
const std::vector<std::shared_ptr<const ccHObject>>
229 const std::string &window_name,
int width,
int height,
int left,
232 geometry_ptrs, window_name,
width,
height, left, top);
234 "Function to draw a list of ccHObject providing user "
236 "geometry_list"_a,
"window_name"_a =
"cloudViewer",
237 "width"_a = 1920,
"height"_a = 1080,
"left"_a = 50,
"top"_a = 50);
242 "draw_geometries_with_vertex_selection",
243 [](
const std::vector<std::shared_ptr<const ccHObject>>
245 const std::string &window_name,
int width,
int height,
int left,
248 geometry_ptrs, window_name,
width,
height, left, top);
250 "Function to draw a list of ccHObject providing ability "
251 "for user to select points",
252 "geometry_list"_a,
"window_name"_a =
"cloudViewer",
253 "width"_a = 1920,
"height"_a = 1080,
"left"_a = 50,
"top"_a = 50);
258 "read_selection_polygon_volume",
264 "Function to read visualization::SelectionPolygonVolume from file",
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
constexpr bool has_value() const noexcept
constexpr T const & value() const &
Select a polygon volume for cropping.
std::vector< Eigen::Vector3d > bounding_polygon_
Bounding polygon boundary.
double axis_min_
Minimum axis value.
double axis_max_
Maximum axis value.
std::string orthogonal_axis_
One of {x, y, z}.
std::vector< size_t > CropInPolygon(const ccPointCloud &input) const
std::shared_ptr< ccPointCloud > CropPointCloud(const ccPointCloud &input) const
std::shared_ptr< ccMesh > CropTriangleMesh(const ccMesh &input) const
The main Visualizer class.
void ClassMethodDocInject(py::module &pybind_module, const std::string &class_name, const std::string &function_name, const std::unordered_map< std::string, std::string > &map_parameter_body_docs)
void FunctionDocInject(py::module &pybind_module, const std::string &function_name, const std::unordered_map< std::string, std::string > &map_parameter_body_docs)
bool ReadIJsonConvertible(const std::string &filename, cloudViewer::utility::IJsonConvertible &object)
static const std::string path
bool ChangeWorkingDirectory(const std::string &directory)
std::string GetWorkingDirectory()
void pybind_visualization_utility(py::module &m)
bool DrawGeometriesWithVertexSelection(const std::vector< std::shared_ptr< const ccHObject >> &geometry_ptrs, const std::string &window_name, int width, int height, int left, int top)
void pybind_visualization_utility_methods(py::module &m)
static const std::unordered_map< std::string, std::string > map_shared_argument_docstrings
bool DrawGeometriesWithKeyCallbacks(const std::vector< std::shared_ptr< const ccHObject >> &geometry_ptrs, const std::map< int, std::function< bool(Visualizer *)>> &key_to_callback, const std::string &window_name, int width, int height, int left, int top)
Function to draw a list of geometry.
bool DrawGeometriesWithCustomAnimation(const std::vector< std::shared_ptr< const ccHObject >> &geometry_ptrs, const std::string &window_name, int width, int height, int left, int top, const std::string &json_filename)
Function to draw a list of geometry objects with a GUI that supports animation.
bool DrawGeometriesWithEditing(const std::vector< std::shared_ptr< const ccHObject >> &geometry_ptrs, const std::string &window_name, int width, int height, int left, int top)
Function to draw a list of geometry.
bool DrawGeometries(const std::vector< std::shared_ptr< const ccHObject >> &geometry_ptrs, const std::string &window_name, int width, int height, int left, int top, bool point_show_normal, bool mesh_show_wireframe, bool mesh_show_back_face, Eigen::Vector3d *lookat, Eigen::Vector3d *up, Eigen::Vector3d *front, double *zoom)
Function to draw a list of geometry objects.
bool DrawGeometriesWithAnimationCallback(const std::vector< std::shared_ptr< const ccHObject >> &geometry_ptrs, std::function< bool(Visualizer *)> callback_func, const std::string &window_name, int width, int height, int left, int top)
Function to draw a list of geometry objects with a customized animation callback function.
Generic file read and write utility for python interface.