![]() |
LArSoft
v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
|
Definition of a range along one dimension. More...
#include "SimpleGeo.h"
Public Types | |
using | Data_t = Data |
Numeric type for boundaries. More... | |
using | Range_t = Range< Data > |
This range type. More... | |
Public Member Functions | |
Range ()=default | |
Default constructor: empty range. More... | |
Range (Data_t lower, Data_t upper, bool doSort=false) | |
Constructor from lower and upper bounds. More... | |
bool | isNull () const |
Returns whether the range is empty. More... | |
Data_t | length () const |
Returns the distance between upper and lower bounds. More... | |
bool | contains (Data_t v) const |
Returns whether the specified value is within the range. More... | |
bool | overlaps (Range_t const &r) const |
Returns whether the specified range overlaps this range. More... | |
Data_t | delta (Data_t v, Data_t margin=0.0) const |
void | extendToInclude (Data_t) |
Extends the range to include the specified point. More... | |
void | extendToInclude (Range_t const &r) |
Extends the range to include the specified point. More... | |
void | intersect (Range_t const &r) |
Shortens this range to include only points also in r . More... | |
Public Attributes | |
Data_t | lower = 1.0 |
Starting coordinate. More... | |
Data_t | upper = 0.0 |
Ending coordinate. More... | |
Private Member Functions | |
void | sort () |
Ensures order of boundaries. Corrupts invalid ranges. More... | |
void | makeNull () |
Resets this range to be empty (that is, like default-constructed). More... | |
Definition of a range along one dimension.
Definition at line 353 of file SimpleGeo.h.
using lar::util::simple_geo::Range< Data >::Data_t = Data |
Numeric type for boundaries.
Definition at line 354 of file SimpleGeo.h.
using lar::util::simple_geo::Range< Data >::Range_t = Range<Data> |
This range type.
Definition at line 355 of file SimpleGeo.h.
|
default |
Default constructor: empty range.
|
inline |
Constructor from lower and upper bounds.
Definition at line 364 of file SimpleGeo.h.
|
inline |
Returns whether the specified value is within the range.
Definition at line 376 of file SimpleGeo.h.
Referenced by lar::util::simple_geo::Rectangle< double >::contains().
auto lar::util::simple_geo::Range< Data >::delta | ( | Data_t | v, |
Data_t | margin = 0.0 |
||
) | const |
Returns a value that, added to v, makes it fall within a margin in the range.
Definition at line 472 of file SimpleGeo.h.
Referenced by geo::PlaneGeo::DeltaFromActivePlane().
void lar::util::simple_geo::Range< Data >::extendToInclude | ( | Data_t | v | ) |
void lar::util::simple_geo::Range< Data >::extendToInclude | ( | Range_t const & | r | ) |
Extends the range to include the specified point.
Definition at line 497 of file SimpleGeo.h.
References lar::util::simple_geo::Range< Data >::isNull(), lar::util::simple_geo::Range< Data >::lower, r, and lar::util::simple_geo::Range< Data >::upper.
void lar::util::simple_geo::Range< Data >::intersect | ( | Range_t const & | r | ) |
Shortens this range to include only points also in r
.
Definition at line 512 of file SimpleGeo.h.
References lar::util::simple_geo::Range< Data >::isNull(), lar::util::simple_geo::Range< Data >::lower, and lar::util::simple_geo::Range< Data >::upper.
|
inline |
Returns whether the range is empty.
Definition at line 370 of file SimpleGeo.h.
Referenced by lar::util::simple_geo::Range< Data >::extendToInclude(), lar::util::simple_geo::Range< Data >::intersect(), lar::util::simple_geo::Rectangle< double >::isNull(), and lar::util::simple_geo::Range< Data >::overlaps().
|
inline |
Returns the distance between upper and lower bounds.
Definition at line 373 of file SimpleGeo.h.
|
inlineprivate |
Resets this range to be empty (that is, like default-constructed).
Definition at line 402 of file SimpleGeo.h.
bool lar::util::simple_geo::Range< Data >::overlaps | ( | Range_t const & | r | ) | const |
Returns whether the specified range overlaps this range.
Definition at line 528 of file SimpleGeo.h.
References lar::util::simple_geo::Range< Data >::isNull(), lar::util::simple_geo::Range< Data >::lower, and lar::util::simple_geo::Range< Data >::upper.
|
inlineprivate |
Ensures order of boundaries. Corrupts invalid ranges.
Definition at line 396 of file SimpleGeo.h.
Data_t lar::util::simple_geo::Range< Data >::lower = 1.0 |
Starting coordinate.
Definition at line 357 of file SimpleGeo.h.
Referenced by lar::util::simple_geo::Range< Data >::extendToInclude(), lar::util::simple_geo::Range< Data >::intersect(), geo::part::details::RangeLowerBoundExtractor< Range >::operator()(), lar::util::simple_geo::Range< Data >::overlaps(), and geo::PlaneGeo::PrintPlaneInfo().
Data_t lar::util::simple_geo::Range< Data >::upper = 0.0 |
Ending coordinate.
Definition at line 358 of file SimpleGeo.h.
Referenced by lar::util::simple_geo::Range< Data >::extendToInclude(), lar::util::simple_geo::Range< Data >::intersect(), lar::util::simple_geo::Range< Data >::overlaps(), and geo::PlaneGeo::PrintPlaneInfo().