mln::box< P > Struct Template Reference
[Basic types]

Generic box class: site set containing points of a regular grid. More...

#include <box.hh>

Inheritance diagram for mln::box< P >:

Inheritance graph

List of all members.

Public Types

enum  
 Dimension. More...
typedef box_bkd_piter_< P > bkd_piter
 Backward Site_Iterator associated type.
typedef P element
 Element associated type.
typedef box_fwd_piter_< P > fwd_piter
 Forward Site_Iterator associated type.
typedef fwd_piter piter
 Site_Iterator associated type.
typedef P psite
 Psite associated type.
typedef P site
 Site associated type.

Public Member Functions

const E & bbox () const
 Give the bounding box of this site set.
 box (const site &pmin, const site &pmax)
 Constructor of a box going from pmin to pmax.
 box ()
 Constructor without argument.
center () const
 Return the approximated central site of this box.
void crop_wrt (const box< P > &b)
 Crop this bbox in order to fit in the reference box b.
void enlarge (unsigned dim, unsigned b)
 Enlarge the box with a border b for dimension dim.
void enlarge (unsigned b)
 Enlarge the box with a border b.
bool has (const P &p) const
 Test if p belongs to the box.
bool is_empty () const
 Test if this box is empty.
bool is_valid () const
 Test that the box owns valid data, i.e., is initialized and with pmin being 'less-than' pmax.
unsigned len (unsigned i) const
 Give the length of the i-th side of the box.
std::size_t memory_size () const
 Return the size of this site set in memory.
unsigned nsites () const
 Give the number of sites of this box.
P & pmax ()
 Reference to the maximum point.
pmax () const
 Maximum point.
P & pmin ()
 Reference to the minimum point.
pmin () const
 Minimum point.
box< P > to_larger (unsigned b) const
 Give a larger box.
 box (typename P::coord ninds)

Related Functions

(Note that these are not member functions.)

template<typename Sl, typename Sr>
p_set< typename Sl::site > diff (const Site_Set< Sl > &lhs, const Site_Set< Sr > &rhs)
 Set theoretic difference of lhs and rhs.
template<typename Sl, typename Sr>
p_set< typename Sl::site > inter (const Site_Set< Sl > &lhs, const Site_Set< Sr > &rhs)
 Intersection between a couple of point sets.
template<typename Sl, typename Sr>
bool operator< (const Site_Set< Sl > &lhs, const Site_Set< Sr > &rhs)
 Strict inclusion test between site sets lhs and rhs.
template<typename Bl, typename Br>
bool operator< (const Box< Bl > &lhs, const Box< Br > &rhs)
 Strict inclusion test between boxes lhs and rhs.
template<typename S>
std::ostream & operator<< (std::ostream &ostr, const Site_Set< S > &set)
 Print a site set set into the output stream ostr.
template<typename P>
std::ostream & operator<< (std::ostream &ostr, const box< P > &b)
 Print a generic box b into the output stream ostr.
template<typename Sl, typename Sr>
bool operator<= (const Site_Set< Sl > &lhs, const Site_Set< Sr > &rhs)
 Inclusion test between site sets lhs and rhs.
template<typename Bl, typename Br>
bool operator<= (const Box< Bl > &lhs, const Box< Br > &rhs)
 Inclusion test between boxes lhs and rhs.
template<typename Sl, typename Sr>
bool operator== (const Site_Set< Sl > &lhs, const Site_Set< Sr > &rhs)
 Equality test between site sets lhs and rhs.
template<typename Sl, typename Sr>
p_set< typename Sl::site > sym_diff (const Site_Set< Sl > &lhs, const Site_Set< Sr > &rhs)
 Set theoretic symmetrical difference of lhs and rhs.
template<typename Sl, typename Sr>
p_set< typename Sl::site > uni (const Site_Set< Sl > &lhs, const Site_Set< Sr > &rhs)
 Union of a couple of point sets.
template<typename S>
p_set< typename S::site > unique (const Site_Set< S > &s)
 Give the unique set of s.


Detailed Description

template<typename P>
struct mln::box< P >

Generic box class: site set containing points of a regular grid.

Parameter P is the corresponding type of point.


Member Typedef Documentation

template<typename P>
typedef box_bkd_piter_<P> mln::box< P >::bkd_piter

Backward Site_Iterator associated type.

template<typename P>
typedef P mln::box< P >::element

Element associated type.

template<typename P>
typedef box_fwd_piter_<P> mln::box< P >::fwd_piter

Forward Site_Iterator associated type.

template<typename P>
typedef fwd_piter mln::box< P >::piter

Site_Iterator associated type.

template<typename P>
typedef P mln::box< P >::psite

Psite associated type.

template<typename P>
typedef P mln::box< P >::site

Site associated type.


Member Enumeration Documentation

template<typename P>
anonymous enum

Dimension.


Constructor & Destructor Documentation

template<typename P>
mln::box< P >::box (  )  [inline]

Constructor without argument.

template<typename P>
mln::box< P >::box ( const site pmin,
const site pmax 
) [inline]

Constructor of a box going from pmin to pmax.

References mln::box< P >::is_valid().

template<typename P>
mln::box< P >::box ( typename P::coord  ninds  )  [inline, explicit]

Constructors with different numbers of arguments (sizes) w.r.t. the dimension.

References mln::literal::origin.


Member Function Documentation

template<typename E>
const E & mln::Box< E >::bbox (  )  const [inline, inherited]

Give the bounding box of this site set.

Return the bounding box of this site set, so that is itself. This method is declared by the mln::Site_Set concept.

Warning:
This method is final for all box classes.

