oln::morpho::attr::box_type< I, Exact > Class Template Reference

Box attribute. More...

#include <attributes.hh>

Inheritance diagram for oln::morpho::attr::box_type< I, Exact >:

Inheritance graph
[legend]
Collaboration diagram for oln::morpho::attr::box_type< I, Exact >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef box_type< I, Exact > self_type
 Self type of the class.

typedef mlc::exact_vt< self_type,
Exact >::ret 
exact_type
typedef oln::morpho::attr::attr_traits<
exact_type >::value_type 
value_type
typedef oln::morpho::attr::attr_traits<
exact_type >::env_type 
env_type
typedef oln::morpho::attr::attr_traits<
exact_type >::lambda_type 
lambda_type
typedef abstract::image< typename
mlc::exact< I >::ret
im_type
 Image type.

typedef mlc::exact< im_type
>::ret::point_type 
point_type
 Point type associated to im_type.

typedef mlc::exact< im_type
>::ret::dpoint_type 
dpoint_type
 Dpoint type associated to im_type.

enum  { dim = point_traits<point_type>::dim }

Public Member Functions

 box_type (const lambda_type &lambda)
 Ctor from a lambda_type value.

 box_type ()
 Basic Ctor.

 box_type (const im_type &, const point_type &p, const env_type &)
 Ctor from a point and an image.

value_type getMin (int i) const
 Accessor to minimums.

value_type getMax (int i) const
 Accessor to maximums.

value_type getMin_impl (int i) const
 Accessor to minimums.

value_type getMax_impl (int i) const
 Accessor to maximums.

void pe_impl (const box_type &rhs)
 += operator implementation.

bool less_impl (const lambda_type &lambda) const
 "<" operator implementation.

bool ne_impl (const lambda_type &lambda) const
 != operator implementation.


Protected Attributes

std::vector< value_type > maxs_
 List of minimums.

std::vector< value_type > mins_
 List of maximums.


Detailed Description

template<class I, class Exact = mlc::final>
class oln::morpho::attr::box_type< I, Exact >

Box attribute.

Parameters:
I Exact type of images to process.
Exact The exact type.

Definition at line 1603 of file attributes.hh.


Constructor & Destructor Documentation

template<class I, class Exact = mlc::final>
oln::morpho::attr::box_type< I, Exact >::box_type const lambda_type &  lambda  )  [inline]
 

Ctor from a lambda_type value.

  • lambda Value of the attribute.

Definition at line 1619 of file attributes.hh.

01619                                            : maxs_(dim), mins_(dim)
01620           {
01621             for (int i = 0; i < dim; ++i)
01622               {
01623                 mins_[i] = ntg_zero_val(value_type);
01624                 maxs_[i] = lambda[i];
01625               }
01626           };

template<class I, class Exact = mlc::final>
oln::morpho::attr::box_type< I, Exact >::box_type  )  [inline]
 

Basic Ctor.

Warning:
After this call, the object is only instantiated (not initialized).

Definition at line 1634 of file attributes.hh.

01635           {
01636           };

template<class I, class Exact = mlc::final>
oln::morpho::attr::box_type< I, Exact >::box_type const im_type ,
const point_type p,
const env_type & 
[inline]
 

Ctor from a point and an image.

  • p Point to consider in the image.

Definition at line 1643 of file attributes.hh.

01643                                                                        : maxs_(dim), mins_(dim)
01644           {
01645             for (int i = 0; i < dim; ++i)
01646               mins_[i] = maxs_[i] = p.nth(i);
01647           };


Member Function Documentation

template<class I, class Exact = mlc::final>
value_type oln::morpho::attr::box_type< I, Exact >::getMax int  i  )  const [inline]
 

Accessor to maximums.

Virtual method.

  • i Index of the minimum wanted.
    Returns:
    the i th maximum.
    See also:
    getMax_impl()

Definition at line 1671 of file attributes.hh.

Referenced by oln::morpho::attr::box_type< I, Exact >::pe_impl().

01672           {
01673             mlc_dispatch(getMax)(i);
01674           };

template<class I, class Exact = mlc::final>
value_type oln::morpho::attr::box_type< I, Exact >::getMax_impl int  i  )  const [inline]
 

Accessor to maximums.

Virtual method.

  • i Index of the minimum wanted.
    Returns:
    the i th maximum.
    See also:
    getMax_impl()

Definition at line 1699 of file attributes.hh.

01700           {
01701             precondition(i < point_traits<point_type>::dim);
01702             return maxs_[i];
01703           };

template<class I, class Exact = mlc::final>
value_type oln::morpho::attr::box_type< I, Exact >::getMin int  i  )  const [inline]
 

Accessor to minimums.

Virtual method.

  • i Index of the minimum wanted.
    Returns:
    the i th minimum.
    See also:
    getMin_impl()

Definition at line 1657 of file attributes.hh.

Referenced by oln::morpho::attr::box_type< I, Exact >::pe_impl().

01658           {
01659             mlc_dispatch(getMin)(i);
01660           };

template<class I, class Exact = mlc::final>
value_type oln::morpho::attr::box_type< I, Exact >::getMin_impl int  i  )  const [inline]
 

Accessor to minimums.

Virtual method.

  • i Index of the minimum wanted.
    Returns:
    the i th minimum.
    See also:
    getMin_impl()

Definition at line 1685 of file attributes.hh.

01686           {
01687             precondition(i < point_traits<point_type>::dim);
01688             return mins_[i];
01689           };

template<class I, class Exact = mlc::final>
bool oln::morpho::attr::box_type< I, Exact >::less_impl const lambda_type &  lambda  )  const [inline]
 

"<" operator implementation.

This is an implementation of the += operator. Override this method to provide a new implementation of this operator.

Warning:
This method SHOULDN'T directly be called.

Definition at line 1728 of file attributes.hh.

01729           {
01730             for (int i = 0; i < dim; ++i)
01731               if ((maxs_[i] - mins_[i]) >= lambda[i])
01732                 return false;
01733             return true;
01734           }

template<class I, class Exact = mlc::final>
bool oln::morpho::attr::box_type< I, Exact >::ne_impl const lambda_type &  lambda  )  const [inline]
 

!= operator implementation.

This is an implementation of the += operator. Override this method to provide a new implementation of this operator.

Warning:
This method SHOULDN'T directly be called.

Definition at line 1743 of file attributes.hh.

01744           {
01745             for (int i = 0; i < dim; ++i)
01746               if ((maxs_[i] - mins_[i]) == lambda[i])
01747                 return false;
01748             return true;
01749           };

template<class I, class Exact = mlc::final>
void oln::morpho::attr::box_type< I, Exact >::pe_impl const box_type< I, Exact > &  rhs  )  [inline]
 

+= operator implementation.

This is an implementation of the += operator. Override this method to provide a new implementation of this operator.

Warning:
This method SHOULDN'T directly be called.

Definition at line 1712 of file attributes.hh.

References oln::morpho::attr::box_type< I, Exact >::getMax(), and oln::morpho::attr::box_type< I, Exact >::getMin().

01713           {
01714             for (int i = 0; i < dim; ++i)
01715               {
01716                 mins_[i] = ntg::min(mins_[i], rhs.getMin(i));
01717                 maxs_[i] = ntg::max(maxs_[i], rhs.getMax(i));
01718               }
01719           }


The documentation for this class was generated from the following file:
Generated on Thu Apr 15 20:16:55 2004 for Olena by doxygen 1.3.6-20040222