cgv
|
#include <axis_aligned_box.h>
Public Types | |
typedef cgv::math::fvec< T, N > | fpnt_type |
internally fixed sized points and vectors are used | |
typedef cgv::math::vec< T > | pnt_type |
the interface allows also to work with variable sized points | |
Public Member Functions | |
axis_aligned_box () | |
standard constructor does not initialize | |
template<typename S > | |
axis_aligned_box (const axis_aligned_box< S, N > &B) | |
type conversion copy constructor | |
axis_aligned_box (const fpnt_type &_minp, const fpnt_type &_maxp) | |
construct from min point and max point | |
axis_aligned_box (const pnt_type &_minp, const pnt_type &_maxp) | |
construct from min point and max point | |
void | invalidate () |
set to invalid min and max points | |
const fpnt_type & | get_min_pnt () const |
return a const reference to corner 0 | |
const fpnt_type & | get_max_pnt () const |
return a const reference to corner 7 | |
fpnt_type & | ref_min_pnt () |
return a reference to corner 0 | |
fpnt_type & | ref_max_pnt () |
return a reference to corner 7 | |
fpnt_type | get_corner (int i) const |
return the i-th corner where the lower N bits of i are used to select between min (bit = 0) and max (bit = 1) coordinate | |
fvec_type | get_alpha (const fvec_type &p) const |
return a vector containing linear interpolation parameter values in the different dimensions | |
fvec_type | get_extent () const |
return a vector with the extents in the different dimensions | |
fpnt_type | get_center () const |
return the center of the box | |
bool | is_valid () const |
check if aab is valid | |
bool | inside (const fpnt_type &p) const |
check whether a point is inside the aabb | |
void | add_point (const fpnt_type &p) |
extent box to include given point | |
void | add_point (const pnt_type &p) |
extent box to include given point | |
void | add_axis_aligned_box (const axis_aligned_box< T, N > &aab) |
extent box to include given axis alinged box | |
void | scale (const T &f) |
scale the complete box with respect to the world coordinate origin | |
void | translate (const fpnt_type &v) |
translate box by vector | |
unsigned | get_max_extent_coord_index () const |
return the index of the coordinte with maximum extend | |
An axis aligned box, defined by to points: min and max