From 5c2523a2588df4298bf36bc1295213c61a8af4c7 Mon Sep 17 00:00:00 2001 From: Daniel Keyes Date: Wed, 4 Oct 2023 13:42:33 -0500 Subject: [PATCH] add missing keyword argument names --- cpp/pybind/visualization/o3dvisualizer.cpp | 13 ++++++---- .../visualization/rendering/material.cpp | 4 ++-- cpp/pybind/visualization/visualizer.cpp | 24 ++++++++++++------- 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/cpp/pybind/visualization/o3dvisualizer.cpp b/cpp/pybind/visualization/o3dvisualizer.cpp index 404791d0e90..7bc65805aad 100644 --- a/cpp/pybind/visualization/o3dvisualizer.cpp +++ b/cpp/pybind/visualization/o3dvisualizer.cpp @@ -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.") @@ -143,17 +144,19 @@ void pybind_o3dvisualizer(py::module& m) { [](O3DVisualizer& w, UnownedPointer dlg) { w.ShowDialog(TakeOwnership(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 " @@ -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) { diff --git a/cpp/pybind/visualization/rendering/material.cpp b/cpp/pybind/visualization/rendering/material.cpp index 5d1468e0ac3..82225c9c90a 100644 --- a/cpp/pybind/visualization/rendering/material.cpp +++ b/cpp/pybind/visualization/rendering/material.cpp @@ -39,8 +39,8 @@ void pybind_material(py::module& m) { "such as TriangleMesh, LineSets, and PointClouds"); mat.def(py::init<>()) - .def(py::init()) - .def(py::init()) + .def(py::init(), "", "mat"_a) + .def(py::init(), "", "material_name"_a) .def("set_default_properties", &Material::SetDefaultProperties, "Fills material with defaults for common PBR material " "properties used by Open3D") diff --git a/cpp/pybind/visualization/visualizer.cpp b/cpp/pybind/visualization/visualizer.cpp index 7b76396c7c3..dba049503f9 100644 --- a/cpp/pybind/visualization/visualizer.cpp +++ b/cpp/pybind/visualization/visualizer.cpp @@ -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 " @@ -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, @@ -160,7 +161,9 @@ void pybind_visualizer(py::module &m) { "Visualizer with editing capabilities."); py::detail::bind_default_constructor( visualizer_edit); - visualizer_edit.def(py::init()) + visualizer_edit + .def(py::init(), "voxel_size"_a, + "use_dialog"_a, "directory"_a) .def("__repr__", [](const VisualizerWithEditing &vis) { return std::string("VisualizerWithEditing with name ") + @@ -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") @@ -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_ visualizer_vselect_pickedpoint(m, "PickedPoint");