#include <Box.hpp>
Public Member Functions | |
Box (const ublas::fixed_vector< float_t, N > &lower_corner, const ublas::fixed_vector< float_t, N > &upper_corner) | |
template<class image_accessor_t> | |
Box (const image_accessor_t &accessor) | |
void | set_empty () |
bool | is_empty () const |
float_t | compute_volume () const |
void | add_point (const ublas::fixed_vector< float_t, N > &point) |
Friends | |
void | compute_intersection_box (const Box< N > &box_a, const Box< N > &box_b, Box< N > &result) |
This class templates implements an N-dimensional hyperrectangle. For N = 2 class objects are rectangles, for N = 3 cuboids. The boxes are assumed to be aligned with the coordinate axes. I.e. each box is fully determined by two corner vertices.
imaging::Box< N >::Box | ( | const ublas::fixed_vector< float_t, N > & | lower_corner, | |
const ublas::fixed_vector< float_t, N > & | upper_corner | |||
) | [inline] |
Constructs a box from its two opposite corner vertices.
imaging::Box< N >::Box | ( | const image_accessor_t & | accessor | ) | [inline] |
Constructs the bounding box of the image accessor accessor.
void imaging::Box< N >::set_empty | ( | ) | [inline] |
Sets the box to the empty box.
bool imaging::Box< N >::is_empty | ( | ) | const [inline] |
Returns true if the box is empty.
Referenced by imaging::Box< N >::compute_volume(), and imaging::do_intersect().
float_t imaging::Box< N >::compute_volume | ( | ) | const [inline] |
Computes the volume of the box.
References imaging::Box< N >::is_empty().
Referenced by imaging::compute_intersection_volume().
void imaging::Box< N >::add_point | ( | const ublas::fixed_vector< float_t, N > & | point | ) | [inline] |
Determines if point lies within the box. If this is not the case the box is resized to the smalles box enclosing point and the original box.
Referenced by imaging::compute_intersection_volume().
void compute_intersection_box | ( | const Box< N > & | box_a, | |
const Box< N > & | box_b, | |||
Box< N > & | result | |||
) | [friend] |
#include <shape/Box.hpp>
Computes the intersection of two N-dimensional boxes and writes it to result.