| 52 | } |
| 53 | |
| 54 | CesiumGeometry::Rectangle projectRectangleSimple( |
| 55 | const Projection& projection, |
| 56 | const GlobeRectangle& rectangle) { |
| 57 | struct Operation { |
| 58 | const GlobeRectangle& rectangle; |
| 59 | |
| 60 | CesiumGeometry::Rectangle |
| 61 | operator()(const GeographicProjection& geographic) noexcept { |
| 62 | return geographic.project(rectangle); |
| 63 | } |
| 64 | |
| 65 | CesiumGeometry::Rectangle |
| 66 | operator()(const WebMercatorProjection& webMercator) noexcept { |
| 67 | return webMercator.project(rectangle); |
| 68 | } |
| 69 | }; |
| 70 | |
| 71 | return std::visit(Operation{rectangle}, projection); |
| 72 | } |
| 73 | |
| 74 | GlobeRectangle unprojectRectangleSimple( |
| 75 | const Projection& projection, |
no outgoing calls