pbpt
Loading...
Searching...
No Matches
pbpt::math::BoundingBox< T, N > Class Template Reference

Public Member Functions

template<typename ... Args>
requires (std::is_same_v<Point<T, N>, Args> && ...) && (sizeof...(Args) > 0)
constexpr BoundingBox (const Args &... args) noexcept
constexpr BoundingBoxunite (const Point< T, N > &point) noexcept
constexpr BoundingBoxunite (const BoundingBox &box) noexcept
constexpr BoundingBoxunite (const std::vector< Point< T, N > > &points) noexcept
constexpr BoundingBoxunite (const std::vector< BoundingBox > &boxes) noexcept
constexpr BoundingBox united (const Point< T, N > &point) const noexcept
constexpr BoundingBoxunited (const BoundingBox &box) noexcept
constexpr BoundingBox united (const std::vector< Point< T, N > > &points) const noexcept
constexpr BoundingBox united (const std::vector< BoundingBox > &boxes) const noexcept
constexpr bool is_overlapped (const BoundingBox &box) const noexcept
 is_overlapped
constexpr BoundingBox overlapped_box (const BoundingBox &box) const noexcept
 Get the overlapped box.
constexpr bool contains (const Point< T, N > &point) const noexcept
 Check if the bounding box contains the point.
constexpr int max_extent () const noexcept
 Get the maximum extent of the bounding box.
constexpr Vector< T, N > offset (const Point< T, N > &p) const noexcept
 Get the offset of the point relative to the bounding box.
constexpr const Point< T, N > & min () const noexcept
 Get the minimum point of the bounding box.
constexpr const Point< T, N > & max () const noexcept
 Get the maximum point of the bounding box.
constexpr Point< T, N > center () const noexcept
 Get the center point of the bounding box.
constexpr Vector< T, N > diagonal () const noexcept
 Get the diagonal of the bounding box.
constexpr T volume () const noexcept
 Get the volume of the bounding box.
constexpr T surface_area () const noexcept
 Get the surface area of the bounding box.

Friends

std::ostream & operator<< (std::ostream &os, const BoundingBox &box)
 stream output

Member Function Documentation

◆ center()

template<typename T, int N>
Point< T, N > pbpt::math::BoundingBox< T, N >::center ( ) const
inlineconstexprnoexcept

Get the center point of the bounding box.

Returns
The center point.

◆ contains()

template<typename T, int N>
bool pbpt::math::BoundingBox< T, N >::contains ( const Point< T, N > & point) const
inlineconstexprnoexcept

Check if the bounding box contains the point.

Parameters
pointThe point.
Returns
True if the bounding box contains the point, false otherwise.

◆ diagonal()

template<typename T, int N>
Vector< T, N > pbpt::math::BoundingBox< T, N >::diagonal ( ) const
inlineconstexprnoexcept

Get the diagonal of the bounding box.

Returns
The diagonal.

◆ is_overlapped()

template<typename T, int N>
bool pbpt::math::BoundingBox< T, N >::is_overlapped ( const BoundingBox< T, N > & box) const
inlineconstexprnoexcept

is_overlapped

Parameters
box
Returns
true if overlapped, false otherwise

◆ max()

template<typename T, int N>
const Point< T, N > & pbpt::math::BoundingBox< T, N >::max ( ) const
inlineconstexprnoexcept

Get the maximum point of the bounding box.

Returns
The maximum point.

◆ max_extent()

template<typename T, int N>
int pbpt::math::BoundingBox< T, N >::max_extent ( ) const
inlineconstexprnoexcept

Get the maximum extent of the bounding box.

Returns
The maximum extent.

◆ min()

template<typename T, int N>
const Point< T, N > & pbpt::math::BoundingBox< T, N >::min ( ) const
inlineconstexprnoexcept

Get the minimum point of the bounding box.

Returns
The minimum point.

◆ offset()

template<typename T, int N>
Vector< T, N > pbpt::math::BoundingBox< T, N >::offset ( const Point< T, N > & p) const
inlineconstexprnoexcept

Get the offset of the point relative to the bounding box.

Parameters
pThe point.
Returns
The offset.

◆ overlapped_box()

template<typename T, int N>
BoundingBox pbpt::math::BoundingBox< T, N >::overlapped_box ( const BoundingBox< T, N > & box) const
inlineconstexprnoexcept

Get the overlapped box.

Parameters
boxThe bounding box.
Returns
The overlapped box.

◆ surface_area()

template<typename T, int N>
T pbpt::math::BoundingBox< T, N >::surface_area ( ) const
inlineconstexprnoexcept

Get the surface area of the bounding box.

Returns
The surface area.

◆ volume()

template<typename T, int N>
T pbpt::math::BoundingBox< T, N >::volume ( ) const
inlineconstexprnoexcept

Get the volume of the bounding box.

Returns
The volume.

◆ operator<<

template<typename T, int N>
std::ostream & operator<< ( std::ostream & os,
const BoundingBox< T, N > & box )
friend

stream output

Parameters
os
box
Returns
std::ostream&

The documentation for this class was generated from the following file: