cesium-native 0.43.0
Loading...
Searching...
No Matches
Projection.h
1#pragma once
2
3#include "BoundingRegion.h"
4#include "CesiumGeometry/AxisAlignedBox.h"
5#include "CesiumGeometry/Rectangle.h"
6#include "Ellipsoid.h"
7#include "GeographicProjection.h"
8#include "WebMercatorProjection.h"
9
10#include <glm/vec2.hpp>
11
12#include <variant>
13
14namespace CesiumGeospatial {
15
25typedef std::variant<GeographicProjection, WebMercatorProjection> Projection;
26
35glm::dvec3
36projectPosition(const Projection& projection, const Cartographic& position);
37
47unprojectPosition(const Projection& projection, const glm::dvec3& position);
48
62 const Projection& projection,
63 const GlobeRectangle& rectangle);
64
78 const Projection& projection,
79 const CesiumGeometry::Rectangle& rectangle);
80
94projectRegionSimple(const Projection& projection, const BoundingRegion& region);
95
110 const Projection& projection,
112 const CesiumGeospatial::Ellipsoid& ellipsoid CESIUM_DEFAULT_ELLIPSOID);
113
130 const Projection& projection,
131 const CesiumGeometry::Rectangle& rectangle,
132 double maxHeight,
133 const Ellipsoid& ellipsoid CESIUM_DEFAULT_ELLIPSOID);
134
139
140} // namespace CesiumGeospatial
A bounding volume specified as a longitude/latitude bounding box and a minimum and maximum height.
A position defined by longitude, latitude, and height.
A quadratic surface defined in Cartesian coordinates.
Definition Ellipsoid.h:38
A two-dimensional, rectangular region on a globe, specified using longitude and latitude coordinates....
Classes for geospatial computations in Cesium.
BoundingRegion unprojectRegionSimple(const Projection &projection, const CesiumGeometry::AxisAlignedBox &box, const CesiumGeospatial::Ellipsoid &ellipsoid=CesiumGeospatial::Ellipsoid::WGS84)
Unprojects a box to the globe by simply unprojecting its eight corners.
glm::dvec3 projectPosition(const Projection &projection, const Cartographic &position)
Projects a position on the globe using the given Projection.
CesiumGeometry::Rectangle projectRectangleSimple(const Projection &projection, const GlobeRectangle &rectangle)
Projects a rectangle on the globe by simply projecting its four corners.
Cartographic unprojectPosition(const Projection &projection, const glm::dvec3 &position)
Unprojects a position from the globe using the given Projection.
const Ellipsoid & getProjectionEllipsoid(const Projection &projection)
Obtains the ellipsoid used by a Projection variant.
glm::dvec2 computeProjectedRectangleSize(const Projection &projection, const CesiumGeometry::Rectangle &rectangle, double maxHeight, const Ellipsoid &ellipsoid=CesiumGeospatial::Ellipsoid::WGS84)
Computes the approximate real-world size, in meters, of a given projected rectangle.
CesiumGeometry::AxisAlignedBox projectRegionSimple(const Projection &projection, const BoundingRegion &region)
Projects a bounding region on the globe by simply projecting its eight corners.
std::variant< GeographicProjection, WebMercatorProjection > Projection
A projection.
Definition Projection.h:25
GlobeRectangle unprojectRectangleSimple(const Projection &projection, const CesiumGeometry::Rectangle &rectangle)
Unprojects a rectangle to the globe by simply unprojecting its four corners.
An Axis-Aligned Bounding Box (AABB), where the axes of the box are aligned with the axes of the coord...
A 2D rectangle.
Definition Rectangle.h:14