lsst.afw  14.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
cameraPoint.cc
Go to the documentation of this file.
1 /*
2  * LSST Data Management System
3  * See COPYRIGHT file at the top of the source tree.
4  *
5  * This product includes software developed by the
6  * LSST Project (http://www.lsst.org/).
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the LSST License Statement and
19  * the GNU General Public License along with this program. If not,
20  * see <https://www.lsstcorp.org/LegalNotices/>.
21  */
22 
23 #include <pybind11/pybind11.h>
24 //#include <pybind11/stl.h>
25 
27 
28 namespace py = pybind11;
29 using namespace py::literals;
30 
31 namespace lsst {
32 namespace afw {
33 namespace cameraGeom {
34 
35 PYBIND11_PLUGIN(_cameraPoint) {
36  py::module mod("_cameraPoint", "Python wrapper for afw _cameraPoint library");
37 
38  /* Module level */
39  py::class_<CameraPoint> cls(mod, "CameraPoint");
40 
41  /* Member types and enums */
42 
43  /* Constructors */
44  cls.def(py::init<geom::Point2D, CameraSys const &>(), "point"_a, "cameraSys"_a);
45 
46  /* Operators */
47  cls.def("__eq__", [](CameraPoint const &self, CameraPoint const &other) { return self == other; },
48  py::is_operator());
49  cls.def("__ne__", [](CameraPoint const &self, CameraPoint const &other) { return self != other; },
50  py::is_operator());
51  cls.def("__str__", [](CameraPoint const &self) {
52  std::ostringstream os;
53  os << self;
54  return os.str();
55  });
56  cls.def("__repr__", [](CameraPoint &self) {
57  std::ostringstream os;
58  os << self;
59  return os.str();
60  });
61 
62  /* Members */
63  cls.def("getPoint", &CameraPoint::getPoint);
64  cls.def("getCameraSys", &CameraPoint::getCameraSys);
65 
66  return mod.ptr();
67 }
68 }
69 }
70 }
PYBIND11_PLUGIN(_cameraPoint)
Definition: cameraPoint.cc:35
double const _a
Definition: RandomImage.cc:77
A Point2D with associated camera coordinate system.
Definition: CameraPoint.h:37