Loading [MathJax]/extensions/tex2jax.js
LSST Applications 28.0.2,g0fba68d861+5b923b673a,g1fd858c14a+7a7b9dd5ed,g2c84ff76c0+5548bfee71,g30358e5240+f0e04ebe90,g35bb328faa+fcb1d3bbc8,g436fd98eb5+bdc6fcdd04,g4af146b050+742274f7cd,g4d2262a081+3efd3f8190,g4e0f332c67+cb09b8a5b6,g53246c7159+fcb1d3bbc8,g5a012ec0e7+477f9c599b,g5edb6fd927+826dfcb47f,g60b5630c4e+bdc6fcdd04,g67b6fd64d1+2218407a0c,g78460c75b0+2f9a1b4bcd,g786e29fd12+cf7ec2a62a,g7b71ed6315+fcb1d3bbc8,g87b7deb4dc+f9ac2ab1bd,g8852436030+ebf28f0d95,g89139ef638+2218407a0c,g9125e01d80+fcb1d3bbc8,g989de1cb63+2218407a0c,g9f33ca652e+42fb53f4c8,g9f7030ddb1+11b9b6f027,ga2b97cdc51+bdc6fcdd04,gab72ac2889+bdc6fcdd04,gabe3b4be73+1e0a283bba,gabf8522325+3210f02652,gb1101e3267+9c79701da9,gb58c049af0+f03b321e39,gb89ab40317+2218407a0c,gcf25f946ba+ebf28f0d95,gd6cbbdb0b4+e8f9c9c900,gd9a9a58781+fcb1d3bbc8,gde0f65d7ad+a08f294619,ge278dab8ac+3ef3db156b,ge410e46f29+2218407a0c,gf67bdafdda+2218407a0c
LSST Data Management Base Package
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
lsst::sphgeom::AngleInterval Class Reference

AngleInterval represents closed intervals of arbitrary angles. More...

#include <AngleInterval.h>

Inheritance diagram for lsst::sphgeom::AngleInterval:
lsst::sphgeom::Interval< AngleInterval, Angle >

Public Member Functions

 AngleInterval ()
 
 AngleInterval (Angle x)
 
 AngleInterval (Angle x, Angle y)
 
 AngleInterval (Base const &base)
 
bool operator== (Interval const &i) const
 Two closed intervals are equal if their endpoints are the same, or both are empty.
 
bool operator== (Angle x) const
 A closed interval is equal to a point x if both endpoints equal x.
 
bool operator== (Interval const &i) const
 Two closed intervals are equal if their endpoints are the same, or both are empty.
 
bool operator== (Angle x) const
 A closed interval is equal to a point x if both endpoints equal x.
 
bool operator!= (Interval const &i) const
 
bool operator!= (Angle x) const
 
bool operator!= (Interval const &i) const
 
bool operator!= (Angle x) const
 
Angle getA () const
 getA returns the lower endpoint of this interval.
 
Angle getA () const
 getA returns the lower endpoint of this interval.
 
Angle getB () const
 getB returns the upper endpoint of this interval.
 
Angle getB () const
 getB returns the upper endpoint of this interval.
 
bool isEmpty () const
 isEmpty returns true if this interval does not contain any points.
 
bool isEmpty () const
 isEmpty returns true if this interval does not contain any points.
 
Angle getCenter () const
 getCenter returns the center of this interval.
 
Angle getCenter () const
 getCenter returns the center of this interval.
 
Angle getSize () const
 getSize returns the size (length, width) of this interval.
 
Angle getSize () const
 getSize returns the size (length, width) of this interval.
 
IntervaldilateBy (Angle x)
 For positive x, dilateBy morphologically dilates this interval by [-x,x], which is equivalent to the taking the Minkowski sum with [-x,x].
 
IntervaldilateBy (Angle x)
 For positive x, dilateBy morphologically dilates this interval by [-x,x], which is equivalent to the taking the Minkowski sum with [-x,x].
 
IntervalerodeBy (Angle x)
 
