Represents an axis-aligned bounding box.
More...
#include <bounds.hpp>
|
| bounds_t () |
| Creates a bounds object. More...
|
|
| bounds_t (double minx, double miny, double maxx, double maxy) |
| Creates a bounds object from the given coordinates. More...
|
|
bounds_t & | extend (double x, double y) |
| Extends the bounds to contain the given point. More...
|
|
bounds_t & | extend (const bounds_t &b) |
| Extends the bounds to contain the given bounds. More...
|
|
std::tuple< double, double > | center () const |
|
std::tuple< double, double > | bottom_left () const |
|
std::tuple< double, double > | top_right () const |
|
std::tuple< double, double > | top_left () const |
|
std::tuple< double, double > | bottom_right () const |
|
bool | contains (double x, double y) const |
|
bool | contains (const bounds_t &other) |
|
bool | intersects (const bounds_t &other) |
|
bool | overlaps (const bounds_t &other) |
|
|
double | minx |
| the minimum x-coordinate
|
|
double | miny |
| the minimum y-coordinate
|
|
double | maxx |
| the maximum x-coordinate
|
|
double | maxy |
| the maximum y-coordinate
|
|
Represents an axis-aligned bounding box.
- Since
- 0.0.1
Definition at line 18 of file bounds.hpp.
simo::shapes::bounds_t::bounds_t |
( |
| ) |
|
|
inline |
Creates a bounds object.
- Since
- 0.0.1
Definition at line 37 of file bounds.hpp.
simo::shapes::bounds_t::bounds_t |
( |
double |
minx, |
|
|
double |
miny, |
|
|
double |
maxx, |
|
|
double |
maxy |
|
) |
| |
|
inline |
Creates a bounds object from the given coordinates.
- Parameters
-
minx | the x-coordinate of the first corner |
miny | the y-coordinate of the first corner |
maxx | the x-coordinate of the second corner |
maxy | the y-coordinate of the second corner |
- Since
- 0.0.1
Definition at line 55 of file bounds.hpp.
std::tuple<double, double> simo::shapes::bounds_t::bottom_left |
( |
| ) |
const |
|
inline |
- Returns
- a (x, y) tuple with the bottom left bounds
- Since
- 0.0.1
Definition at line 111 of file bounds.hpp.
std::tuple<double, double> simo::shapes::bounds_t::bottom_right |
( |
| ) |
const |
|
inline |
- Returns
- a (x, y) tuple with the bottom right bounds
- Since
- 0.0.1
Definition at line 141 of file bounds.hpp.
std::tuple<double, double> simo::shapes::bounds_t::center |
( |
| ) |
const |
|
inline |
- Returns
- a (x, y) tuple with the center of the bounds
- Since
- 0.0.1
Definition at line 101 of file bounds.hpp.
bool simo::shapes::bounds_t::contains |
( |
double |
x, |
|
|
double |
y |
|
) |
| const |
|
inline |
- Parameters
-
x | the x-coordinate of the point |
y | the y-coordinate of the point |
- Returns
- true if the bounds contains the given point, otherwise false
- Since
- 0.0.1
Definition at line 153 of file bounds.hpp.
bool simo::shapes::bounds_t::contains |
( |
const bounds_t & |
other | ) |
|
|
inline |
- Parameters
-
- Returns
- true if the bounds contain the given one, otherwise false
- Since
- 0.0.1
Definition at line 164 of file bounds.hpp.
bounds_t& simo::shapes::bounds_t::extend |
( |
double |
x, |
|
|
double |
y |
|
) |
| |
|
inline |
Extends the bounds to contain the given point.
- Parameters
-
x | the x-coordinate of the point |
y | the y-coordinate of the point |
- Returns
- the bounds object
- Since
- 0.0.1
Definition at line 69 of file bounds.hpp.
Extends the bounds to contain the given bounds.
- Parameters
-
x | the x-coordinate of the point |
y | the y-coordinate of the point |
- Returns
- the bounds object
- Since
- 0.0.1
Definition at line 87 of file bounds.hpp.
bool simo::shapes::bounds_t::intersects |
( |
const bounds_t & |
other | ) |
|
|
inline |
- Parameters
-
- Returns
- true if the bounds intersect the given one, otherwise false
- Since
- 0.0.1
Definition at line 175 of file bounds.hpp.
bool simo::shapes::bounds_t::overlaps |
( |
const bounds_t & |
other | ) |
|
|
inline |
- Parameters
-
- Returns
- true if the bounds overlaps the given one, otherwise false
- Since
- 0.0.1
Definition at line 186 of file bounds.hpp.
std::tuple<double, double> simo::shapes::bounds_t::top_left |
( |
| ) |
const |
|
inline |
- Returns
- a (x, y) tuple with the top left bounds
- Since
- 0.0.1
Definition at line 131 of file bounds.hpp.
std::tuple<double, double> simo::shapes::bounds_t::top_right |
( |
| ) |
const |
|
inline |
- Returns
- a (x, y) tuple with the top right bounds
- Since
- 0.0.1
Definition at line 121 of file bounds.hpp.
The documentation for this struct was generated from the following file:
- /home/travis/build/pavelsimo/shapes/include/simo/geom/detail/bounds.hpp