Antkeeper
0.0.1
|
n-dimensional axis-aligned rectangle. More...
#include <hyperrectangle.hpp>
Public Types | |
using | vector_type = math::vector< T, N > |
Vector type. More... | |
Public Member Functions | |
constexpr bool | contains (const vector_type &point) const noexcept |
Tests whether a point is contained within this hyperrectangle. More... | |
constexpr bool | contains (const hyperrectangle &other) const noexcept |
Tests whether another hyperrectangle is contained within this hyperrectangle. More... | |
constexpr vector_type | center () const noexcept |
Returns the center position of the hyperrectangle. More... | |
T | distance (const vector_type &point) const noexcept |
Calculates the signed distance from the hyperrectangle to a point. More... | |
constexpr vector_type | closest_point (const vector_type &point) const noexcept |
Calculates the closest point on the hyperrectangle to a point. More... | |
void | extend (const vector_type &point) noexcept |
Extends the hyperrectangle to include a point. More... | |
void | extend (const hyperrectangle &other) noexcept |
Extends the hyperrectangle to include another hyperrectangle. More... | |
constexpr bool | intersects (const hyperrectangle &other) const noexcept |
Tests whether another hyperrectangle intersects this hyperrectangle. More... | |
constexpr vector_type | size () const noexcept |
Calculates the size of the hyperrectangle. More... | |
constexpr vector_type | extents () const noexcept |
Calculates the extents of the hyperrectangle. More... | |
constexpr bool | valid () const noexcept |
Returns false if any coordinates of min are greater than max . More... | |
constexpr T | volume () const noexcept |
Calculates the volume of the hyperrectangle. More... | |
Public Attributes | |
vector_type | min |
Minimum extent of the hyperrectangle. More... | |
vector_type | max |
Maximum extent of the hyperrectangle. More... | |
n-dimensional axis-aligned rectangle.
T | Real type. |
N | Number of dimensions. |
Definition at line 37 of file hyperrectangle.hpp.
using geom::primitive::hyperrectangle< T, N >::vector_type = math::vector<T, N> |
Vector type.
Definition at line 40 of file hyperrectangle.hpp.
|
inlineconstexprnoexcept |
Returns the center position of the hyperrectangle.
Definition at line 87 of file hyperrectangle.hpp.
|
inlineconstexprnoexcept |
Calculates the closest point on the hyperrectangle to a point.
point | Input point. |
point
. Definition at line 112 of file hyperrectangle.hpp.
|
inlineconstexprnoexcept |
Tests whether another hyperrectangle is contained within this hyperrectangle.
other | Hyperrectangle to test for containment. |
true
if the hyperrectangle is contained within this hyperrectangle, false
otherwise. Definition at line 74 of file hyperrectangle.hpp.
|
inlineconstexprnoexcept |
Tests whether a point is contained within this hyperrectangle.
point | Point to test for containment. |
true
if the point is contained within this hyperrectangle, false
otherwise. Definition at line 55 of file hyperrectangle.hpp.
|
inlinenoexcept |
Calculates the signed distance from the hyperrectangle to a point.
point | Input point. |
point
. Definition at line 99 of file hyperrectangle.hpp.
|
inlinenoexcept |
Extends the hyperrectangle to include another hyperrectangle.
other | Hyperrectangle to include in this hyperrectangle. |
Definition at line 144 of file hyperrectangle.hpp.
|
inlinenoexcept |
Extends the hyperrectangle to include a point.
point | Point to include in the hyperrectangle. |
Definition at line 133 of file hyperrectangle.hpp.
|
inlineconstexprnoexcept |
Calculates the extents of the hyperrectangle.
Definition at line 176 of file hyperrectangle.hpp.
|
inlineconstexprnoexcept |
Tests whether another hyperrectangle intersects this hyperrectangle.
other | Hyperrectangle to test for intersection. |
true
if the hyperrectangle intersects this hyperrectangle, false
otherwise. Definition at line 157 of file hyperrectangle.hpp.
|
inlineconstexprnoexcept |
Calculates the size of the hyperrectangle.
Definition at line 170 of file hyperrectangle.hpp.
|
inlineconstexprnoexcept |
Returns false
if any coordinates of min
are greater than max
.
Definition at line 184 of file hyperrectangle.hpp.
|
inlineconstexprnoexcept |
Calculates the volume of the hyperrectangle.
Definition at line 197 of file hyperrectangle.hpp.
vector_type geom::primitive::hyperrectangle< T, N >::max |
Maximum extent of the hyperrectangle.
Definition at line 46 of file hyperrectangle.hpp.
vector_type geom::primitive::hyperrectangle< T, N >::min |
Minimum extent of the hyperrectangle.
Definition at line 43 of file hyperrectangle.hpp.