IntervalerodeBy (Angle x)
 
AngleInterval dilatedBy (Angle x) const
 
AngleInterval dilatedBy (Angle x) const
 
AngleInterval erodedBy (Angle x) const
 
AngleInterval erodedBy (Angle x) const
 
bool contains (Angle x) const
 
bool contains (Interval const &x) const
 
bool contains (Angle x) const
 
bool contains (Interval const &x) const
 
bool isDisjointFrom (Angle x) const
 
bool isDisjointFrom (Interval const &x) const
 
bool isDisjointFrom (Angle x) const
 
bool isDisjointFrom (Interval const &x) const
 
bool intersects (Angle x) const
 
bool intersects (Interval const &x) const
 
bool intersects (Angle x) const
 
bool intersects (Interval const &x) const
 
bool isWithin (Angle x) const
 
bool isWithin (Interval const &x) const
 
bool isWithin (Angle x) const
 
bool isWithin (Interval const &x) const
 
Relationship relate (Angle x) const
 
Relationship relate (Interval const &x) const
 
Relationship relate (Angle x) const
 
Relationship relate (Interval const &x) const
 
IntervalclipTo (Angle x)
 
IntervalclipTo (Interval const &x)
 
IntervalclipTo (Angle x)
 
IntervalclipTo (Interval const &x)
 
AngleInterval clippedTo (Angle x) const
 
AngleInterval clippedTo (Interval const &x) const
 
AngleInterval clippedTo (Angle x) const
 
AngleInterval clippedTo (Interval const &x) const
 
IntervalexpandTo (Angle x)
 
IntervalexpandTo (Interval const &x)
 
IntervalexpandTo (Angle x)
 
IntervalexpandTo (Interval const &x)
 
AngleInterval expandedTo (Angle x) const
 
AngleInterval expandedTo (Interval const &x) const
 
AngleInterval expandedTo (Angle x) const
 
AngleInterval expandedTo (Interval const &x) const
 

Static Public Member Functions

static AngleInterval fromDegrees (double x, double y)
 
static AngleInterval fromRadians (double x, double y)
 
static AngleInterval empty ()
 
static AngleInterval full ()
 

Detailed Description

AngleInterval represents closed intervals of arbitrary angles.

Definition at line 47 of file AngleInterval.h.

Constructor & Destructor Documentation

◆ AngleInterval() [1/4]

lsst::sphgeom::AngleInterval::AngleInterval ( )
inline

Definition at line 71 of file AngleInterval.h.

71: Base() {}

◆ AngleInterval() [2/4]

lsst::sphgeom::AngleInterval::AngleInterval ( Angle x)
inlineexplicit

Definition at line 73 of file AngleInterval.h.

73: Base(x) {}

◆ AngleInterval() [3/4]

lsst::sphgeom::AngleInterval::AngleInterval ( Angle x,
Angle y )
inline

Definition at line 75 of file AngleInterval.h.

75: Base(x, y) {}

◆ AngleInterval() [4/4]

lsst::sphgeom::AngleInterval::AngleInterval ( Base const & base)
inline

Definition at line 77 of file AngleInterval.h.

77: Base(base) {}

Member Function Documentation

◆ clippedTo() [1/4]

AngleInterval lsst::sphgeom::Interval< AngleInterval, Angle >::clippedTo ( Angle x) const
inlineinherited

clippedTo returns the intersection of this interval and x.

Definition at line 190 of file Interval.h.

190{ return Interval(*this).clipTo(x); }
Interval represents a closed interval of the real numbers by its upper and lower bounds.
Definition Interval.h:55

◆ clippedTo() [2/4]

AngleInterval lsst::sphgeom::Interval< AngleInterval, Angle >::clippedTo ( Angle x) const
inlineinherited

clippedTo returns the intersection of this interval and x.

Definition at line 190 of file Interval.h.

190{ return Interval(*this).clipTo(x); }

◆ clippedTo() [3/4]

