cesium-native 0.43.0
Loading...
Searching...
No Matches
BoundingRegion.h
1#pragma once
2
3#include "Ellipsoid.h"
4#include "GlobeRectangle.h"
5#include "Library.h"
6
7#include <CesiumGeometry/CullingResult.h>
8#include <CesiumGeometry/OrientedBoundingBox.h>
9#include <CesiumGeospatial/Ellipsoid.h>
10
11namespace CesiumGeometry {
12class Plane;
13}
14
15namespace CesiumGeospatial {
16class Cartographic;
17
22class CESIUMGEOSPATIAL_API BoundingRegion final {
23public:
33 const GlobeRectangle& rectangle,
34 double minimumHeight,
35 double maximumHeight,
36 const Ellipsoid& ellipsoid CESIUM_DEFAULT_ELLIPSOID);
37
41 const GlobeRectangle& getRectangle() const noexcept {
42 return this->_rectangle;
43 }
44
48 double getMinimumHeight() const noexcept { return this->_minimumHeight; }
49
53 double getMaximumHeight() const noexcept { return this->_maximumHeight; }
54
59 return this->_boundingBox;
60 }
61
73 intersectPlane(const CesiumGeometry::Plane& plane) const noexcept;
74
91 const glm::dvec3& position,
92 const Ellipsoid& ellipsoid CESIUM_DEFAULT_ELLIPSOID) const noexcept;
93
104 const Cartographic& position,
105 const Ellipsoid& ellipsoid CESIUM_DEFAULT_ELLIPSOID) const noexcept;
106
120 const Cartographic& cartographicPosition,
121 const glm::dvec3& cartesianPosition) const noexcept;
122
131 const BoundingRegion& other,
132 const CesiumGeospatial::Ellipsoid& ellipsoid
133 CESIUM_DEFAULT_ELLIPSOID) const noexcept;
134
135private:
136 static CesiumGeometry::OrientedBoundingBox _computeBoundingBox(
137 const GlobeRectangle& rectangle,
138 double minimumHeight,
139 double maximumHeight,
140 const Ellipsoid& ellipsoid);
141
142 GlobeRectangle _rectangle;
143 double _minimumHeight;
144 double _maximumHeight;
146
147 glm::dvec3 _southwestCornerCartesian;
148 glm::dvec3 _northeastCornerCartesian;
149 glm::dvec3 _westNormal;
150 glm::dvec3 _eastNormal;
151 glm::dvec3 _southNormal;
152 glm::dvec3 _northNormal;
153 bool _planesAreInvalid;
154};
155
156} // 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:38
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.