Skip to content

Commit

Permalink
add missing keyword argument names
Browse files Browse the repository at this point in the history
  • Loading branch information
djkeyes committed Oct 4, 2023
1 parent ea2001f commit 5c2523a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
13 changes: 8 additions & 5 deletions cpp/pybind/visualization/o3dvisualizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ void pybind_o3dvisualizer(py::module& m) {
"Returns 'window_undefined' otherwise.")
.def("post_redraw", &O3DVisualizer::PostRedraw,
"Tells the window to redraw")
.def("show", &O3DVisualizer::Show, "Shows or hides the window")
.def("show", &O3DVisualizer::Show, "Shows or hides the window",
"vis"_a)
.def("close", &O3DVisualizer::Close,
"Closes the window and destroys it, unless an on_close "
"callback cancels the close.")
Expand All @@ -143,17 +144,19 @@ void pybind_o3dvisualizer(py::module& m) {
[](O3DVisualizer& w, UnownedPointer<gui::Dialog> dlg) {
w.ShowDialog(TakeOwnership<gui::Dialog>(dlg));
},
"Displays the dialog")
"Displays the dialog", "dlg"_a)
.def("close_dialog", &O3DVisualizer::CloseDialog,
"Closes the current dialog")
.def("show_message_box", &O3DVisualizer::ShowMessageBox,
"Displays a simple dialog with a title and message and okay "
"button")
"button",
"title"_a, "message"_a)
.def("set_on_close", &O3DVisualizer::SetOnClose,
"Sets a callback that will be called when the window is "
"closed. The callback is given no arguments and should return "
"True to continue closing the window or False to cancel the "
"close")
"close",
"callback"_a)
.def("show_menu", &O3DVisualizer::ShowMenu,
"show_menu(show): shows or hides the menu in the window, "
"except on macOS since the menubar is not in the window "
Expand Down Expand Up @@ -337,7 +340,7 @@ void pybind_o3dvisualizer(py::module& m) {
"enable_raw_mode(enable): Enables/disables raw mode for "
"simplified lighting environment.")
.def("show_skybox", &O3DVisualizer::ShowSkybox,
"Show/Hide the skybox")
"Show/Hide the skybox", "show"_a)
.def_property(
"show_settings",
[](const O3DVisualizer& dv) {
Expand Down
4 changes: 2 additions & 2 deletions cpp/pybind/visualization/rendering/material.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ void pybind_material(py::module& m) {
"such as TriangleMesh, LineSets, and PointClouds");

mat.def(py::init<>())
.def(py::init<Material>())
.def(py::init<const std::string&>())
.def(py::init<Material>(), "", "mat"_a)
.def(py::init<const std::string&>(), "", "material_name"_a)
.def("set_default_properties", &Material::SetDefaultProperties,
"Fills material with defaults for common PBR material "
"properties used by Open3D")
Expand Down
24 changes: 15 additions & 9 deletions cpp/pybind/visualization/visualizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void pybind_visualizer(py::module &m) {
.def("close", &Visualizer::Close,
"Function to notify the window to be closed")
.def("reset_view_point", &Visualizer::ResetViewPoint,
"Function to reset view point")
"Function to reset view point", "reset_bounding_box"_a = false)
.def("update_geometry", &Visualizer::UpdateGeometry,
"Function to update geometry. This function must be called "
"when geometry has been changed. Otherwise the behavior of "
Expand All @@ -77,7 +77,8 @@ void pybind_visualizer(py::module &m) {
.def("update_renderer", &Visualizer::UpdateRender,
"Function to inform render needed to be updated")
.def("set_full_screen", &Visualizer::SetFullScreen,
"Function to change between fullscreen and windowed")
"Function to change between fullscreen and windowed",
"fullscreen"_a)
.def("toggle_full_screen", &Visualizer::ToggleFullScreen,
"Function to toggle between fullscreen and windowed")
.def("is_full_screen", &Visualizer::IsFullScreen,
Expand Down Expand Up @@ -160,7 +161,9 @@ void pybind_visualizer(py::module &m) {
"Visualizer with editing capabilities.");
py::detail::bind_default_constructor<VisualizerWithEditing>(
visualizer_edit);
visualizer_edit.def(py::init<double, bool, const std::string &>())
visualizer_edit
.def(py::init<double, bool, const std::string &>(), "voxel_size"_a,
"use_dialog"_a, "directory"_a)
.def("__repr__",
[](const VisualizerWithEditing &vis) {
return std::string("VisualizerWithEditing with name ") +
Expand Down Expand Up @@ -189,7 +192,7 @@ void pybind_visualizer(py::module &m) {
vis.GetWindowName();
})
.def("pick_points", &VisualizerWithVertexSelection::PickPoints,
"Function to pick points")
"Function to pick points", "x"_a, "y"_a, "w"_a, "h"_a)
.def("get_picked_points",
&VisualizerWithVertexSelection::GetPickedPoints,
"Function to get picked points")
Expand All @@ -198,23 +201,26 @@ void pybind_visualizer(py::module &m) {
"Function to clear picked points")
.def("add_picked_points",
&VisualizerWithVertexSelection::AddPickedPoints,
"Function to add picked points")
"Function to add picked points", "indices"_a)
.def("remove_picked_points",
&VisualizerWithVertexSelection::RemovePickedPoints,
"Function to remove picked points")
"Function to remove picked points", "indices"_a)
.def("register_selection_changed_callback",
&VisualizerWithVertexSelection::
RegisterSelectionChangedCallback,
"Registers a function to be called when selection changes")
"Registers a function to be called when selection changes",
"f"_a)
.def("register_selection_moving_callback",
&VisualizerWithVertexSelection::
RegisterSelectionMovingCallback,
"Registers a function to be called while selection moves. "
"Geometry's vertex values can be changed, but do not change"
"the number of vertices.")
"the number of vertices.",
"f"_a)
.def("register_selection_moved_callback",
&VisualizerWithVertexSelection::RegisterSelectionMovedCallback,
"Registers a function to be called after selection moves");
"Registers a function to be called after selection moves",
"f"_a);

py::class_<VisualizerWithVertexSelection::PickedPoint>
visualizer_vselect_pickedpoint(m, "PickedPoint");
Expand Down

0 comments on commit 5c2523a

Please sign in to comment.