Public Types | Public Member Functions | Protected Member Functions | Related Functions

mln::Box< E > Struct Template Reference

Base class for implementation classes of boxes. More...

#include <box.hh>

Inheritance diagram for mln::Box< E >:
Inheritance graph

List of all members.

Public Types

typedef Site_Set< void > category
typedef E exact_t
typedef const E & q_box

Public Member Functions

const E & bbox () const
 Give the bounding box of this site set.
bool is_empty () const
 Test if this box is empty.
unsigned len (unsigned i) const
 Give the length of the i-th side of the box.
unsigned nsites () const
 Give the number of sites of this box.

Protected Member Functions

 Box ()

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 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 E>
struct mln::Box< E >

Base class for implementation classes of boxes.

Boxes are particular site sets useful to bound any set of sites defined on a regular grid.

See also:
mln::doc::Box for a complete documentation of this class contents.

Member Typedef Documentation

template<typename E>
typedef Site_Set<void> mln::Site_Set< E >::category [inherited]

Reimplemented from mln::Object< E >.

template<typename E>
typedef E mln::Object< E >::exact_t [inherited]
template<typename E>
typedef const E& mln::Box< E >::q_box

Constructor & Destructor Documentation

template<typename E >
mln::Box< E >::Box (  )  [inline, protected]

Member Function Documentation

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

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.

References mln::exact().

Referenced by mln::geom::impl::bbox_().

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

Test if this box is empty.

References mln::exact().

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

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

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

References mln::exact().

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

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.

References mln::exact().

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


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]

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 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]

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.