AngleInterval lsst::sphgeom::Interval< AngleInterval, Angle >::clippedTo ( Interval< AngleInterval, Angle > const & x) const
inlineinherited

clippedTo returns the intersection of this interval and x.

Definition at line 192 of file Interval.h.

192 {
193 return Interval(*this).clipTo(x);
194 }

◆ clippedTo() [4/4]

AngleInterval lsst::sphgeom::Interval< AngleInterval, Angle >::clippedTo ( Interval< AngleInterval, Angle > const & x) const
inlineinherited

clippedTo returns the intersection of this interval and x.

Definition at line 192 of file Interval.h.

192 {
193 return Interval(*this).clipTo(x);
194 }

◆ clipTo() [1/4]

Interval & lsst::sphgeom::Interval< AngleInterval, Angle >::clipTo ( Angle x)
inlineinherited

clipTo shrinks this interval until all its points are in x.

Definition at line 166 of file Interval.h.

166 {
167 if (x != x) {
168 _a = x;
169 _b = x;
170 } else {
171 _a = std::max(_a, x);
172 _b = std::min(_b, x);
173 }
174 return *this;
175 }
T max(T... args)
T min(T... args)

◆ clipTo() [2/4]

Interval & lsst::sphgeom::Interval< AngleInterval, Angle >::clipTo ( Angle x)
inlineinherited

clipTo shrinks this interval until all its points are in x.

Definition at line 166 of file Interval.h.

166 {
167 if (x != x) {
168 _a = x;
169 _b = x;
170 } else {
171 _a = std::max(_a, x);
172 _b = std::min(_b, x);
173 }
174 return *this;
175 }

◆ clipTo() [3/4]

Interval & lsst::sphgeom::Interval< AngleInterval, Angle >::clipTo ( Interval< AngleInterval, Angle > const & x)
inlineinherited

clipTo shrinks this interval until all its points are in x.

Definition at line 177 of file Interval.h.

177 {
178 if (x.isEmpty()) {
179 *this = x;
180 } else if (!isEmpty()) {
181 _a = std::max(_a, x._a);
182 _b = std::min(_b, x._b);
183 }
184 return *this;
185 }
bool isEmpty() const
isEmpty returns true if this interval does not contain any points.
Definition Interval.h:90

◆ clipTo() [4/4]

Interval & lsst::sphgeom::Interval< AngleInterval, Angle >::clipTo ( Interval< AngleInterval, Angle > const & x)
inlineinherited

clipTo shrinks this interval until all its points are in x.

Definition at line 177 of file Interval.h.

177 {
178 if (x.isEmpty()) {
179 *this = x;
180 } else if (!isEmpty()) {
181 _a = std::max(_a, x._a);
182 _b = std::min(_b, x._b);
183 }
184 return *this;
185 }

◆ contains() [1/4]

bool lsst::sphgeom::Interval< AngleInterval, Angle >::contains ( Angle x) const
inlineinherited

contains returns true if the intersection of this interval and x is equal to x.

Definition at line 105 of file Interval.h.

105 {
106 return (_a <= x && x <= _b) || x != x;
107 }

◆ contains() [2/4]

bool lsst::sphgeom::Interval< AngleInterval, Angle >::contains ( Angle x) const
inlineinherited

contains returns true if the intersection of this interval and x is equal to x.

Definition at line 105 of file Interval.h.

105 {
106 return (_a <= x && x <= _b) || x != x;
107 }

◆ contains() [3/4]

bool lsst::sphgeom::Interval< AngleInterval, Angle >::contains ( Interval< AngleInterval, Angle > const & x) const
inlineinherited

contains returns true if the intersection of this interval and x is equal to x.

Definition at line 109 of file Interval.h.

109 {
110 if (x.isEmpty()) {
111 return true;
112 } else if (isEmpty()) {
113 return false;
114 }
115 return _a <= x._a && _b >= x._b;
116 }

◆ contains() [4/4]

bool lsst::sphgeom::Interval< AngleInterval, Angle >::contains ( Interval< AngleInterval, Angle > const & x) const
inlineinherited

