From ad32a40dfb412325a41b718335e324b47747c80a Mon Sep 17 00:00:00 2001 From: B1ueber2y Date: Tue, 26 Nov 2024 20:45:31 +0100 Subject: [PATCH] fix copy constructor for other classes --- limap/base/bindings.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/limap/base/bindings.cc b/limap/base/bindings.cc index aaa0848..55a1b0e 100644 --- a/limap/base/bindings.cc +++ b/limap/base/bindings.cc @@ -829,6 +829,9 @@ void bind_camera(py::module &m) { Constructor from a Python dict )", py::arg("dict")) + .def("__copy__", [](const CameraPose &self) { return CameraPose(self); }) + .def("__deepcopy__", [](const CameraPose &self, + const py::dict &) { return CameraPose(self); }) .def(py::pickle( [](const CameraPose &input) { // dump return input.as_dict(); @@ -884,6 +887,10 @@ void bind_camera(py::module &m) { py::arg("camera"), py::arg("pose"), py::arg("image_name") = "none") .def(py::init(), py::arg("dict")) .def(py::init(), py::arg("camimage")) + .def("__copy__", + [](const CameraImage &self) { return CameraImage(self); }) + .def("__deepcopy__", [](const CameraImage &self, + const py::dict &) { return CameraImage(self); }) .def(py::pickle( [](const CameraImage &input) { // dump return input.as_dict(); @@ -938,6 +945,9 @@ void bind_camera(py::module &m) { py::arg("camera"), py::arg("pose"), py::arg("image_name") = "none") .def(py::init(), py::arg("dict")) .def(py::init(), py::arg("camview")) + .def("__copy__", [](const CameraView &self) { return CameraView(self); }) + .def("__deepcopy__", [](const CameraView &self, + const py::dict &) { return CameraView(self); }) .def(py::pickle( [](const CameraView &input) { // dump return input.as_dict();