cesium-native 0.44.2
Loading...
Searching...
No Matches
BoundingRegion.h
1#pragma once
2
3#include <CesiumGeometry/CullingResult.h>
4#include <CesiumGeometry/OrientedBoundingBox.h>
5#include <CesiumGeospatial/Ellipsoid.h>
6#include <CesiumGeospatial/GlobeRectangle.h>
7#include <CesiumGeospatial/Library.h>
8
9namespace CesiumGeometry {
10class Plane;
11}
12
13namespace CesiumGeospatial {
14class Cartographic;
15
20class CESIUMGEOSPATIAL_API BoundingRegion final {
21public:
31 const GlobeRectangle& rectangle,
32 double minimumHeight,
33 double maximumHeight,
34 const Ellipsoid& ellipsoid CESIUM_DEFAULT_ELLIPSOID);
35
39 const GlobeRectangle& getRectangle() const noexcept {
40 return this->_rectangle;
41 }
42
46 double getMinimumHeight() const noexcept { return this->_minimumHeight; }
47
51 double getMaximumHeight() const noexcept { return this->_maximumHeight; }
52
57 return this->_boundingBox;
58 }
59
71 intersectPlane(const CesiumGeometry::Plane& plane) const noexcept;
72
89 const glm::dvec3& position,
90 const Ellipsoid& ellipsoid CESIUM_DEFAULT_ELLIPSOID) const noexcept;
91
102 const Cartographic& position,
103 const Ellipsoid& ellipsoid CESIUM_DEFAULT_ELLIPSOID) const noexcept;
104
118 const Cartographic& cartographicPosition,
119 const glm::dvec3& cartesianPosition) const noexcept;
120
129 const BoundingRegion& other,
130 const CesiumGeospatial::Ellipsoid& ellipsoid
131 CESIUM_DEFAULT_ELLIPSOID) const noexcept;
132
133private:
134 static CesiumGeometry::OrientedBoundingBox _computeBoundingBox(
135 const GlobeRectangle& rectangle,
136 double minimumHeight,
137 double maximumHeight,
138 const Ellipsoid& ellipsoid);
139
140 GlobeRectangle _rectangle;
141 double _minimumHeight;
142 double _maximumHeight;
144
145 glm::dvec3 _southwestCornerCartesian;
146 glm::dvec3 _northeastCornerCartesian;
147 glm::dvec3 _westNormal;
148 glm::dvec3 _eastNormal;
149 glm::dvec3 _southNormal;
150 glm::dvec3 _northNormal;
151 bool _planesAreInvalid;
152};
153
154} // namespace CesiumGeospatial
A bounding volume defined as a closed and convex cuboid with any orientation.
A plane in Hessian Normal Format.
Definition Plane.h:12
A bounding volume specified as a longitude/latitude bounding box and a minimum and maximum height.
BoundingRegion computeUnion(const BoundingRegion &other, const CesiumGeospatial::Ellipsoid &ellipsoid=CesiumGeospatial::Ellipsoid::WGS84) const noexcept
Computes the union of this bounding region with another.
CesiumGeometry::CullingResult intersectPlane(const CesiumGeometry::Plane &plane) const noexcept
Determines on which side of a plane the bounding region is located.
double computeDistanceSquaredToPosition(const Cartographic &position, const Ellipsoid &ellipsoid=CesiumGeospatial::Ellipsoid::WGS84) const noexcept
Computes the distance-squared from a longitude-latitude-height position to the closest point in this ...
double computeDistanceSquaredToPosition(const Cartographic &cartographicPosition, const glm::dvec3 &cartesianPosition) const noexcept
Computes the distance-squared from a position to the closest point in this bounding region,...
double getMaximumHeight() const noexcept
Gets the maximum height of the region.
BoundingRegion(const GlobeRectangle &rectangle, double minimumHeight, double maximumHeight, const Ellipsoid &ellipsoid=CesiumGeospatial::Ellipsoid::WGS84)
Constructs a new bounding region.
const GlobeRectangle & getRectangle() const noexcept
Gets the bounding rectangle of the region.
double computeDistanceSquaredToPosition(const glm::dvec3 &position, const Ellipsoid &ellipsoid=CesiumGeospatial::Ellipsoid::WGS84) const noexcept
Computes the distance-squared from a position in ellipsoid-centered Cartesian coordinates to the clos...
double getMinimumHeight() const noexcept
Gets the minimum height of the region.
const CesiumGeometry::OrientedBoundingBox & getBoundingBox() const noexcept
Gets an oriented bounding box containing this region.
A position defined by longitude, latitude, and height.
A quadratic surface defined in Cartesian coordinates.
Definition Ellipsoid.h:39
A two-dimensional, rectangular region on a globe, specified using longitude and latitude coordinates....
Basic geometry classes for Cesium.
CullingResult
The result of culling an object.
Classes for geospatial computations in Cesium.