contains returns true if the intersection of this interval and x is equal to x.

Definition at line 109 of file Interval.h.

109 {
110 if (x.isEmpty()) {
111 return true;
112 } else if (isEmpty()) {
113 return false;
114 }
115 return _a <= x._a && _b >= x._b;
116 }

◆ dilateBy() [1/2]

Interval & lsst::sphgeom::Interval< AngleInterval, Angle >::dilateBy ( Angle x)
inlineinherited

For positive x, dilateBy morphologically dilates this interval by [-x,x], which is equivalent to the taking the Minkowski sum with [-x,x].

For negative x, it morphologically erodes this interval by [x,-x]. If x is zero or NaN, or this interval is empty, there is no effect.

Definition at line 237 of file Interval.h.

237 {
238 if (x == x && !isEmpty()) {
239 _a = _a - x;
240 _b = _b + x;
241 }
242 return *this;
243 }

◆ dilateBy() [2/2]

Interval & lsst::sphgeom::Interval< AngleInterval, Angle >::dilateBy ( Angle x)
inlineinherited

For positive x, dilateBy morphologically dilates this interval by [-x,x], which is equivalent to the taking the Minkowski sum with [-x,x].

For negative x, it morphologically erodes this interval by [x,-x]. If x is zero or NaN, or this interval is empty, there is no effect.

Definition at line 237 of file Interval.h.

237 {
238 if (x == x && !isEmpty()) {
239 _a = _a - x;
240 _b = _b + x;
241 }
242 return *this;
243 }

◆ dilatedBy() [1/2]

AngleInterval lsst::sphgeom::Interval< AngleInterval, Angle >::dilatedBy ( Angle x) const
inlineinherited

Definition at line 246 of file Interval.h.

246{ return Interval(*this).dilateBy(x); }

◆ dilatedBy() [2/2]

AngleInterval lsst::sphgeom::Interval< AngleInterval, Angle >::dilatedBy ( Angle x) const
inlineinherited

Definition at line 246 of file Interval.h.

246{ return Interval(*this).dilateBy(x); }

◆ empty()

static AngleInterval lsst::sphgeom::AngleInterval::empty ( )
inlinestatic

Definition at line 61 of file AngleInterval.h.

61 {
62 return AngleInterval();
63 }

◆ erodeBy() [1/2]

Interval & lsst::sphgeom::Interval< AngleInterval, Angle >::erodeBy ( Angle x)
inlineinherited

Definition at line 245 of file Interval.h.

245{ return dilateBy(-x); }

◆ erodeBy() [2/2]

Interval & lsst::sphgeom::Interval< AngleInterval, Angle >::erodeBy ( Angle x)
inlineinherited

Definition at line 245 of file Interval.h.

245{ return dilateBy(-x); }

◆ erodedBy() [1/2]

AngleInterval lsst::sphgeom::Interval< AngleInterval, Angle >::erodedBy ( Angle x) const
inlineinherited

Definition at line 247 of file Interval.h.

247{ return Interval(*this).erodeBy(x); }

◆ erodedBy() [2/2]

AngleInterval lsst::sphgeom::Interval< AngleInterval, Angle >::erodedBy ( Angle x) const
inlineinherited

Definition at line 247 of file Interval.h.

247{ return Interval(*this).erodeBy(x); }

◆ expandedTo() [1/4]

AngleInterval lsst::sphgeom::Interval< AngleInterval, Angle >::expandedTo ( Angle x) const
inlineinherited

expandedTo returns the smallest interval containing the union of this interval and x.

Definition at line 225 of file Interval.h.

225{ return Interval(*this).expandTo(x); }

◆ expandedTo() [2/4]

AngleInterval lsst::sphgeom::Interval< AngleInterval, Angle >::expandedTo ( Angle x) const
inlineinherited

expandedTo returns the smallest interval containing the union of this interval and x.

Definition at line 225 of file Interval.h.

225{ return Interval(*this).expandTo(x); }

