22 #include "pybind11/pybind11.h"
23 #include "pybind11/stl.h"
34 using namespace py::literals;
38 namespace cameraGeom {
41 using PyTransformMap = py::class_<TransformMap, std::shared_ptr<TransformMap>>;
42 using PyTransformMapConnection = py::class_<TransformMap::Connection,
46 PyTransformMap
cls(mod,
"TransformMap");
48 PyTransformMapConnection clsConnection(
cls,
"Connection");
50 CameraSys
const &, CameraSys
const &>(),
51 "transform"_a,
"fromSys"_a,
"toSys"_a);
53 clsConnection.def_readwrite(
"fromSys", &TransformMap::Connection::fromSys);
54 clsConnection.def_readwrite(
"toSys", &TransformMap::Connection::toSys);
59 CameraSys
const &reference,
60 TransformMap::Transforms
const & transforms
63 return std::const_pointer_cast<TransformMap>(TransformMap::make(reference, transforms));
65 "reference"_a,
"transforms"_a
69 CameraSys
const &reference,
73 return std::const_pointer_cast<TransformMap>(TransformMap::make(reference, connections));
75 "reference"_a,
"connections"_a
77 cls.def(
"__len__", &TransformMap::size);
79 cls.def(
"__iter__", [](TransformMap
const &
self) {
return py::make_iterator(
self.
begin(),
self.
end()); },
80 py::keep_alive<0, 1>());
84 py::overload_cast<lsst::geom::Point2D const &, CameraSys const &, CameraSys const &>(
88 "point"_a,
"fromSys"_a,
"toSys"_a
96 "pointList"_a,
"fromSys"_a,
"toSys"_a
98 cls.def(
"getTransform", &TransformMap::getTransform,
"fromSys"_a,
"toSys"_a);
99 cls.def(
"getConnections", &TransformMap::getConnections);
106 declareTransformMap(mod);