Easy3D 2.5.3
GenericBox< DIM, FT > Class Template Reference

GenericBox represents the bounding box of shapes. More...

#include <easy3d/core/box.h>

Public Types

typedef Vec< DIM, FT > Point
 
typedef Vec< DIM, FT > Vector
 
typedef GenericBox< DIM, FT > thisclass
 

Public Member Functions

 GenericBox ()
 
 GenericBox (const Point &pmin, const Point &pmax)
 
 GenericBox (const Point &c, FT r)
 
bool is_valid () const
 
void clear ()
 
const Pointmin_point () const
 
Pointmin_point ()
 
const Pointmax_point () const
 
Pointmax_point ()
 
FT min_coord (unsigned int axis) const
 
FT max_coord (unsigned int axis) const
 
FT range (unsigned int axis) const
 
FT max_range () const
 
FT min_range () const
 
unsigned int max_range_axis () const
 
unsigned int min_range_axis () const
 
Point center () const
 
Vector diagonal_vector () const
 
FT diagonal_length () const
 
FT radius () const
 
FT surface_area () const
 
void grow (const Point &p)
 
void grow (const thisclass &b)
 
thisclass operator+ (const thisclass &b) const
 
thisclassoperator+= (const thisclass &b)
 
bool contains (Point const &p) const
 
bool contains (thisclass const &b) const
 
bool intersects (thisclass const &b) const
 

Detailed Description

template<int DIM, typename FT>
class easy3d::GenericBox< DIM, FT >

GenericBox represents the bounding box of shapes.

Template Parameters
DIMThe dimension (i.e., 2 or 3).
FTThe type of the floating point number (i.e., float or double).

Constructor & Destructor Documentation

◆ GenericBox() [1/3]

GenericBox ( )
inline

Construct a box uninitialized (which is invalid).

◆ GenericBox() [2/3]

GenericBox ( const Point pmin,
const Point pmax 
)
inline

Construct a box from its diagonal corners.

◆ GenericBox() [3/3]

GenericBox ( const Point c,
FT  r 
)
inline

Construct a box from its center and radius.

Member Function Documentation

◆ center()

Point center ( ) const
inline

Return the center of the box.

◆ clear()

void clear ( )
inline

Invalidate the box.

◆ contains() [1/2]

bool contains ( Point const &  p) const
inline

Does this box contain a point p.

◆ contains() [2/2]

bool contains ( thisclass const &  b) const
inline

Does this box contain another box b.

◆ diagonal_length()

FT diagonal_length ( ) const
inline

Return the length of the diagonal of the box.

◆ diagonal_vector()

Vector diagonal_vector ( ) const
inline

Return the diagonal vector of the box.

◆ grow() [1/2]

void grow ( const Point p)
inline

Add a point to this box. This will compute its new extent.

◆ grow() [2/2]

void grow ( const thisclass b)
inline

Add a box to this box. This will compute its new extent.

◆ intersects()

bool intersects ( thisclass const &  b) const
inline

Does this box intersect another box b.

◆ is_valid()

bool is_valid ( ) const
inline

Is the box valid.

◆ max_coord()

FT max_coord ( unsigned int  axis) const
inline

Return a component of the coordinates of the max corner. axis must be in [0, DIM).

◆ max_point() [1/2]

Point & max_point ( )
inline

Return the coordinates of the max corner.

◆ max_point() [2/2]

const Point & max_point ( ) const
inline

Return the coordinates of the max corner.

◆ max_range()

FT max_range ( ) const
inline

Return the max range.

◆ max_range_axis()

unsigned int max_range_axis ( ) const
inline

Return the axis index of the max range of the box.

◆ min_coord()

FT min_coord ( unsigned int  axis) const
inline

Return a component of the coordinates of the min corner. axis must be in [0, DIM).

◆ min_point() [1/2]

Point & min_point ( )
inline

Return the coordinates of the min corner.

◆ min_point() [2/2]

const Point & min_point ( ) const
inline

Return the coordinates of the min corner.

◆ min_range()

FT min_range ( ) const
inline

Return the min range.

◆ min_range_axis()

unsigned int min_range_axis ( ) const
inline

Return the axis index of the min range of the box.

◆ operator+()

thisclass operator+ ( const thisclass b) const
inline

Return the bounding box of 'this' and another box b.

◆ operator+=()

thisclass & operator+= ( const thisclass b)
inline

Modify this box by adding another box b.

◆ radius()

FT radius ( ) const
inline

Return the radius of the box (i.e., half of its diagonal length).

◆ range()

FT range ( unsigned int  axis) const
inline

Return the range of the box along the axis. axis must be in [0, DIM).

◆ surface_area()

FT surface_area ( ) const
inline

Return the surface area of the box.


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