◆ expandedTo() [3/4]

AngleInterval lsst::sphgeom::Interval< AngleInterval, Angle >::expandedTo ( Interval< AngleInterval, Angle > const & x) const
inlineinherited

expandedTo returns the smallest interval containing the union of this interval and x.

Definition at line 227 of file Interval.h.

227 {
228 return Interval(*this).expandTo(x);
229 }

◆ expandedTo() [4/4]

AngleInterval lsst::sphgeom::Interval< AngleInterval, Angle >::expandedTo ( Interval< AngleInterval, Angle > const & x) const
inlineinherited

expandedTo returns the smallest interval containing the union of this interval and x.

Definition at line 227 of file Interval.h.

227 {
228 return Interval(*this).expandTo(x);
229 }

◆ expandTo() [1/4]

Interval & lsst::sphgeom::Interval< AngleInterval, Angle >::expandTo ( Angle x)
inlineinherited

expandTo minimally expands this interval to contain x.

Definition at line 199 of file Interval.h.

199 {
200 if (isEmpty()) {
201 _a = x;
202 _b = x;
203 } else if (x < _a) {
204 _a = x;
205 } else if (x > _b) {
206 _b = x;
207 }
208 return *this;
209 }

◆ expandTo() [2/4]

Interval & lsst::sphgeom::Interval< AngleInterval, Angle >::expandTo ( Angle x)
inlineinherited

expandTo minimally expands this interval to contain x.

Definition at line 199 of file Interval.h.

199 {
200 if (isEmpty()) {
201 _a = x;
202 _b = x;
203 } else if (x < _a) {
204 _a = x;
205 } else if (x > _b) {
206 _b = x;
207 }
208 return *this;
209 }

◆ expandTo() [3/4]

Interval & lsst::sphgeom::Interval< AngleInterval, Angle >::expandTo ( Interval< AngleInterval, Angle > const & x)
inlineinherited

expandTo minimally expands this interval to contain x.

Definition at line 211 of file Interval.h.

211 {
212 if (isEmpty()) {
213 *this = x;
214 } else if (!x.isEmpty()) {
215 _a = std::min(_a, x._a);
216 _b = std::max(_b, x._b);
217 }
218 return *this;
219 }

◆ expandTo() [4/4]

Interval & lsst::sphgeom::Interval< AngleInterval, Angle >::expandTo ( Interval< AngleInterval, Angle > const & x)
inlineinherited

expandTo minimally expands this interval to contain x.

Definition at line 211 of file Interval.h.

211 {
212 if (isEmpty()) {
213 *this = x;
214 } else if (!x.isEmpty()) {
215 _a = std::min(_a, x._a);
216 _b = std::max(_b, x._b);
217 }
218 return *this;
219 }

◆ fromDegrees()

static AngleInterval lsst::sphgeom::AngleInterval::fromDegrees ( double x,
double y )
inlinestatic

Definition at line 51 of file AngleInterval.h.

51 {
54 }
static Angle fromDegrees(double a)
Definition Angle.h:56

◆ fromRadians()

static AngleInterval lsst::sphgeom::AngleInterval::fromRadians ( double x,
double y )
inlinestatic

Definition at line 56 of file AngleInterval.h.

56 {
59 }
static Angle fromRadians(double a)
Definition Angle.h:58

◆ full()

static AngleInterval lsst::sphgeom::AngleInterval::full ( )
inlinestatic

Definition at line 65 of file AngleInterval.h.

◆ getA() [1/2]

Angle lsst::sphgeom::Interval< AngleInterval, Angle >::getA ( ) const
inlineinherited

getA returns the lower endpoint of this interval.

The return value for empty intervals is arbitrary.

Definition at line 83 of file Interval.h.

83{ return _a; }

◆ getA() [2/2]

Angle lsst::sphgeom::Interval< AngleInterval, Angle >::getA ( ) const
inlineinherited

getA returns the lower endpoint of this interval.

The return value for empty intervals is arbitrary.

