feat(tdcgal/plane/plane.cpp): class Bbox_2
BREAKING CHANGE:
This commit is contained in:
parent
c703017487
commit
477658c5aa
|
|
@ -262,6 +262,21 @@ void init_plane(py::module_ &m) {
|
||||||
.def("area", &Iso_rectangle_2::area, "返回矩形的面积")
|
.def("area", &Iso_rectangle_2::area, "返回矩形的面积")
|
||||||
.def("transform", &Iso_rectangle_2::transform, "返回经过变换后的矩形");
|
.def("transform", &Iso_rectangle_2::transform, "返回经过变换后的矩形");
|
||||||
|
|
||||||
|
py::class_<Bbox_2>(m, "Bbox_2")
|
||||||
|
.def(py::init<>())
|
||||||
|
.def(py::init<double, double, double, double>())
|
||||||
|
.def(py::self == py::self)
|
||||||
|
.def(py::self != py::self)
|
||||||
|
.def("dimension", &Bbox_2::dimension, "返回边界框的维数")
|
||||||
|
.def("xmin", &Bbox_2::xmin, "返回左下角顶点的x坐标")
|
||||||
|
.def("ymin", &Bbox_2::ymin, "返回左下角顶点的y坐标")
|
||||||
|
.def("xmax", &Bbox_2::xmax, "返回右上角顶点的x坐标")
|
||||||
|
.def("ymax", &Bbox_2::ymax, "返回右上角顶点的y坐标")
|
||||||
|
.def("min", &Bbox_2::min, "参数`i`, 如果`i=0`返回`xmin()`, 如果`i=1`返回`ymin()`")
|
||||||
|
.def("max", &Bbox_2::max, "参数`i`, 如果`i=0`返回`xmax()`, 如果`i=1`返回`ymax()`")
|
||||||
|
.def(py::self + py::self)
|
||||||
|
.def(py::self += py::self)
|
||||||
|
.def("dilate", &Bbox_2::dilate, "扩大边界框");
|
||||||
|
|
||||||
m.def("squared_distance", &squared_distance<Point_2, Point_2>,
|
m.def("squared_distance", &squared_distance<Point_2, Point_2>,
|
||||||
"返回两个点的平方距离");
|
"返回两个点的平方距离");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue