LSSTApplications
12.1-5-gbdcc3ab+2,15.0+13,15.0+26,15.0-1-g19261fa+17,15.0-1-g60afb23+26,15.0-1-g615e0bb+18,15.0-1-g788a293+26,15.0-1-ga91101e+26,15.0-1-gae1598d+12,15.0-1-gd076f1f+24,15.0-1-gdf18595+5,15.0-1-gf4f1c34+12,15.0-11-g7db6e543+4,15.0-12-g3681e7a+4,15.0-15-gc15de322,15.0-16-g83b84f4,15.0-2-g100d730+19,15.0-2-g1f9c9cf+4,15.0-2-g8aea5f4+1,15.0-2-gf38729e+21,15.0-29-ga12a2b06e,15.0-3-g11fe1a0+14,15.0-3-g707930d+3,15.0-3-g9103c06+12,15.0-3-gd3cbb57+3,15.0-4-g2d82b59,15.0-4-g535e784+10,15.0-4-g92ca6c3+4,15.0-4-gf906033+2,15.0-5-g23e394c+14,15.0-5-g4be42a9,15.0-6-g69628aa,15.0-6-g86e3f3d+1,15.0-6-gfa9b38f+4,15.0-7-g949993c+3,15.0-8-g67a62d3+1,15.0-8-gcf05001+1,15.0-9-g1e7c341+1,w.2018.21
LSSTDataManagementBasePackage
|
A floating-point coordinate rectangle geometry. More...
#include <Box.h>
Public Types | |
typedef Point2D | Point |
typedef Extent2D | Extent |
typedef double | Element |
Public Member Functions | |
Box2D () | |
Construct an empty box. More... | |
Box2D (Point2D const &minimum, Point2D const &maximum, bool invert=true) | |
Construct a box from its minimum and maximum points. More... | |
Box2D (Point2D const &minimum, Extent2D const &dimensions, bool invert=true) | |
Construct a box from its minimum point and dimensions. More... | |
Box2D (Box2I const &other) | |
Construct a floating-point box from an integer box. More... | |
Box2D (Box2D const &)=default | |
Standard copy constructor. More... | |
Box2D (Box2D &&)=default | |
~Box2D ()=default | |
void | swap (Box2D &other) |
Box2D & | operator= (Box2D const &)=default |
Standard assignment operator. More... | |
Box2D & | operator= (Box2D &&)=default |
bool | isEmpty () const |
Return true if the box contains no points. More... | |
bool | contains (Point2D const &point) const |
Return true if the box contains the point. More... | |
bool | contains (Box2D const &other) const |
Return true if all points contained by other are also contained by this. More... | |
bool | overlaps (Box2D const &other) const |
Return true if any points in other are also in this. More... | |
void | grow (double buffer) |
Increase the size of the box by the given buffer amount in all directions. More... | |
void | grow (Extent2D const &buffer) |
Increase the size of the box by the given buffer amount in each direction. More... | |
void | shift (Extent2D const &offset) |
Shift the position of the box by the given offset. More... | |
void | flipLR (float xExtent) |
Flip a bounding box about the y-axis given a parent box of extent (xExtent). More... | |
void | flipTB (float yExtent) |
Flip a bounding box about the x-axis given a parent box of extent (yExtent). More... | |
void | include (Point2D const &point) |
Expand this to ensure that this->contains(point). More... | |
void | include (Box2D const &other) |
Expand this to ensure that this->contains(other). More... | |
void | clip (Box2D const &other) |
Shrink this to ensure that other.contains(*this). More... | |
bool | operator== (Box2D const &other) const |
Compare two boxes for equality. More... | |
bool | operator!= (Box2D const &other) const |
Compare two boxes for equality. More... | |
std::vector< Point2D > | getCorners () const |
Get the corner points. More... | |
std::string | toString () const |
Min/Max Accessors | |
Return the minimum (inclusive) and maximum (exclusive) coordinates of the box. | |
Point2D const | getMin () const |
double | getMinX () const |
double | getMinY () const |
Point2D const | getMax () const |
double | getMaxX () const |
double | getMaxY () const |
Size Accessors | |
Return the size of the box. | |
Extent2D const | getDimensions () const |
double | getWidth () const |
double | getHeight () const |
double | getArea () const |
Center Accessors | |
Return the center coordinate of the box. | |
Point2D const | getCenter () const |
double | getCenterX () const |
double | getCenterY () const |
Static Public Attributes | |
static double const | EPSILON = std::numeric_limits<double>::epsilon() * 2 |
Value the maximum coordinate is multiplied by to increase it by the smallest possible amount. More... | |
static double const | INVALID = std::numeric_limits<double>::quiet_NaN() |
Value used to specify undefined coordinate values. More... | |
A floating-point coordinate rectangle geometry.
Box2D is a half-open (minimum is inclusive, maximum is exclusive) box. A box never has negative dimensions; the empty box is defined to zero-size dimensions and its minimum and maximum values set to NaN. Only the empty box may have zero-size dimensions.
typedef double lsst::afw::geom::Box2D::Element |
typedef Point2D lsst::afw::geom::Box2D::Point |
lsst::afw::geom::Box2D::Box2D | ( | ) |
lsst::afw::geom::Box2D::Box2D | ( | Point2D const & | minimum, |
Point2D const & | maximum, | ||
bool | invert = true |
||
) |
Construct a box from its minimum and maximum points.
If any(minimum == maximum), the box will always be empty (even if invert==true).
[in] | minimum | Minimum (lower left) coordinate (inclusive). |
[in] | maximum | Maximum (upper right) coordinate (exclusive). |
[in] | invert | If true (default), swap the minimum and maximum coordinates if minimum > maximum instead of creating an empty box. |
Definition at line 226 of file Box.cc.
lsst::afw::geom::Box2D::Box2D | ( | Point2D const & | minimum, |
Extent2D const & | dimensions, | ||
bool | invert = true |
||
) |
Construct a box from its minimum point and dimensions.
[in] | minimum | Minimum (lower left) coordinate (inclusive). |
[in] | dimensions | Box dimensions. If either dimension coordinate is 0, the box will be empty. |
[in] | invert | If true (default), invert any negative dimensions instead of creating an empty box. |
Definition at line 243 of file Box.cc.
|
explicit |
Construct a floating-point box from an integer box.
Integer to floating-point box conversion is based on the concept that a pixel is not an infinitesimal point but rather a square of unit size centered on integer-valued coordinates. While the output floating-point box thus has the same dimensions as the input integer box, its minimum/maximum coordinates are 0.5 smaller/greater.
Definition at line 260 of file Box.cc.
|
default |
Standard copy constructor.
|
default |
|
default |
void lsst::afw::geom::Box2D::clip | ( | Box2D const & | other | ) |
Shrink this to ensure that other.contains(*this).
Definition at line 353 of file Box.cc.
bool lsst::afw::geom::Box2D::contains | ( | Point2D const & | point | ) | const |
Return true if the box contains the point.
Definition at line 266 of file Box.cc.
bool lsst::afw::geom::Box2D::contains | ( | Box2D const & | other | ) | const |
Return true if all points contained by other are also contained by this.
An empty box is contained by every other box, including other empty boxes.
Definition at line 270 of file Box.cc.
void lsst::afw::geom::Box2D::flipLR | ( | float | xExtent | ) |
void lsst::afw::geom::Box2D::flipTB | ( | float | yExtent | ) |
|
inline |
Definition at line 368 of file Box.h.
|
inline |
|
inline |
std::vector< Point2D > lsst::afw::geom::Box2D::getCorners | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Increase the size of the box by the given buffer amount in all directions.
If a negative buffer is passed and the final size of the box is less than or equal to zero, the box will be made empty.
Definition at line 399 of file Box.h.
void lsst::afw::geom::Box2D::grow | ( | Extent2D const & | buffer | ) |
Increase the size of the box by the given buffer amount in each direction.
If a negative buffer is passed and the final size of the box is less than or equal to zero, the box will be made empty.
Definition at line 280 of file Box.cc.
void lsst::afw::geom::Box2D::include | ( | Point2D const & | point | ) |
Expand this to ensure that this->contains(point).
If the point sets a new maximum value for the box, the maximum coordinate will be adjusted to ensure the point is actually contained by the box instead of sitting on its exclusive upper edge.
Definition at line 317 of file Box.cc.
void lsst::afw::geom::Box2D::include | ( | Box2D const & | other | ) |
|
inline |
bool lsst::afw::geom::Box2D::operator!= | ( | Box2D const & | other | ) | const |
bool lsst::afw::geom::Box2D::operator== | ( | Box2D const & | other | ) | const |
bool lsst::afw::geom::Box2D::overlaps | ( | Box2D const & | other | ) | const |
Return true if any points in other are also in this.
Any overlap operation involving an empty box returns false.
Definition at line 275 of file Box.cc.
void lsst::afw::geom::Box2D::shift | ( | Extent2D const & | offset | ) |
|
inline |
Definition at line 455 of file Box.h.
|
static |
|
static |