@@ -52,64 +52,6 @@ Py_points_in_path(py::array_t<double> points_obj, double r, mpl::PathIterator pa
5252 return results;
5353}
5454
55- static py::tuple
56- Py_update_path_extents (mpl::PathIterator path, agg::trans_affine trans,
57- agg::rect_d rect, py::array_t <double > minpos, bool ignore)
58- {
59- bool changed;
60-
61- if (minpos.ndim () != 1 ) {
62- throw py::value_error (
63- " minpos must be 1D, got " + std::to_string (minpos.ndim ()));
64- }
65- if (minpos.shape (0 ) != 2 ) {
66- throw py::value_error (
67- " minpos must be of length 2, got " + std::to_string (minpos.shape (0 )));
68- }
69-
70- extent_limits e;
71-
72- if (ignore) {
73- reset_limits (e);
74- } else {
75- if (rect.x1 > rect.x2 ) {
76- e.x0 = std::numeric_limits<double >::infinity ();
77- e.x1 = -std::numeric_limits<double >::infinity ();
78- } else {
79- e.x0 = rect.x1 ;
80- e.x1 = rect.x2 ;
81- }
82- if (rect.y1 > rect.y2 ) {
83- e.y0 = std::numeric_limits<double >::infinity ();
84- e.y1 = -std::numeric_limits<double >::infinity ();
85- } else {
86- e.y0 = rect.y1 ;
87- e.y1 = rect.y2 ;
88- }
89- e.xm = *minpos.data (0 );
90- e.ym = *minpos.data (1 );
91- }
92-
93- update_path_extents (path, trans, e);
94-
95- changed = (e.x0 != rect.x1 || e.y0 != rect.y1 || e.x1 != rect.x2 || e.y1 != rect.y2 ||
96- e.xm != *minpos.data (0 ) || e.ym != *minpos.data (1 ));
97-
98- py::ssize_t extentsdims[] = { 2 , 2 };
99- py::array_t <double > outextents (extentsdims);
100- *outextents.mutable_data (0 , 0 ) = e.x0 ;
101- *outextents.mutable_data (0 , 1 ) = e.y0 ;
102- *outextents.mutable_data (1 , 0 ) = e.x1 ;
103- *outextents.mutable_data (1 , 1 ) = e.y1 ;
104-
105- py::ssize_t minposdims[] = { 2 };
106- py::array_t <double > outminpos (minposdims);
107- *outminpos.mutable_data (0 ) = e.xm ;
108- *outminpos.mutable_data (1 ) = e.ym ;
109-
110- return py::make_tuple (outextents, outminpos, changed);
111- }
112-
11355static py::tuple
11456Py_get_path_collection_extents (agg::trans_affine master_transform,
11557 mpl::PathGenerator paths,
@@ -374,8 +316,6 @@ PYBIND11_MODULE(_path, m, py::mod_gil_not_used())
374316 " x" _a, " y" _a, " radius" _a, " path" _a, " trans" _a);
375317 m.def (" points_in_path" , &Py_points_in_path,
376318 " points" _a, " radius" _a, " path" _a, " trans" _a);
377- m.def (" update_path_extents" , &Py_update_path_extents,
378- " path" _a, " trans" _a, " rect" _a, " minpos" _a, " ignore" _a);
379319 m.def (" get_path_collection_extents" , &Py_get_path_collection_extents,
380320 " master_transform" _a, " paths" _a, " transforms" _a, " offsets" _a,
381321 " offset_transform" _a);
0 commit comments