dakku::BoundsBase
bounding box base More...
#include <bounds.h>
Public Functions
Name | |
---|---|
BoundsBase() =default default constructor |
|
BoundsBase(const Point< T, S > & p) Construct a new Bounds2 with a point. |
|
template <ArithmeticType U> |
BoundsBase(const BoundsBase< U, S > & b) type conversion |
BoundsBase(const Point< T, S > & p1, const Point< T, S > & p2) Construct a new Bounds Base object with two points (take min/max of them to pMin and pMax) |
|
BoundsBase(const sol::table & table) | |
Vector< T, S > | diagonal() const get the diagonal of the bounding box |
size_t | max_extent() const get the dimension who has the maximum extent |
bool | operator==(const BoundsBase & rhs) const |
bool | operator!=(const BoundsBase & rhs) const |
Point< T, S > | lerp(const Point< float, S > & t) const linera interpolation between pMin and pMax |
Vector< T, S > | offset(const Point< T, S > & p) const get the offset \(v\) of a point, p = o + v * d |
bool | overlaps(const BoundsBase & rhs) const check whether two bounds overlaps |
bool | inside(const Point< T, S > & p) const check whether point is inside the bounds (inclusive) |
bool | inside_exclusive(const Point< T, S > & p) const check whether point is inside the bounds (exclusive) |
void | bounding_sphere(Point< T, S > & center, float & rad) get the bounding sphere of the bounds |
BoundsBase | union_bounds(const BoundsBase & rhs) const take the union of the two bounds |
BoundsBase | union_bounds(const Point< T, S > & p) const take the union between bounds and a point |
BoundsBase | intersect(const BoundsBase & rhs) const take the intersect between two bounds |
std::string | to_string() const |
Public Attributes
Name | |
---|---|
Point< T, S > | p_min left bottom corner of the bounds |
Point< T, S > | p_max right top corner of the bounds |
Friends
Name | |
---|---|
bool | overlaps(const BoundsBase & a, const BoundsBase & b) check whether two bounds overlaps |
bool | inside(const Point< T, S > & p, const BoundsBase & b) check whether point is inside the bounds (inclusive) |
bool | inside_exclusive(const Point< T, S > & p, const BoundsBase & b) check whether point is inside the bounds (exclusive) |
BoundsBase | **[operator |
BoundsBase | **[operator |
BoundsBase | operator&(const BoundsBase & a, const BoundsBase & b) take the intersect between two bounds |
decltype(auto) | distance_squared(const Point< T, S > & p, const BoundsBase< T, S > & b) minimum squared distance between point and bounds, if inside return 0 |
decltype(auto) | distance(const Point< T, S > & p, const BoundsBase< T, S > & b) minimum distance between point and bounds, if inside return 0 |
std::ostream & | operator<<(std::ostream & os, const BoundsBase & b) |
Detailed Description
bounding box base
Template Parameters:
- T data type
- S dimension
Public Functions Documentation
function BoundsBase
default constructor
function BoundsBase
Construct a new Bounds2 with a point.
Parameters:
- p the given point
function BoundsBase
type conversion
function BoundsBase
Construct a new Bounds Base object with two points (take min/max of them to pMin and pMax)
function BoundsBase
function diagonal
get the diagonal of the bounding box
function max_extent
get the dimension who has the maximum extent
Return: the dimension
function operator==
function operator!=
function lerp
linera interpolation between pMin and pMax
Parameters:
- t interpolate \(t\) (element wise)
function offset
get the offset \(v\) of a point, p = o + v * d
Parameters:
- p the point
Return: the offset
function overlaps
check whether two bounds overlaps
function inside
check whether point is inside the bounds (inclusive)
Parameters:
- p the point
function inside_exclusive
check whether point is inside the bounds (exclusive)
Parameters:
- p the point
function bounding_sphere
get the bounding sphere of the bounds
Parameters:
- center the center of the sphere
- rad the radius of the sphere
function union_bounds
take the union of the two bounds
function union_bounds
take the union between bounds and a point
function intersect
take the intersect between two bounds
function to_string
Public Attributes Documentation
variable p_min
left bottom corner of the bounds
variable p_max
right top corner of the bounds
Friends
friend overlaps
check whether two bounds overlaps
friend inside
check whether point is inside the bounds (inclusive)
Parameters:
- p the point
- b the bounds
friend inside_exclusive
check whether point is inside the bounds (exclusive)
Parameters:
- p the point
- b the bounds
friend operator|
take the union of the two bounds
friend operator|
take the union between bounds and a point
friend operator&
take the intersect between two bounds
friend distance_squared
minimum squared distance between point and bounds, if inside return 0
Parameters:
- p the point
- b the bounds
Return: the squared distance
friend distance
minimum distance between point and bounds, if inside return 0
Parameters:
- p the point
- b the bounds
Return: the distance
friend operator<<
Updated on 2022-04-30 at 15:46:11 +0000