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 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_type & getValue () 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_type & getValue_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 1282 of file 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 1298 of file attributes.hh.

01299           {
01300           };

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.

  • p Point to consider in the image.

Definition at line 1307 of file attributes.hh.

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

01309                                    :
01310           value_(ntg_zero_val(value_type)),
01311           center_(p)
01312           {
01313           };

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.

  • lambda Value of the attribute.

Definition at line 1331 of file attributes.hh.

01331                                            : value_(lambda)
01332           {
01333           };


Member Function Documentation

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 1341 of file attributes.hh.

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

01342           {
01343             mlc_dispatch(getCenter)();
01344           };

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 1355 of file attributes.hh.

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

01356           {
01357             return center_;
01358           };

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 1321 of file attributes.hh.

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

01322           {
01323             mlc_dispatch(getValue)();
01324           };

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 1368 of file attributes.hh.

01369           {
01370             return value_;
01371           };

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 1400 of file attributes.hh.

01401           {
01402             return value_ < lambda;
01403           };

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 1412 of file attributes.hh.

01413           {
01414             return value_ != lambda;
01415           };

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 1380 of file attributes.hh.

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

01381           {
01382             value_type  last = value_;
01383             dpoint_type p = center_ - rhs.getCenter();
01384 
01385             value_ = ntg_zero_val(value_type);
01386             for (int i = 0; i < point_traits<point_type>::dim; ++i)
01387               value_ += p.nth(i) * p.nth(i);
01388             value_ = sqrt(value_);
01389             value_ = ntg::max(value_, last);
01390             value_ = ntg::max(value_, rhs.getValue());
01391           };


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