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

Cube attribute. More...

#include <attributes.hh>

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

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

Collaboration graph
[legend]
List of all members.

Public Types

typedef cube_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

 cube_type ()
 Basic Ctor.

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

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

int getMin (int i) const
 Accessor to minimums.

int getMax (int i) const
 Accessor to maximums.

int getMin_impl (int i) const
 Implementation of getMin(int i).

int getMax_impl (int i) const
 Implementation of getMax(int i).

void pe_impl (const cube_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< coordmins_
std::vector< coordmaxs_
value_type value_

Detailed Description

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

Cube attribute.

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

Definition at line 1434 of file attributes.hh.


Constructor & Destructor Documentation

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

Basic Ctor.

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

Definition at line 1452 of file attributes.hh.

01453           {
01454           }

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

Ctor from a lambda_type value.

  • lambda Value of the attribute.

Definition at line 1461 of file attributes.hh.

References oln::coord.

01461                                             :
01462           mins_(dim),
01463           maxs_(dim),
01464           value_(lambda)
01465           {
01466             for (int i = 0; i < point_traits<point_type>::dim; ++i)
01467               {
01468                 maxs_[i] = lambda;
01469                 mins_[i] = ntg_zero_val(coord);
01470               }
01471           };

template<class I, class Exact = mlc::final>
oln::morpho::attr::cube_type< I, Exact >::cube_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 1478 of file attributes.hh.

01480                                    :
01481           mins_(dim), maxs_(dim), value_(ntg_zero_val(value_type))
01482           {
01483             for (int i = 0; i < dim; ++i)
01484               mins_[i] = maxs_[i] = p.nth(i);
01485           }


Member Function Documentation

template<class I, class Exact = mlc::final>
int oln::morpho::attr::cube_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 1508 of file attributes.hh.

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

01509           {
01510             mlc_dispatch(getMax)(i);
01511           };

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

Implementation of getMax(int i).

Override this method in order to provide a new version of getMax(int i).

Warning:
Do not call this method, use getMax() instead.

Definition at line 1536 of file attributes.hh.

01537           {
01538             precondition(i < dim);
01539             return maxs_[i];
01540           };

template<class I, class Exact = mlc::final>
int oln::morpho::attr::cube_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 1495 of file attributes.hh.

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

01496           {
01497             mlc_dispatch(getMin)(i);
01498           };

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

Implementation of getMin(int i).

Override this method in order to provide a new version of getMin(int i).

Warning:
Do not call this method, use getMin() instead.

Definition at line 1522 of file attributes.hh.

01523           {
01524             precondition(i < dim);
01525             return mins_[i];
01526           };

template<class I, class Exact = mlc::final>
bool oln::morpho::attr::cube_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 1569 of file attributes.hh.

01570           {
01571             return value_ < lambda;
01572           }

template<class I, class Exact = mlc::final>
bool oln::morpho::attr::cube_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 1581 of file attributes.hh.

01582           {
01583             return value_ != lambda;
01584           };

template<class I, class Exact = mlc::final>
void oln::morpho::attr::cube_type< I, Exact >::pe_impl const cube_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 1549 of file attributes.hh.

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

01550           {
01551             for (int i = 0; i < dim; ++i)
01552               {
01553                 mins_[i] = ntg::min(mins_[i], rhs.getMin(i));
01554                 maxs_[i] = ntg::max(maxs_[i], rhs.getMax(i));
01555               }
01556             value_ = maxs_[0] - mins_[0];
01557             for (int i = 1; i < dim; ++i)
01558               if (value_ < value_type(maxs_[i] - mins_[i]))
01559                 value_ = maxs_[i] - mins_[i];
01560           }


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