| 387 | } |
| 388 | |
| 389 | Rect Polygon::getBoundingBox() const |
| 390 | { |
| 391 | auto [minX, maxX] = std::minmax_element(m_points.begin(), m_points.end(), |
| 392 | [](auto& point1, auto& point2) { return point1->x < point2->x; }); |
| 393 | auto [minY, maxY] = std::minmax_element(m_points.begin(), m_points.end(), |
| 394 | [](auto& point1, auto& point2) { return point1->y < point2->y; }); |
| 395 | const double width = maxX->get()->x - minX->get()->x; |
| 396 | const double height = maxY->get()->y - minY->get()->y; |
| 397 | return Rect(Transform::UnitVector(minX->get()->x, minY->get()->y), |
| 398 | Transform::UnitVector(width, height)); |
| 399 | } |
| 400 | } // namespace obe::Transform |
nothing calls this directly
no test coverage detected