Definition at line 83 of file Interval.h.

83{ return _a; }

◆ getB() [1/2]

Angle lsst::sphgeom::Interval< AngleInterval, Angle >::getB ( ) const
inlineinherited

getB returns the upper endpoint of this interval.

The return value for empty intervals is arbitrary.

Definition at line 87 of file Interval.h.

87{ return _b; }

◆ getB() [2/2]

Angle lsst::sphgeom::Interval< AngleInterval, Angle >::getB ( ) const
inlineinherited

getB returns the upper endpoint of this interval.

The return value for empty intervals is arbitrary.

Definition at line 87 of file Interval.h.

87{ return _b; }

◆ getCenter() [1/2]

Angle lsst::sphgeom::Interval< AngleInterval, Angle >::getCenter ( ) const
inlineinherited

getCenter returns the center of this interval.

It is arbitrary for empty intervals.

Definition at line 96 of file Interval.h.

96{ return 0.5 * (_a + _b); }

◆ getCenter() [2/2]

Angle lsst::sphgeom::Interval< AngleInterval, Angle >::getCenter ( ) const
inlineinherited

getCenter returns the center of this interval.

It is arbitrary for empty intervals.

Definition at line 96 of file Interval.h.

96{ return 0.5 * (_a + _b); }

◆ getSize() [1/2]

Angle lsst::sphgeom::Interval< AngleInterval, Angle >::getSize ( ) const
inlineinherited

getSize returns the size (length, width) of this interval.

It is zero for single-point intervals, and NaN or negative for empty intervals.

Definition at line 100 of file Interval.h.

100{ return _b - _a; }

◆ getSize() [2/2]

Angle lsst::sphgeom::Interval< AngleInterval, Angle >::getSize ( ) const
inlineinherited

getSize returns the size (length, width) of this interval.

It is zero for single-point intervals, and NaN or negative for empty intervals.

Definition at line 100 of file Interval.h.

100{ return _b - _a; }

◆ intersects() [1/4]

bool lsst::sphgeom::Interval< AngleInterval, Angle >::intersects ( Angle x) const
inlineinherited

intersects returns true if the intersection of this interval and x is non-empty.

Definition at line 137 of file Interval.h.

137{ return _a <= x && x <= _b; }

◆ intersects() [2/4]

bool lsst::sphgeom::Interval< AngleInterval, Angle >::intersects ( Angle x) const
inlineinherited

intersects returns true if the intersection of this interval and x is non-empty.

Definition at line 137 of file Interval.h.

137{ return _a <= x && x <= _b; }

◆ intersects() [3/4]

bool lsst::sphgeom::Interval< AngleInterval, Angle >::intersects ( Interval< AngleInterval, Angle > const & x) const
inlineinherited

intersects returns true if the intersection of this interval and x is non-empty.

Definition at line 139 of file Interval.h.

139 {
140 return !isDisjointFrom(x);
141 }

◆ intersects() [4/4]

bool lsst::sphgeom::Interval< AngleInterval, Angle >::intersects ( Interval< AngleInterval, Angle > const & x) const
inlineinherited

intersects returns true if the intersection of this interval and x is non-empty.

Definition at line 139 of file Interval.h.

139 {
140 return !isDisjointFrom(x);
141 }

◆ isDisjointFrom() [1/4]

bool lsst::sphgeom::Interval< AngleInterval, Angle >::isDisjointFrom ( Angle x) const
inlineinherited

isDisjointFrom returns true if the intersection of this interval and x is empty.

Definition at line 122 of file Interval.h.

122 {
123 return !intersects(x);
124 }

◆ isDisjointFrom() [2/4]

bool lsst::sphgeom::Interval< AngleInterval, Angle >::isDisjointFrom ( Angle x) const
inlineinherited

isDisjointFrom returns true if the intersection of this interval and x is empty.

Definition at line 122 of file Interval.h.

122 {
123 return !intersects(x);
124 }

◆ isDisjointFrom() [3/4]

