LSSTApplications
19.0.0-10-g4a5fae6+3,19.0.0-10-g920eed2,19.0.0-11-g48a0200+2,19.0.0-18-gfc4e62b+16,19.0.0-2-g3b2f90d+2,19.0.0-2-gd671419+6,19.0.0-20-g5a5a17ab+14,19.0.0-21-g2644856+17,19.0.0-24-g0913cb1,19.0.0-24-g878c510+4,19.0.0-25-g6c8df7140+1,19.0.0-25-gb330496+4,19.0.0-3-g2b32d65+6,19.0.0-3-g8227491+15,19.0.0-3-g9c54d0d+15,19.0.0-3-gca68e65+11,19.0.0-3-gcfc5f51+6,19.0.0-3-ge110943+14,19.0.0-3-ge74d124,19.0.0-30-g9c3fd16+5,19.0.0-4-g06f5963+6,19.0.0-4-g10df615,19.0.0-4-g3d16501+17,19.0.0-4-g4a9c019+6,19.0.0-4-g5a8b323,19.0.0-4-g66397f0+1,19.0.0-4-g8557e14,19.0.0-4-g8964aba+16,19.0.0-4-ge404a01+15,19.0.0-5-g40f3a5a,19.0.0-5-g4db63b3,19.0.0-5-gb9eeb60,19.0.0-5-gfb03ce7+16,19.0.0-6-gbaebbfb+15,19.0.0-61-gec4c6e08+5,19.0.0-7-g039c0b5+15,19.0.0-7-gbea9075+4,19.0.0-7-gc567de5+16,19.0.0-72-g37abf38+2,19.0.0-9-g463f923+15,v20.0.0.rc1
LSSTDataManagementBasePackage
|
Go to the documentation of this file.
23 #ifndef LSST_SPHGEOM_BOX_H_
24 #define LSST_SPHGEOM_BOX_H_
109 _enforceInvariants();
118 _enforceInvariants();
127 _enforceInvariants();
132 return _lon ==
b._lon && _lat ==
b._lat;
220 _enforceInvariants();
230 _enforceInvariants();
327 return ((r1 & r2) & (CONTAINS | WITHIN)) | ((r1 | r2) & DISJOINT);
345 static constexpr
size_t ENCODED_SIZE = 33;
347 void _enforceInvariants() {
356 _lat = AngleInterval();
360 NormalizedAngleInterval _lon;
368 #endif // LSST_SPHGEOM_BOX_H_
Scalar getCenter() const
getCenter returns the center of this interval.
This file defines an interface for spherical regions.
NormalizedAngleInterval & expandTo(NormalizedAngle x)
NormalizedAngleInterval represents closed intervals of normalized angles, i.e.
NormalizedAngle getCenter() const
getCenter returns the center of this interval.
static NormalizedAngleInterval fromRadians(double a, double b)
Box erodedBy(Angle r) const
Box expandedTo(Box const &x) const
bool isFull() const
isFull returns true if this interval contains all normalized angles.
virtual Relationship relate(Region const &) const =0
Box & clipTo(LonLat const &x)
clipTo shrinks this box until it contains only x.
Box erodedBy(Angle w, Angle h) const
Region is a minimal interface for 2-dimensional regions on the unit sphere.
Box & expandTo(Box const &x)
Box dilatedBy(Angle r) const
This file declares a class for representing unit vectors in ℝ³.
NormalizedAngleInterval const & getLon() const
getLon returns the longitude interval of this box.
bool isWithin(Box const &x) const
NormalizedAngleInterval & clipTo(NormalizedAngle x)
clipTo shrinks this interval until all its points are in x.
static Box fromRadians(double lon1, double lat1, double lon2, double lat2)
LonLat represents a spherical coordinate (longitude/latitude angle) pair.
Box()
This constructor creates an empty box.
bool operator!=(Box const &b) const
bool isFull() const
isFull returns true if this box contains all points on the unit sphere.
Box clippedTo(LonLat const &x) const
clippedTo returns the intersection of this box and x.
Box represents a rectangle in spherical coordinate space that contains its boundary.
Box expandedTo(LonLat const &x) const
Relationship relate(LonLat const &p) const
Box getBoundingBox() const override
getBoundingBox returns a bounding-box for this region.
bool isEmpty() const
isEmpty returns true if this box does not contain any points.
bool isEmpty() const
isEmpty returns true if this interval does not contain any normalized angles.
Interval & clipTo(Scalar x)
Box(LonLat const &p1, LonLat const &p2)
This constructor creates a box spanning the longitude interval [p1.getLon(), p2.getLon()] and latitud...
Scalar getSize() const
getSize returns the size (length, width) of this interval.
Box3d represents a box in ℝ³.
Relationship relate(Region const &r) const override
NormalizedAngle getWidth() const
getWidth returns the width in longitude angle of this box.
bool isDisjointFrom(Box const &x) const
Box(NormalizedAngleInterval const &lon, AngleInterval const &lat)
This constructor creates a box spanning the given longitude and latitude intervals.
bool operator==(LonLat const &p) const
A box is equal to a point p if it contains only p.
UnitVector3d is a unit vector in ℝ³ with components stored in double precision.
ConvexPolygon is a closed convex polygon on the unit sphere.
bool isEmpty() const
isEmpty returns true if this interval does not contain any points.
Circle getBoundingCircle() const override
getBoundingCircle returns a bounding-circle for this region.
Relationship relate(Scalar x) const
bool intersects(LonLat const &x) const
double getArea() const
getArea returns the area of this box in steradians.
static NormalizedAngle halfWidthForCircle(Angle r, Angle lat)
halfWidthForCircle computes the half-width of bounding boxes for circles with radius r and centers at...
bool isWithin(NormalizedAngle x) const
AngleInterval const & getLat() const
getLat returns the latitude interval of this box.
bool contains(UnitVector3d const &v) const override
contains tests whether the given unit vector is inside this region.
Ellipse is an elliptical region on the sphere.
bool isDisjointFrom(LonLat const &x) const
bool contains(Scalar x) const
bool contains(Box const &x) const
bool isWithin(Scalar x) const
Box(LonLat const &p, Angle w, Angle h)
This constructor creates a box with center p, half-width (in longitude angle) w and half-height (in l...
Box & dilateBy(Angle r)
dilateBy minimally expands this Box to include all points within angular separation r of its boundary...
LonLat getCenter() const
getCenter returns the center of this box.
Angle getHeight() const
getHeight returns the height in latitude angle of this box.
static Box fromDegrees(double lon1, double lat1, double lon2, double lat2)
AngleInterval represents closed intervals of arbitrary angles.
A base class for image defects.
static NormalizedAngleInterval allLongitudes()
allLongitudes returns a normalized angle interval containing all valid longitude angles.
bool contains(LonLat const &x) const
bool intersects(Box const &x) const
Box & clipTo(Box const &x)
x.clipTo(y) sets x to the smallest box containing the intersection of x and y.
static NormalizedAngleInterval full()
Box clippedTo(Box const &x) const
clippedTo returns the smallest box containing the intersection of this box and x.
bool isWithin(LonLat const &x) const
This file declares a class representing closed intervals of normalized angles, i.e....
Box & expandTo(LonLat const &x)
std::unique_ptr< Region > clone() const override
clone returns a deep copy of this region.
bool operator==(Box const &b) const
Two boxes are equal if they contain the same points.
bool operator!=(LonLat const &p) const
Box & erodeBy(Angle w, Angle h)
bool contains(NormalizedAngle x) const
NormalizedAngle getSize() const
getSize returns the size (length, width) of this interval.
static constexpr uint8_t TYPE_CODE
This file defines a class for representing angle intervals.
Relationship relate(Box const &b) const override
std::vector< uint8_t > encode() const override
encode serializes this region into an opaque byte string.
bool intersects(NormalizedAngle x) const
static AngleInterval fromDegrees(double x, double y)
This file contains a class representing spherical coordinates.
Box dilatedBy(Angle w, Angle h) const
Relationship relate(NormalizedAngle x) const
Box3d getBoundingBox3d() const override
getBoundingBox3d returns a 3-dimensional bounding-box for this region.
Angle represents an angle in radians.
static NormalizedAngleInterval fromDegrees(double a, double b)
std::ostream & operator<<(std::ostream &, Angle const &)
Interval & expandTo(Scalar x)
static AngleInterval allLatitudes()
allLatitudes returns an angle interval containing all valid latitude angles.
Circle is a circular region on the unit sphere that contains its boundary.
NormalizedAngle is an angle that lies in the range [0, 2π), with one exception - a NormalizedAngle ca...
bool intersects(Scalar x) const
Box(LonLat const &p)
This constructor creates a box containing a single point.
static AngleInterval fromRadians(double x, double y)
NormalizedAngle getLon() const
static std::unique_ptr< Box > decode(std::vector< uint8_t > const &s)
Relationship invert(Relationship r)
Given the relationship between two sets A and B (i.e.