template<typename P>
P mln::box< P >::center (  )  const [inline]

Return the approximated central site of this box.

References mln::box< P >::is_valid().

template<typename P>
void mln::box< P >::crop_wrt ( const box< P > &  b  )  [inline]

Crop this bbox in order to fit in the reference box b.

References mln::box< P >::pmax(), and mln::box< P >::pmin().

Referenced by mln::make_debug_graph_image().

template<typename P>
void mln::box< P >::enlarge ( unsigned  dim,
unsigned  b 
) [inline]

Enlarge the box with a border b for dimension dim.

References mln::box< P >::is_valid().

template<typename P>
void mln::box< P >::enlarge ( unsigned  b  )  [inline]

Enlarge the box with a border b.

References mln::box< P >::is_valid().

Referenced by mln::registration::icp().

template<typename P>
bool mln::box< P >::has ( const P &  p  )  const [inline]

Test if p belongs to the box.

Parameters:
[in] p A point site.

References mln::box< P >::is_valid().

Referenced by mln::morpho::line_gradient().

template<typename E>
bool mln::Box< E >::is_empty (  )  const [inline, inherited]

Test if this box is empty.

template<typename P>
bool mln::box< P >::is_valid (  )  const [inline]

template<typename E>
unsigned mln::Box< E >::len ( unsigned  i  )  const [inline, inherited]

Give the length of the i-th side of the box.

Precondition:
i < site::dim
Warning:
This method is final for all box classes.

template<typename P>
std::size_t mln::box< P >::memory_size (  )  const [inline]

Return the size of this site set in memory.

template<typename E>
unsigned mln::Box< E >::nsites (  )  const [inline, inherited]

Give the number of sites of this box.

Return the number of sites of this box. This method is declared by the mln::Site_Set concept.

Warning:
This method is final for all box classes.

Referenced by mln::morpho::line_gradient().

template<typename P>
P & mln::box< P >::pmax (  )  [inline]

Reference to the maximum point.

template<typename P>
P mln::box< P >::pmax (  )  const [inline]

template<typename P>
P & mln::box< P >::pmin (  )  [inline]

Reference to the minimum point.

template<typename P>
P mln::box< P >::pmin (  )  const [inline]

template<typename P>
box< P > mln::box< P >::to_larger ( unsigned  b  )  const [inline]

Give a larger box.

References mln::box< P >::is_valid().


Friends And Related Function Documentation

template<typename Sl, typename Sr>
p_set< typename Sl::site > diff ( const Site_Set< Sl > &  lhs,
const Site_Set< Sr > &  rhs 
) [related, inherited]

Set theoretic difference of lhs and rhs.

template<typename Sl, typename Sr>
p_set< typename Sl::site > inter ( const Site_Set< Sl > &  lhs,
const Site_Set< Sr > &  rhs 
) [related, inherited]

Intersection between a couple of point sets.

template<typename Sl, typename Sr>
bool operator< ( const Site_Set< Sl > &  lhs,
const Site_Set< Sr > &  rhs 
) [related, inherited]

Strict inclusion test between site sets lhs and rhs.

Parameters:
[in] lhs A site set (strictly included?).
[in] rhs Another site set (includer?).

template<typename Bl, typename Br>
bool operator< ( const Box< Bl > &  lhs,
const Box< Br > &  rhs 
) [related, inherited]

Strict inclusion test between boxes lhs and rhs.

Parameters:
[in] lhs A box (strictly included?).
[in] rhs Another box (includor?).

template<typename S>
std::ostream & operator<< ( std::ostream &  ostr,
const Site_Set< S > &  set 
) [related, inherited]

Print a site set set into the output stream ostr.

Parameters:
[in,out] ostr An output stream.
[in] set A site set.
Returns:
The modified output stream ostr.

template<typename P>
std::ostream & operator<< ( std::ostream &  ostr,
const box< P > &  b 
) [related]

Print a generic box b into the output stream ostr.

Parameters:
[in,out] ostr An output stream.
[in] b A generic box.
Returns:
The modified output stream ostr.

template<typename Sl, typename Sr>
bool operator<= ( const Site_Set< Sl > &  lhs,
const Site_Set< Sr > &  rhs 
) [related, inherited]

Inclusion test between site sets lhs and rhs.

Parameters:
[in] lhs A site set (included?).
[in] rhs Another site set (includer?).

template<typename Bl, typename Br>
bool operator<= ( const Box< Bl > &  lhs,
const Box< Br > &  rhs 
) [related, inherited]

Inclusion test between boxes lhs and rhs.

Parameters:
[in] lhs A box (included?).
[in] rhs Another box (includor?).

template<typename Sl, typename Sr>
bool operator== ( const Site_Set< Sl > &  lhs,
const Site_Set< Sr > &  rhs 
) [related, inherited]

Equality test between site sets lhs and rhs.

Parameters:
[in] lhs A site set.
[in] rhs Another site set.

template<typename Sl, typename Sr>
p_set< typename Sl::site > sym_diff ( const Site_Set< Sl > &  lhs,
const Site_Set< Sr > &  rhs 
) [related, inherited]

Set theoretic symmetrical difference of lhs and rhs.

template<typename Sl, typename Sr>
p_set< typename Sl::site > uni ( const Site_Set< Sl > &  lhs,
const Site_Set< Sr > &  rhs 
) [related, inherited]

Union of a couple of point sets.

template<typename S>
p_set< typename S::site > unique ( const Site_Set< S > &  s  )  [related, inherited]

Give the unique set of s.


Generated on Thu Sep 9 19:30:15 2010 for Milena (Olena) by  doxygen 1.5.6