MeshLib
 
Loading...
Searching...
No Matches
MR::Box< V > Struct Template Reference

Box given by its min- and max- corners. More...

#include <MRBox.h>

Public Types

using T = typename V::ValueType
 

Public Member Functions

const V & operator[] (int e) const
 min/max access by 0/1 index
 
V & operator[] (int e)
 
 Box ()
 create invalid box by default
 
 Box (NoInit)
 
 Box (const V &min, const V &max)
 
template<typename U >
 Box (const Box< U > &a)
 
bool valid () const
 true if the box contains at least one point
 
center () const
 computes center of the box
 
size () const
 computes size of the box in all dimensions
 
T diagonal () const
 computes length from min to max
 
T volume () const
 computes the volume of this box
 
void include (const V &pt)
 minimally increases the box to include given point
 
void include (const Box &b)
 minimally increases the box to include another box
 
bool contains (const V &pt) const
 checks whether given point is inside (including the surface) of the box
 
getBoxClosestPointTo (const V &pt) const
 returns closest point in the box to given point
 
bool intersects (const Box &b) const
 checks whether this box intersects or touches given box
 
Box intersection (const Box &b) const
 computes intersection between this and other box
 
Boxintersect (const Box &b)
 
T getDistanceSq (const Box &b) const
 
T getDistanceSq (const V &pt) const
 
Box insignificantlyExpanded () const
 expands min and max to their closest representable value
 
bool operator== (const Box &a) const
 
bool operator!= (const Box &a) const
 

Static Public Member Functions

static Box fromMinAndSize (const V &min, const V &size)
 

Public Attributes

min
 
max
 

Detailed Description

template<typename V>
struct MR::Box< V >

Box given by its min- and max- corners.

Member Typedef Documentation

◆ T

template<typename V >
using MR::Box< V >::T = typename V::ValueType

Constructor & Destructor Documentation

◆ Box() [1/4]

template<typename V >
MR::Box< V >::Box ( )
inline

create invalid box by default

◆ Box() [2/4]

template<typename V >
MR::Box< V >::Box ( NoInit )
inlineexplicit

◆ Box() [3/4]

template<typename V >
MR::Box< V >::Box ( const V & min,
const V & max )
inline

◆ Box() [4/4]

template<typename V >
template<typename U >
MR::Box< V >::Box ( const Box< U > & a)
inlineexplicit

Member Function Documentation

◆ center()

template<typename V >
V MR::Box< V >::center ( ) const
inline

computes center of the box

◆ contains()

template<typename V >
bool MR::Box< V >::contains ( const V & pt) const
inline

checks whether given point is inside (including the surface) of the box

◆ diagonal()

template<typename V >
T MR::Box< V >::diagonal ( ) const
inline

computes length from min to max

◆ fromMinAndSize()

template<typename V >
static Box MR::Box< V >::fromMinAndSize ( const V & min,
const V & size )
inlinestatic

◆ getBoxClosestPointTo()

template<typename V >
V MR::Box< V >::getBoxClosestPointTo ( const V & pt) const
inline

returns closest point in the box to given point

◆ getDistanceSq() [1/2]

template<typename V >
T MR::Box< V >::getDistanceSq ( const Box< V > & b) const
inline

returns squared distance between this box and given one; returns zero if the boxes touch or intersect

◆ getDistanceSq() [2/2]

template<typename V >
T MR::Box< V >::getDistanceSq ( const V & pt) const
inline

returns squared distance between this box and given point; returns zero if the point is inside or on the boundary of the box

◆ include() [1/2]

template<typename V >
void MR::Box< V >::include ( const Box< V > & b)
inline

minimally increases the box to include another box

◆ include() [2/2]

template<typename V >
void MR::Box< V >::include ( const V & pt)
inline

minimally increases the box to include given point

◆ insignificantlyExpanded()

template<typename V >
Box MR::Box< V >::insignificantlyExpanded ( ) const
inline

expands min and max to their closest representable value

◆ intersect()

template<typename V >
Box & MR::Box< V >::intersect ( const Box< V > & b)
inline

◆ intersection()

template<typename V >
Box MR::Box< V >::intersection ( const Box< V > & b) const
inline

computes intersection between this and other box

◆ intersects()

template<typename V >
bool MR::Box< V >::intersects ( const Box< V > & b) const
inline

checks whether this box intersects or touches given box

◆ operator!=()

template<typename V >
bool MR::Box< V >::operator!= ( const Box< V > & a) const
inline

◆ operator==()

template<typename V >
bool MR::Box< V >::operator== ( const Box< V > & a) const
inline

◆ operator[]() [1/2]

template<typename V >
V & MR::Box< V >::operator[] ( int e)
inline

◆ operator[]() [2/2]

template<typename V >
const V & MR::Box< V >::operator[] ( int e) const
inline

min/max access by 0/1 index

◆ size()

template<typename V >
V MR::Box< V >::size ( ) const
inline

computes size of the box in all dimensions

◆ valid()

template<typename V >
bool MR::Box< V >::valid ( ) const
inline

true if the box contains at least one point

◆ volume()

template<typename V >
T MR::Box< V >::volume ( ) const
inline

computes the volume of this box

Member Data Documentation

◆ max

template<typename V >
V MR::Box< V >::max

◆ min

template<typename V >
V MR::Box< V >::min

The documentation for this struct was generated from the following files: