imaging::Box< N > Class Template Reference
[Shape Module]

N-dimensional box (hyperrectangle). More...

#include <Box.hpp>

List of all members.

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)


void compute_intersection_box (const Box< N > &box_a, const Box< N > &box_b, Box< N > &result)

Detailed Description

template<std::size_t N>
class imaging::Box< N >

N-dimensional box (hyperrectangle).

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.

Constructor & Destructor Documentation

template<std::size_t N>
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.

template<std::size_t N>
template<class image_accessor_t>
imaging::Box< N >::Box ( const image_accessor_t &  accessor  )  [inline]

Constructs the bounding box of the image accessor accessor.

Member Function Documentation

template<std::size_t N>
void imaging::Box< N >::set_empty (  )  [inline]

Sets the box to the empty box.

template<std::size_t N>
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().

template<std::size_t N>
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().

template<std::size_t N>
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().

Friends And Related Function Documentation

template<std::size_t N>
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.

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

Generated on Tue Feb 10 10:01:31 2009 for imaging2 by  doxygen 1.5.5