bool lsst::sphgeom::Interval< AngleInterval, Angle >::isDisjointFrom ( Interval< AngleInterval, Angle > const & x) const
inlineinherited

isDisjointFrom returns true if the intersection of this interval and x is empty.

Definition at line 126 of file Interval.h.

126 {
127 if (isEmpty() || x.isEmpty()) {
128 return true;
129 }
130 return _a > x._b || _b < x._a;
131 }

◆ isDisjointFrom() [4/4]

bool lsst::sphgeom::Interval< AngleInterval, Angle >::isDisjointFrom ( Interval< AngleInterval, Angle > const & x) const
inlineinherited

isDisjointFrom returns true if the intersection of this interval and x is empty.

Definition at line 126 of file Interval.h.

126 {
127 if (isEmpty() || x.isEmpty()) {
128 return true;
129 }
130 return _a > x._b || _b < x._a;
131 }

◆ isEmpty() [1/2]

bool lsst::sphgeom::Interval< AngleInterval, Angle >::isEmpty ( ) const
inlineinherited

isEmpty returns true if this interval does not contain any points.

Definition at line 90 of file Interval.h.

90 {
91 return !(_a <= _b); // returns true when _a and/or _b is NaN
92 }

◆ isEmpty() [2/2]

bool lsst::sphgeom::Interval< AngleInterval, Angle >::isEmpty ( ) const
inlineinherited

isEmpty returns true if this interval does not contain any points.

Definition at line 90 of file Interval.h.

90 {
91 return !(_a <= _b); // returns true when _a and/or _b is NaN
92 }

◆ isWithin() [1/4]

bool lsst::sphgeom::Interval< AngleInterval, Angle >::isWithin ( Angle x) const
inlineinherited

isWithin returns true if the intersection of this interval and x is this interval.

Definition at line 147 of file Interval.h.

147 {
148 return (_a == x && _b == x) || isEmpty();
149 }

◆ isWithin() [2/4]

bool lsst::sphgeom::Interval< AngleInterval, Angle >::isWithin ( Angle x) const
inlineinherited

isWithin returns true if the intersection of this interval and x is this interval.

Definition at line 147 of file Interval.h.

147 {
148 return (_a == x && _b == x) || isEmpty();
149 }

◆ isWithin() [3/4]

bool lsst::sphgeom::Interval< AngleInterval, Angle >::isWithin ( Interval< AngleInterval, Angle > const & x) const
inlineinherited

isWithin returns true if the intersection of this interval and x is this interval.

Definition at line 151 of file Interval.h.

151 {
152 return x.contains(*this);
153 }
bool contains(Scalar x) const
Definition Interval.h:105

◆ isWithin() [4/4]

bool lsst::sphgeom::Interval< AngleInterval, Angle >::isWithin ( Interval< AngleInterval, Angle > const & x) const
inlineinherited

isWithin returns true if the intersection of this interval and x is this interval.

Definition at line 151 of file Interval.h.

151 {
152 return x.contains(*this);
153 }

◆ operator!=() [1/4]

bool lsst::sphgeom::Interval< AngleInterval, Angle >::operator!= ( Angle x) const
inlineinherited

Definition at line 79 of file Interval.h.

79{ return !(*this == x); }

◆ operator!=() [2/4]

bool lsst::sphgeom::Interval< AngleInterval, Angle >::operator!= ( Angle x) const
inlineinherited

Definition at line 79 of file Interval.h.

79{ return !(*this == x); }

◆ operator!=() [3/4]

bool lsst::sphgeom::Interval< AngleInterval, Angle >::operator!= ( Interval< AngleInterval, Angle > const & i) const
inlineinherited

Definition at line 72 of file Interval.h.

72{ return !(*this == i); }

◆ operator!=() [4/4]

bool lsst::sphgeom::Interval< AngleInterval, Angle >::operator!= ( Interval< AngleInterval, Angle > const & i) const
inlineinherited

Definition at line 72 of file Interval.h.

72{ return !(*this == i); }

◆ operator==() [1/4]

