cesium-native  0.41.0
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 
11 namespace CesiumGeometry {
12 class Plane;
13 }
14 
15 namespace CesiumGeospatial {
16 class Cartographic;
17 
22 class CESIUMGEOSPATIAL_API BoundingRegion final {
23 public:
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 
130  const BoundingRegion& other,
131  const CesiumGeospatial::Ellipsoid& ellipsoid
132  CESIUM_DEFAULT_ELLIPSOID) const noexcept;
133 
134 private:
135  static CesiumGeometry::OrientedBoundingBox _computeBoundingBox(
136  const GlobeRectangle& rectangle,
137  double minimumHeight,
138  double maximumHeight,
139  const Ellipsoid& ellipsoid);
140 
141  GlobeRectangle _rectangle;
142  double _minimumHeight;
143  double _maximumHeight;
145 
146  glm::dvec3 _southwestCornerCartesian;
147  glm::dvec3 _northeastCornerCartesian;
148  glm::dvec3 _westNormal;
149  glm::dvec3 _eastNormal;
150  glm::dvec3 _southNormal;
151  glm::dvec3 _northNormal;
152  bool _planesAreInvalid;
153 };
154 
155 } // 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.
double computeDistanceSquaredToPosition(const Cartographic &position, const Ellipsoid &ellipsoid CESIUM_DEFAULT_ELLIPSOID) const noexcept
Computes the distance-squared from a longitude-latitude-height position to the closest point in this ...
CesiumGeometry::CullingResult intersectPlane(const CesiumGeometry::Plane &plane) const noexcept
Determines on which side of a plane the bounding region is located.
BoundingRegion computeUnion(const BoundingRegion &other, const CesiumGeospatial::Ellipsoid &ellipsoid CESIUM_DEFAULT_ELLIPSOID) const noexcept
Computes the union of this bounding region with another.
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 CESIUM_DEFAULT_ELLIPSOID)
Constructs a new bounding region.
double computeDistanceSquaredToPosition(const glm::dvec3 &position, const Ellipsoid &ellipsoid CESIUM_DEFAULT_ELLIPSOID) const noexcept
Computes the distance-squared from a position in ellipsoid-centered Cartesian coordinates to the clos...
const GlobeRectangle & getRectangle() const noexcept
Gets the bounding rectangle of the region.
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.
Definition: Cartographic.h:12
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.
Definition: CullingResult.h:10
Classes for geospatial computations in Cesium.