|
| | Box2D () noexcept |
| | Construct an empty box.
|
| | Box2D (Point2D const &minimum, Point2D const &maximum, bool invert=true) noexcept |
| | Construct a box from its minimum and maximum points.
|
| | Box2D (Point2D const &corner, Extent2D const &dimensions, bool invert=true) noexcept |
| | Construct a box from one corner and dimensions.
|
| | Box2D (Interval const &x, Interval const &y) |
| | Construct a box from a pair of intervals.
|
| | Box2D (Box2I const &other) noexcept |
| | Construct a floating-point box from an integer box.
|
| | Box2D (Box2D const &) noexcept=default |
| | Standard copy constructor.
|
| | Box2D (Box2D &&) noexcept=default |
| | ~Box2D () noexcept=default |
| void | swap (Box2D &other) noexcept |
| Box2D & | operator= (Box2D const &) noexcept=default |
| | Standard assignment operator.
|
| Box2D & | operator= (Box2D &&) noexcept=default |
Return the minimum (inclusive) and maximum (exclusive) coordinates of the box.
|
| Point2D const | getMin () const noexcept |
| double | getMinX () const noexcept |
| double | getMinY () const noexcept |
| Point2D const | getMax () const noexcept |
| double | getMaxX () const noexcept |
| double | getMaxY () const noexcept |
Return the size of the box.
|
| Extent2D const | getDimensions () const noexcept |
| | 1-d interval accessors
|
| double | getWidth () const noexcept |
| | 1-d interval accessors
|
| double | getHeight () const noexcept |
| | 1-d interval accessors
|
| double | getArea () const noexcept |
| | 1-d interval accessors
|
| Interval | getX () const |
| | 1-d interval accessors
|
| Interval | getY () const |
| | 1-d interval accessors
|
|
Return the center coordinate of the box.
|
| Point2D const | getCenter () const noexcept |
| | Return true if the box contains no points.
|
| double | getCenterX () const noexcept |
| | Return true if the box contains no points.
|
| double | getCenterY () const noexcept |
| | Return true if the box contains no points.
|
| bool | isEmpty () const noexcept |
| | Return true if the box contains no points.
|
| bool | contains (Point2D const &point) const noexcept |
| | Return true if the box contains the point.
|
| bool | contains (Element x, Element y) const noexcept |
| | Return true if the box contains no points.
|
| bool | contains (Box2D const &other) const |
| | Return true if all points contained by other are also contained by this.
|
| bool | overlaps (Box2D const &other) const noexcept |
| | Return true if any points in other are also in this.
|
| bool | intersects (Box2D const &other) const noexcept |
| | Return true if the box contains no points.
|
| bool | isDisjointFrom (Box2D const &other) const noexcept |
| | Return true if there are no points in both this and other.
|
| void | grow (double buffer) |
| | Increase the size of the box by the given buffer amount in all directions.
|
| void | grow (Extent2D const &buffer) |
| | Increase the size of the box by the given buffer amount in each direction.
|
| void | shift (Extent2D const &offset) |
| | Shift the position of the box by the given offset.
|
| void | flipLR (float xExtent) |
| | Flip a bounding box about the y-axis given a parent box of extent (xExtent).
|
| void | flipTB (float yExtent) |
| | Flip a bounding box about the x-axis given a parent box of extent (yExtent).
|
| void | include (Point2D const &point) noexcept |
| | Expand this to ensure that this->contains(point).
|
| void | include (Box2D const &other) noexcept |
| | Expand this to ensure that this->contains(other).
|
| void | clip (Box2D const &other) noexcept |
| | Shrink this to ensure that other.contains(*this).
|
| Box2D | dilatedBy (Extent const &buffer) const |
| | Increase the size of the box by the given amount(s) on all sides (returning a new object).
|
| Box2D | dilatedBy (Element buffer) const |
| | Return true if the box contains no points.
|
| Box2D | erodedBy (Extent const &buffer) const |
| | Decrease the size of the box by the given amount(s) on all sides (returning a new object).
|
| Box2D | erodedBy (Element buffer) const |
| | Return true if the box contains no points.
|
| Box2D | shiftedBy (Extent const &offset) const |
| | Shift the position of the box by the given offset (returning a new object).
|
| Box2D | reflectedAboutX (Element x) const |
| | Reflect the box about a vertical line (returning a new object).
|
| Box2D | reflectedAboutY (Element y) const |
| | Reflect the box about a horizontal line (returning a new object).
|
| Box2D | expandedTo (Point const &other) const |
| | Expand a box to ensure that contains(other) is true (returning a new object).
|
| Box2D | expandedTo (Box2D const &other) const |
| | Expand a box to ensure that contains(other) is true (returning a new object).
|
| Box2D | clippedTo (Box2D const &other) const |
| | Shrink a box to ensure that it is contained by other (returning a new object).
|
| bool | operator== (Box2D const &other) const noexcept |
| | Compare two boxes for equality.
|
| bool | operator!= (Box2D const &other) const noexcept |
| | Compare two boxes for equality.
|
| std::size_t | hash_value () const noexcept |
| | Return a hash of this object.
|
| std::vector< Point2D > | getCorners () const |
| | Get the corner points.
|
| std::string | toString () const |
| | Return true if the box contains no points.
|
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.
Definition at line 413 of file Box.h.