From 0387f4bf52b08066584ed48cd669e4d69a00490a Mon Sep 17 00:00:00 2001 From: Jose Luis Blanco-Claraco Date: Mon, 2 Dec 2024 13:31:03 +0100 Subject: [PATCH] Update python wrapper --- python/src/mrpt/gui/CDisplayWindow3D_1.cpp | 4 ++++ python/src/mrpt/gui/CGlCanvasBase.cpp | 4 ++-- python/src/mrpt/opengl/CCamera.cpp | 4 +++- python/src/mrpt/opengl/DefaultShaders.cpp | 1 + python/src/mrpt/opengl/Texture.cpp | 5 +++-- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/python/src/mrpt/gui/CDisplayWindow3D_1.cpp b/python/src/mrpt/gui/CDisplayWindow3D_1.cpp index 22884721c2..4cbf4a3353 100644 --- a/python/src/mrpt/gui/CDisplayWindow3D_1.cpp +++ b/python/src/mrpt/gui/CDisplayWindow3D_1.cpp @@ -258,6 +258,8 @@ void bind_mrpt_gui_CDisplayWindow3D_1(std::function< pybind11::module &(std::str cl.def("updateRotate", (void (mrpt::gui::CGlCanvasBase::*)(struct mrpt::gui::CGlCanvasBase::CamaraParams &, int, int) const) &mrpt::gui::CGlCanvasBase::updateRotate, "This function for the mouse event\n It gets a reference to CamaraParams, x, y\n and updates the elevation and azimuth.\n See also getElevationDegrees(), getAzimuthDegrees()\n\nC++: mrpt::gui::CGlCanvasBase::updateRotate(struct mrpt::gui::CGlCanvasBase::CamaraParams &, int, int) const --> void", pybind11::arg("params"), pybind11::arg("x"), pybind11::arg("y")); cl.def("updateOrbitCamera", (void (mrpt::gui::CGlCanvasBase::*)(struct mrpt::gui::CGlCanvasBase::CamaraParams &, int, int) const) &mrpt::gui::CGlCanvasBase::updateOrbitCamera, "This function for the mouse event\n It gets a reference to CamaraParams, x, y\n and updates the elevation and azimuth.\n See also getElevationDegrees(), getAzimuthDegrees()\n\nC++: mrpt::gui::CGlCanvasBase::updateOrbitCamera(struct mrpt::gui::CGlCanvasBase::CamaraParams &, int, int) const --> void", pybind11::arg("params"), pybind11::arg("x"), pybind11::arg("y")); cl.def("updatePan", (void (mrpt::gui::CGlCanvasBase::*)(struct mrpt::gui::CGlCanvasBase::CamaraParams &, int, int) const) &mrpt::gui::CGlCanvasBase::updatePan, "This function for the mouse event\n It gets a reference to CamaraParams, x, y\n and updates the pointing of the camera.\n See also getCameraPointingX(), getCameraPointingY(),\n getCameraPointingZ()\n\nC++: mrpt::gui::CGlCanvasBase::updatePan(struct mrpt::gui::CGlCanvasBase::CamaraParams &, int, int) const --> void", pybind11::arg("params"), pybind11::arg("x"), pybind11::arg("y")); + cl.def("updateRoll", [](mrpt::gui::CGlCanvasBase const &o, struct mrpt::gui::CGlCanvasBase::CamaraParams & a0, int const & a1, int const & a2) -> void { return o.updateRoll(a0, a1, a2); }, "", pybind11::arg("params"), pybind11::arg("x"), pybind11::arg("y")); + cl.def("updateRoll", (void (mrpt::gui::CGlCanvasBase::*)(struct mrpt::gui::CGlCanvasBase::CamaraParams &, int, int, float) const) &mrpt::gui::CGlCanvasBase::updateRoll, "Updates the camera \"roll\" \n New in MRPT 2.14.6 \n\nC++: mrpt::gui::CGlCanvasBase::updateRoll(struct mrpt::gui::CGlCanvasBase::CamaraParams &, int, int, float) const --> void", pybind11::arg("params"), pybind11::arg("x"), pybind11::arg("y"), pybind11::arg("scale")); cl.def("cameraParams", (struct mrpt::gui::CGlCanvasBase::CamaraParams (mrpt::gui::CGlCanvasBase::*)() const) &mrpt::gui::CGlCanvasBase::cameraParams, "Returns a copy of CamaraParams\n See also getRefCameraParams(), setCameraParams(const CamaraParams &)\n\nC++: mrpt::gui::CGlCanvasBase::cameraParams() const --> struct mrpt::gui::CGlCanvasBase::CamaraParams"); cl.def("getRefCameraParams", (const struct mrpt::gui::CGlCanvasBase::CamaraParams & (mrpt::gui::CGlCanvasBase::*)() const) &mrpt::gui::CGlCanvasBase::getRefCameraParams, "Returns a reference to CamaraParams\n See also cameraParams(), setCameraParams(const CamaraParams &) \n\nC++: mrpt::gui::CGlCanvasBase::getRefCameraParams() const --> const struct mrpt::gui::CGlCanvasBase::CamaraParams &", pybind11::return_value_policy::automatic); cl.def("setCameraParams", (void (mrpt::gui::CGlCanvasBase::*)(const struct mrpt::gui::CGlCanvasBase::CamaraParams &)) &mrpt::gui::CGlCanvasBase::setCameraParams, "Sets the CamaraParams\n See also cameraParams(), getRefCameraParams()\n\nC++: mrpt::gui::CGlCanvasBase::setCameraParams(const struct mrpt::gui::CGlCanvasBase::CamaraParams &) --> void", pybind11::arg("params")); @@ -272,6 +274,7 @@ void bind_mrpt_gui_CDisplayWindow3D_1(std::function< pybind11::module &(std::str cl.def("getZoomDistance", (float (mrpt::gui::CGlCanvasBase::*)() const) &mrpt::gui::CGlCanvasBase::getZoomDistance, "Returns a zoom\n See also setZoomDistance(float)\n\nC++: mrpt::gui::CGlCanvasBase::getZoomDistance() const --> float"); cl.def("setAzimuthDegrees", (void (mrpt::gui::CGlCanvasBase::*)(float)) &mrpt::gui::CGlCanvasBase::setAzimuthDegrees, "Saves the degrees of the azimuth camera\n See also getAzimuthDegrees()\n\nC++: mrpt::gui::CGlCanvasBase::setAzimuthDegrees(float) --> void", pybind11::arg("ang")); cl.def("getAzimuthDegrees", (float (mrpt::gui::CGlCanvasBase::*)() const) &mrpt::gui::CGlCanvasBase::getAzimuthDegrees, "Returns a azimuth degrees\n See also setAzimuthDegrees(float)\n\nC++: mrpt::gui::CGlCanvasBase::getAzimuthDegrees() const --> float"); + cl.def("getRollDegrees", (float (mrpt::gui::CGlCanvasBase::*)() const) &mrpt::gui::CGlCanvasBase::getRollDegrees, "C++: mrpt::gui::CGlCanvasBase::getRollDegrees() const --> float"); cl.def("setElevationDegrees", (void (mrpt::gui::CGlCanvasBase::*)(float)) &mrpt::gui::CGlCanvasBase::setElevationDegrees, "Saves the degrees of the elevation camera\n See also getElevationDegrees()\n\nC++: mrpt::gui::CGlCanvasBase::setElevationDegrees(float) --> void", pybind11::arg("ang")); cl.def("getElevationDegrees", (float (mrpt::gui::CGlCanvasBase::*)() const) &mrpt::gui::CGlCanvasBase::getElevationDegrees, "Returns a elevation degrees\n See also setElevationDegrees(float)\n\nC++: mrpt::gui::CGlCanvasBase::getElevationDegrees() const --> float"); cl.def("setCameraProjective", (void (mrpt::gui::CGlCanvasBase::*)(bool)) &mrpt::gui::CGlCanvasBase::setCameraProjective, "C++: mrpt::gui::CGlCanvasBase::setCameraProjective(bool) --> void", pybind11::arg("is")); @@ -297,6 +300,7 @@ void bind_mrpt_gui_CDisplayWindow3D_1(std::function< pybind11::module &(std::str cl.def_readwrite("cameraAzimuthDeg", &mrpt::gui::CGlCanvasBase::CamaraParams::cameraAzimuthDeg); cl.def_readwrite("cameraIsProjective", &mrpt::gui::CGlCanvasBase::CamaraParams::cameraIsProjective); cl.def_readwrite("cameraFOV", &mrpt::gui::CGlCanvasBase::CamaraParams::cameraFOV); + cl.def_readwrite("cameraRollDeg", &mrpt::gui::CGlCanvasBase::CamaraParams::cameraRollDeg); cl.def("setElevationDeg", (void (mrpt::gui::CGlCanvasBase::CamaraParams::*)(float)) &mrpt::gui::CGlCanvasBase::CamaraParams::setElevationDeg, "Changes elevation, taking care of not going out of the [-90,90]\n range \n\nC++: mrpt::gui::CGlCanvasBase::CamaraParams::setElevationDeg(float) --> void", pybind11::arg("deg")); cl.def_static("FromCamera", (struct mrpt::gui::CGlCanvasBase::CamaraParams (*)(const class mrpt::opengl::CCamera &)) &mrpt::gui::CGlCanvasBase::CamaraParams::FromCamera, "Converts from a CCamera objects \n [New in MRPT 2.1.5] \n\nC++: mrpt::gui::CGlCanvasBase::CamaraParams::FromCamera(const class mrpt::opengl::CCamera &) --> struct mrpt::gui::CGlCanvasBase::CamaraParams", pybind11::arg("c")); cl.def("assign", (struct mrpt::gui::CGlCanvasBase::CamaraParams & (mrpt::gui::CGlCanvasBase::CamaraParams::*)(const struct mrpt::gui::CGlCanvasBase::CamaraParams &)) &mrpt::gui::CGlCanvasBase::CamaraParams::operator=, "C++: mrpt::gui::CGlCanvasBase::CamaraParams::operator=(const struct mrpt::gui::CGlCanvasBase::CamaraParams &) --> struct mrpt::gui::CGlCanvasBase::CamaraParams &", pybind11::return_value_policy::automatic, pybind11::arg("")); diff --git a/python/src/mrpt/gui/CGlCanvasBase.cpp b/python/src/mrpt/gui/CGlCanvasBase.cpp index cb93467308..baf7d25352 100644 --- a/python/src/mrpt/gui/CGlCanvasBase.cpp +++ b/python/src/mrpt/gui/CGlCanvasBase.cpp @@ -28,7 +28,7 @@ PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif -// mrpt::gui::CGlCanvasBaseHeadless file:mrpt/gui/CGlCanvasBase.h line:250 +// mrpt::gui::CGlCanvasBaseHeadless file:mrpt/gui/CGlCanvasBase.h line:261 struct PyCallBack_mrpt_gui_CGlCanvasBaseHeadless : public mrpt::gui::CGlCanvasBaseHeadless { using mrpt::gui::CGlCanvasBaseHeadless::CGlCanvasBaseHeadless; @@ -205,7 +205,7 @@ struct PyCallBack_mrpt_gui_CGlCanvasBaseHeadless : public mrpt::gui::CGlCanvasBa void bind_mrpt_gui_CGlCanvasBase(std::function< pybind11::module &(std::string const &namespace_) > &M) { - { // mrpt::gui::CGlCanvasBaseHeadless file:mrpt/gui/CGlCanvasBase.h line:250 + { // mrpt::gui::CGlCanvasBaseHeadless file:mrpt/gui/CGlCanvasBase.h line:261 pybind11::class_, PyCallBack_mrpt_gui_CGlCanvasBaseHeadless, mrpt::gui::CGlCanvasBase> cl(M("mrpt::gui"), "CGlCanvasBaseHeadless", "A headless dummy implementation of CGlCanvasBase: can be used to keep track\n of user UI mouse events and update the camera parameters, with actual\n rendering being delegated to someone else. \n\n\n "); cl.def( pybind11::init( [](){ return new mrpt::gui::CGlCanvasBaseHeadless(); }, [](){ return new PyCallBack_mrpt_gui_CGlCanvasBaseHeadless(); } ) ); cl.def( pybind11::init( [](PyCallBack_mrpt_gui_CGlCanvasBaseHeadless const &o){ return new PyCallBack_mrpt_gui_CGlCanvasBaseHeadless(o); } ) ); diff --git a/python/src/mrpt/opengl/CCamera.cpp b/python/src/mrpt/opengl/CCamera.cpp index bcd58e3492..eb6da281d1 100644 --- a/python/src/mrpt/opengl/CCamera.cpp +++ b/python/src/mrpt/opengl/CCamera.cpp @@ -307,12 +307,14 @@ void bind_mrpt_opengl_CCamera(std::function< pybind11::module &(std::string cons cl.def("getPointingAtY", (float (mrpt::opengl::CCamera::*)() const) &mrpt::opengl::CCamera::getPointingAtY, "C++: mrpt::opengl::CCamera::getPointingAtY() const --> float"); cl.def("getPointingAtZ", (float (mrpt::opengl::CCamera::*)() const) &mrpt::opengl::CCamera::getPointingAtZ, "C++: mrpt::opengl::CCamera::getPointingAtZ() const --> float"); cl.def("getPointingAt", (struct mrpt::math::TPoint3D_ (mrpt::opengl::CCamera::*)() const) &mrpt::opengl::CCamera::getPointingAt, "C++: mrpt::opengl::CCamera::getPointingAt() const --> struct mrpt::math::TPoint3D_"); - cl.def("setZoomDistance", (void (mrpt::opengl::CCamera::*)(float)) &mrpt::opengl::CCamera::setZoomDistance, "C++: mrpt::opengl::CCamera::setZoomDistance(float) --> void", pybind11::arg("z")); cl.def("getZoomDistance", (float (mrpt::opengl::CCamera::*)() const) &mrpt::opengl::CCamera::getZoomDistance, "C++: mrpt::opengl::CCamera::getZoomDistance() const --> float"); cl.def("getAzimuthDegrees", (float (mrpt::opengl::CCamera::*)() const) &mrpt::opengl::CCamera::getAzimuthDegrees, "C++: mrpt::opengl::CCamera::getAzimuthDegrees() const --> float"); cl.def("getElevationDegrees", (float (mrpt::opengl::CCamera::*)() const) &mrpt::opengl::CCamera::getElevationDegrees, "C++: mrpt::opengl::CCamera::getElevationDegrees() const --> float"); + cl.def("getRollDegrees", (float (mrpt::opengl::CCamera::*)() const) &mrpt::opengl::CCamera::getRollDegrees, "C++: mrpt::opengl::CCamera::getRollDegrees() const --> float"); + cl.def("setZoomDistance", (void (mrpt::opengl::CCamera::*)(float)) &mrpt::opengl::CCamera::setZoomDistance, "C++: mrpt::opengl::CCamera::setZoomDistance(float) --> void", pybind11::arg("z")); cl.def("setAzimuthDegrees", (void (mrpt::opengl::CCamera::*)(float)) &mrpt::opengl::CCamera::setAzimuthDegrees, "C++: mrpt::opengl::CCamera::setAzimuthDegrees(float) --> void", pybind11::arg("ang")); cl.def("setElevationDegrees", (void (mrpt::opengl::CCamera::*)(float)) &mrpt::opengl::CCamera::setElevationDegrees, "C++: mrpt::opengl::CCamera::setElevationDegrees(float) --> void", pybind11::arg("ang")); + cl.def("setRollDegrees", (void (mrpt::opengl::CCamera::*)(float)) &mrpt::opengl::CCamera::setRollDegrees, "C++: mrpt::opengl::CCamera::setRollDegrees(float) --> void", pybind11::arg("ang")); cl.def("set6DOFMode", (void (mrpt::opengl::CCamera::*)(bool)) &mrpt::opengl::CCamera::set6DOFMode, "Set 6DOFMode, if enabled camera is set according to its pose, set via\nCRenderizable::setPose(). (default=false).\n Conventionally, eye is set looking towards +Z axis, \"down\" is the +Y\n axis, right is \"+X\" axis. In this mode azimuth/elevation are ignored.\n\nC++: mrpt::opengl::CCamera::set6DOFMode(bool) --> void", pybind11::arg("v")); cl.def("is6DOFMode", (bool (mrpt::opengl::CCamera::*)() const) &mrpt::opengl::CCamera::is6DOFMode, "C++: mrpt::opengl::CCamera::is6DOFMode() const --> bool"); cl.def("renderUpdateBuffers", (void (mrpt::opengl::CCamera::*)() const) &mrpt::opengl::CCamera::renderUpdateBuffers, "Render does nothing here. \n\nC++: mrpt::opengl::CCamera::renderUpdateBuffers() const --> void"); diff --git a/python/src/mrpt/opengl/DefaultShaders.cpp b/python/src/mrpt/opengl/DefaultShaders.cpp index 1ed2b7dcfd..17945fd3b2 100644 --- a/python/src/mrpt/opengl/DefaultShaders.cpp +++ b/python/src/mrpt/opengl/DefaultShaders.cpp @@ -86,6 +86,7 @@ void bind_mrpt_opengl_DefaultShaders(std::function< pybind11::module &(std::stri cl.def_readwrite("FOV", &mrpt::opengl::TRenderMatrices::FOV); cl.def_readwrite("azimuth", &mrpt::opengl::TRenderMatrices::azimuth); cl.def_readwrite("elev", &mrpt::opengl::TRenderMatrices::elev); + cl.def_readwrite("roll", &mrpt::opengl::TRenderMatrices::roll); cl.def_readwrite("eyeDistance", &mrpt::opengl::TRenderMatrices::eyeDistance); cl.def_readwrite("viewport_width", &mrpt::opengl::TRenderMatrices::viewport_width); cl.def_readwrite("viewport_height", &mrpt::opengl::TRenderMatrices::viewport_height); diff --git a/python/src/mrpt/opengl/Texture.cpp b/python/src/mrpt/opengl/Texture.cpp index d9281aa075..30c928d663 100644 --- a/python/src/mrpt/opengl/Texture.cpp +++ b/python/src/mrpt/opengl/Texture.cpp @@ -82,13 +82,14 @@ void bind_mrpt_opengl_Texture(std::function< pybind11::module &(std::string cons cl.def_readwrite("enableTransparency", &mrpt::opengl::Texture::Options::enableTransparency); cl.def_readwrite("wrappingModeS", &mrpt::opengl::Texture::Options::wrappingModeS); cl.def_readwrite("wrappingModeT", &mrpt::opengl::Texture::Options::wrappingModeT); + cl.def_readwrite("autoScale16to8bitConversion", &mrpt::opengl::Texture::Options::autoScale16to8bitConversion); } } - // mrpt::opengl::getNewTextureNumber() file:mrpt/opengl/Texture.h line:132 + // mrpt::opengl::getNewTextureNumber() file:mrpt/opengl/Texture.h line:137 M("mrpt::opengl").def("getNewTextureNumber", (unsigned int (*)()) &mrpt::opengl::getNewTextureNumber, "C++: mrpt::opengl::getNewTextureNumber() --> unsigned int"); - // mrpt::opengl::releaseTextureName(const unsigned int &) file:mrpt/opengl/Texture.h line:133 + // mrpt::opengl::releaseTextureName(const unsigned int &) file:mrpt/opengl/Texture.h line:138 M("mrpt::opengl").def("releaseTextureName", (void (*)(const unsigned int &)) &mrpt::opengl::releaseTextureName, "C++: mrpt::opengl::releaseTextureName(const unsigned int &) --> void", pybind11::arg("t")); { // mrpt::opengl::CRenderizableShaderTexturedTriangles file:mrpt/opengl/CRenderizableShaderTexturedTriangles.h line:28