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

Ball attribute. More...

#include <attributes.hh>

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

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

Collaboration graph
[legend]
List of all members.

Public Types

typedef ball_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.

typedef std::vector< point_typepts_type
 Point vector type.

typedef pts_type::const_iterator cst_iter_type
 const iterator on Point vector.


Public Member Functions

 ball_type ()
 Basic Ctor.

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

 ball_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_.

const pts_typegetPts () const
 Accessor to pts_.

const value_type & getValue_impl () const
 Implementation of getValue().

const pts_typegetPts_impl () const
 Implementation of getValue().

void pe_impl (const ball_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_
 Value of the attribute.

pts_type pts_
 List of point in the ball.


Detailed Description

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

Ball attribute.

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

Definition at line 1119 of file attributes.hh.


Constructor & Destructor Documentation

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

Basic Ctor.

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

Definition at line 1137 of file attributes.hh.

01138           {
01139           };

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

Ctor from a lambda_type value.

  • lambda Value of the attribute.

Definition at line 1146 of file attributes.hh.

References oln::morpho::attr::ball_type< I, Exact >::pts_.

01146                                             : value_(lambda), pts_()
01147           {
01148           };

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

References oln::morpho::attr::ball_type< I, Exact >::pts_.

01156                                                                          :
01157           value_(ntg_zero_val(value_type)), pts_()
01158 
01159           {
01160             pts_.push_back(p);
01161           };


Member Function Documentation

template<class I, class Exact = mlc::final>
const pts_type& oln::morpho::attr::ball_type< I, Exact >::getPts  )  const [inline]
 

Accessor to pts_.

Virtual method.

See also:
getPts_impl()

Definition at line 1181 of file attributes.hh.

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

01182           {
01183             mlc_dispatch(getPts)();
01184           };

template<class I, class Exact = mlc::final>
const pts_type& oln::morpho::attr::ball_type< I, Exact >::getPts_impl  )  const [inline]
 

Implementation of getValue().

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

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

Definition at line 1208 of file attributes.hh.

References oln::morpho::attr::ball_type< I, Exact >::pts_.

01209           {
01210             return pts_;
01211           };

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

Accessor to value_.

Virtual method.

See also:
getValue_impl()

Definition at line 1169 of file attributes.hh.

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

01170           {
01171             mlc_dispatch(getValue)();
01172           };

template<class I, class Exact = mlc::final>
const value_type& oln::morpho::attr::ball_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 1195 of file attributes.hh.

01196           {
01197             return value_;
01198           };

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

01250           {
01251             return value_ < lambda;
01252           };

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

01262           {
01263             return lambda != value_;
01264           };

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

References oln::morpho::attr::ball_type< I, Exact >::getPts(), oln::morpho::attr::ball_type< I, Exact >::getValue(), and oln::morpho::attr::ball_type< I, Exact >::pts_.

01221           {
01222             value_type  last = value_;
01223             std::copy(rhs.getPts().begin(),
01224                       rhs.getPts().end(),
01225                       std::back_inserter(pts_));
01226             value_ = ntg_zero_val(value_type);
01227             for (cst_iter_type p1 = pts_.begin(); p1 != pts_.end(); ++p1)
01228               for (cst_iter_type p2 = pts_.begin(); p2 != pts_.end(); ++p2)
01229                 {
01230                   unsigned d = 0;
01231                   dpoint_type   p = *p1 - *p2;
01232                   for (int i = 0; i < point_traits<point_type>::dim; ++i)
01233                     d += p.nth(i) * p.nth(i);
01234                   if (d > value_)
01235                     value_ = d;
01236                 }
01237             value_ /= 2;
01238             value_ = ntg::max(value_, last);
01239             value_ = ntg::max(value_, rhs.getValue());
01240           };


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