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

Dist attribute. More...

#include <attributes.hh>

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

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

Collaboration graph
[legend]
List of all members.

Public Types

typedef dist_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 oln::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.

Public Member Functions

 dist_type ()
 Basic Ctor.
 dist_type (const im_type &, const point_type &p, const env_type &)
 Ctor from a point and an image.
const value_typegetValue () const
 Accessor to value_.
 dist_type (const lambda_type lambda)
 Ctor from a lambda_type value.
const point_typegetCenter () const
 Accessor to center_.
const point_typegetCenter_impl () const
 Implementation of getCenter().
const value_typegetValue_impl () const
 Implementation of getValue().
void pe_impl (const dist_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

value_type value_
 Current value of the attribute.
point_type center_
 Center of the attribute.

Detailed Description

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

Dist attribute.

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

Definition at line 1261 of file morpho/attributes.hh.


Constructor & Destructor Documentation

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

Basic Ctor.

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

Definition at line 1277 of file morpho/attributes.hh.

01278           {
01279           };

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

Ctor from a point and an image.

Definition at line 1286 of file morpho/attributes.hh.

01288                                    :
01289           value_(ntg_zero_val(value_type)),
01290           center_(p)
01291           {
01292           };

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

Ctor from a lambda_type value.

Definition at line 1310 of file morpho/attributes.hh.

01310                                            : value_(lambda)
01311           {
01312           };


Member Function Documentation

template<class I, class Exact = mlc::final>
const value_type& oln::morpho::attr::dist_type< I, Exact >::getValue (  )  const [inline]

Accessor to value_.

Virtual method.

See also:
getValue_impl()

Definition at line 1300 of file morpho/attributes.hh.

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

01301           {
01302             mlc_dispatch(getValue)();
01303           };

template<class I, class Exact = mlc::final>
const point_type& oln::morpho::attr::dist_type< I, Exact >::getCenter (  )  const [inline]

Accessor to center_.

Virtual method.

See also:
getCenter_impl()

Definition at line 1320 of file morpho/attributes.hh.

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

01321           {
01322             mlc_dispatch(getCenter)();
01323           };

template<class I, class Exact = mlc::final>
const point_type& oln::morpho::attr::dist_type< I, Exact >::getCenter_impl (  )  const [inline]

Implementation of getCenter().

Override this method in order to provide a new version of getCenter().

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

Definition at line 1334 of file morpho/attributes.hh.

References oln::morpho::attr::dist_type< I, Exact >::center_.

01335           {
01336             return center_;
01337           };

template<class I, class Exact = mlc::final>
const value_type& oln::morpho::attr::dist_type< I, Exact >::getValue_impl (  )  const [inline]

Implementation of getValue().

Override this method in order to provide a new version of getValue().

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

Definition at line 1347 of file morpho/attributes.hh.

References oln::morpho::attr::dist_type< I, Exact >::value_.

01348           {
01349             return value_;
01350           };

template<class I, class Exact = mlc::final>
void oln::morpho::attr::dist_type< I, Exact >::pe_impl ( const dist_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 1359 of file morpho/attributes.hh.

References oln::morpho::attr::dist_type< I, Exact >::center_, oln::morpho::attr::dist_type< I, Exact >::getCenter(), oln::morpho::attr::dist_type< I, Exact >::getValue(), and oln::morpho::attr::dist_type< I, Exact >::value_.

01360           {
01361             value_type  last = value_;
01362             dpoint_type p = center_ - rhs.getCenter();
01363 
01364             value_ = ntg_zero_val(value_type);
01365             for (int i = 0; i < point_traits<point_type>::dim; ++i)
01366               value_ += p.nth(i) * p.nth(i);
01367             value_ = sqrt(value_);
01368             value_ = ntg::max(value_, last);
01369             value_ = ntg::max(value_, rhs.getValue());
01370           };

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

References oln::morpho::attr::dist_type< I, Exact >::value_.

01380           {
01381             return value_ < lambda;
01382           };

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

References oln::morpho::attr::dist_type< I, Exact >::value_.

01392           {
01393             return value_ != lambda;
01394           };


The documentation for this class was generated from the following file:
Generated on Tue Feb 20 20:29:00 2007 for Olena by  doxygen 1.5.1