cesium-native  0.41.0
CesiumGeospatial::CartographicPolygon Class Referencefinal

A 2D polygon expressed as a list of longitude/latitude coordinates in radians. More...

#include <CesiumGeospatial/CartographicPolygon.h>

Public Member Functions

 CartographicPolygon (const std::vector< glm::dvec2 > &polygon)
 Constructs a 2D polygon that can be rasterized onto Tileset objects. More...
 
constexpr const std::vector< glm::dvec2 > & getVertices () const
 Returns the longitude-latitude vertices that define the perimeter of the selected polygon. More...
 
constexpr const std::vector< uint32_t > & getIndices () const
 Returns the triangulated indices representing a triangle decomposition of the polygon. The indices are in reference to the polygon's perimeter vertices. More...
 
constexpr const std::optional< CesiumGeospatial::GlobeRectangle > & getBoundingRectangle () const
 Returns a GlobeRectangle that represents the bounding rectangle of the polygon. More...
 

Static Public Member Functions

static bool rectangleIsWithinPolygons (const CesiumGeospatial::GlobeRectangle &rectangle, const std::vector< CesiumGeospatial::CartographicPolygon > &cartographicPolygons) noexcept
 Determines whether a globe rectangle is completely inside any of the polygons in a list. More...
 
static bool rectangleIsOutsidePolygons (const CesiumGeospatial::GlobeRectangle &rectangle, const std::vector< CesiumGeospatial::CartographicPolygon > &cartographicPolygons) noexcept
 Determines whether a globe rectangle is completely outside all the polygons in a list. More...
 

Detailed Description

A 2D polygon expressed as a list of longitude/latitude coordinates in radians.

The Ellipsoid associated with the coordinates is not specified directly by this instance, but it is assumed that the longitude values range from -PI to PI radians and the latitude values range from -PI/2 to PI/2 radians. Longitude values outside this range are wrapped to be inside the range. Latitude values are clamped to the range.

Definition at line 24 of file CartographicPolygon.h.

Constructor & Destructor Documentation

◆ CartographicPolygon()

CesiumGeospatial::CartographicPolygon::CartographicPolygon ( const std::vector< glm::dvec2 > &  polygon)

Constructs a 2D polygon that can be rasterized onto Tileset objects.

Parameters
polygonAn array of longitude-latitude points in radians defining the perimeter of the 2D polygon.

Member Function Documentation

◆ getBoundingRectangle()

constexpr const std::optional<CesiumGeospatial::GlobeRectangle>& CesiumGeospatial::CartographicPolygon::getBoundingRectangle ( ) const
inlineconstexpr

Returns a GlobeRectangle that represents the bounding rectangle of the polygon.

Returns
The polygon's global bounding rectangle.

Definition at line 63 of file CartographicPolygon.h.

◆ getIndices()

constexpr const std::vector<uint32_t>& CesiumGeospatial::CartographicPolygon::getIndices ( ) const
inlineconstexpr

Returns the triangulated indices representing a triangle decomposition of the polygon. The indices are in reference to the polygon's perimeter vertices.

Returns
The indices for the polygon's triangle decomposition.

Definition at line 52 of file CartographicPolygon.h.

◆ getVertices()

constexpr const std::vector<glm::dvec2>& CesiumGeospatial::CartographicPolygon::getVertices ( ) const
inlineconstexpr

Returns the longitude-latitude vertices that define the perimeter of the selected polygon.

Returns
The perimeter vertices in longitude-latitude radians.

Definition at line 41 of file CartographicPolygon.h.

◆ rectangleIsOutsidePolygons()

static bool CesiumGeospatial::CartographicPolygon::rectangleIsOutsidePolygons ( const CesiumGeospatial::GlobeRectangle rectangle,
const std::vector< CesiumGeospatial::CartographicPolygon > &  cartographicPolygons 
)
staticnoexcept

Determines whether a globe rectangle is completely outside all the polygons in a list.

Parameters
rectangleThe CesiumGeospatial::GlobeRectangle of the tile.
cartographicPolygonsThe list of polygons to check.
Returns
True if the rectangle is completely outside all the polygons; otherwise, false.

◆ rectangleIsWithinPolygons()

static bool CesiumGeospatial::CartographicPolygon::rectangleIsWithinPolygons ( const CesiumGeospatial::GlobeRectangle rectangle,
const std::vector< CesiumGeospatial::CartographicPolygon > &  cartographicPolygons 
)
staticnoexcept

Determines whether a globe rectangle is completely inside any of the polygons in a list.

Parameters
rectangleThe CesiumGeospatial::GlobeRectangle of the tile.
cartographicPolygonsThe list of polygons to check.
Returns
True if the rectangle is completely inside a polygon; otherwise, false.

The documentation for this class was generated from the following file: