(self)
| 1158 | __str__ = _make_str_method("_bbox", "_transform") |
| 1159 | |
| 1160 | def get_points(self): |
| 1161 | # docstring inherited |
| 1162 | if self._invalid: |
| 1163 | p = self._bbox.get_points() |
| 1164 | # Transform all four points, then make a new bounding box |
| 1165 | # from the result, taking care to make the orientation the |
| 1166 | # same. |
| 1167 | points = self._transform.transform( |
| 1168 | [[p[0, 0], p[0, 1]], |
| 1169 | [p[1, 0], p[0, 1]], |
| 1170 | [p[0, 0], p[1, 1]], |
| 1171 | [p[1, 0], p[1, 1]]]) |
| 1172 | points = np.ma.filled(points, 0.0) |
| 1173 | |
| 1174 | xs = min(points[:, 0]), max(points[:, 0]) |
| 1175 | if p[0, 0] > p[1, 0]: |
| 1176 | xs = xs[::-1] |
| 1177 | |
| 1178 | ys = min(points[:, 1]), max(points[:, 1]) |
| 1179 | if p[0, 1] > p[1, 1]: |
| 1180 | ys = ys[::-1] |
| 1181 | |
| 1182 | self._points = np.array([ |
| 1183 | [xs[0], ys[0]], |
| 1184 | [xs[1], ys[1]] |
| 1185 | ]) |
| 1186 | |
| 1187 | self._invalid = 0 |
| 1188 | return self._points |
| 1189 | |
| 1190 | if DEBUG: |
| 1191 | _get_points = get_points |
nothing calls this directly
no test coverage detected