bool lsst::sphgeom::Interval< AngleInterval, Angle >::operator== ( Angle x) const
inlineinherited

A closed interval is equal to a point x if both endpoints equal x.

Definition at line 75 of file Interval.h.

75 {
76 return (_a == x && _b == x) || (x != x && isEmpty());
77 }

◆ operator==() [2/4]

bool lsst::sphgeom::Interval< AngleInterval, Angle >::operator== ( Angle x) const
inlineinherited

A closed interval is equal to a point x if both endpoints equal x.

Definition at line 75 of file Interval.h.

75 {
76 return (_a == x && _b == x) || (x != x && isEmpty());
77 }

◆ operator==() [3/4]

bool lsst::sphgeom::Interval< AngleInterval, Angle >::operator== ( Interval< AngleInterval, Angle > const & i) const
inlineinherited

Two closed intervals are equal if their endpoints are the same, or both are empty.

Definition at line 68 of file Interval.h.

68 {
69 return (_a == i._a && _b == i._b) || (i.isEmpty() && isEmpty());
70 }

◆ operator==() [4/4]

bool lsst::sphgeom::Interval< AngleInterval, Angle >::operator== ( Interval< AngleInterval, Angle > const & i) const
inlineinherited

Two closed intervals are equal if their endpoints are the same, or both are empty.

Definition at line 68 of file Interval.h.

68 {
69 return (_a == i._a && _b == i._b) || (i.isEmpty() && isEmpty());
70 }

◆ relate() [1/4]

Relationship lsst::sphgeom::Interval< AngleInterval, Angle >::relate ( Angle x) const
inherited

relate returns a bitset S describing the spatial relationships between this interval and x. For each relation that holds, the bitwise AND of S and the corresponding Relationship will be non-zero.

◆ relate() [2/4]

Relationship lsst::sphgeom::Interval< AngleInterval, Angle >::relate ( Angle x) const
inherited

relate returns a bitset S describing the spatial relationships between this interval and x. For each relation that holds, the bitwise AND of S and the corresponding Relationship will be non-zero.

Definition at line 160 of file Interval.h.

256 {
257 if (isEmpty()) {
258 if (x != x) {
259 return CONTAINS | DISJOINT | WITHIN;
260 }
261 return DISJOINT | WITHIN;
262 }
263 if (x != x) {
264 return CONTAINS | DISJOINT;
265 }
266 if (_a == x && _b == x) {
267 return CONTAINS | WITHIN;
268 }
269 if (intersects(x)) {
270 return CONTAINS;
271 }
272 return DISJOINT;
273}

◆ relate() [3/4]

Relationship lsst::sphgeom::Interval< AngleInterval, Angle >::relate ( Interval< AngleInterval, Angle > const & x) const
inherited

relate returns a bitset S describing the spatial relationships between this interval and x. For each relation that holds, the bitwise AND of S and the corresponding Relationship will be non-zero.

◆ relate() [4/4]

Relationship lsst::sphgeom::Interval< AngleInterval, Angle >::relate ( Interval< AngleInterval, Angle > const & x) const
inherited

relate returns a bitset S describing the spatial relationships between this interval and x. For each relation that holds, the bitwise AND of S and the corresponding Relationship will be non-zero.

Definition at line 161 of file Interval.h.

278{
279 if (isEmpty()) {
280 if (x.isEmpty()) {
281 return CONTAINS | DISJOINT | WITHIN;
282 }
283 return DISJOINT | WITHIN;
284 }
285 if (x.isEmpty()) {
286 return CONTAINS | DISJOINT;
287 }
288 if (_a == x._a && _b == x._b) {
289 return CONTAINS | WITHIN;
290 }
291 if (_a > x._b || _b < x._a) {
292 return DISJOINT;
293 }
294 if (_a <= x._a && _b >= x._b) {
295 return CONTAINS;
296 }
297 if (x._a <= _a && x._b >= _b) {
298 return WITHIN;
299 }
300 return INTERSECTS;
301}

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