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 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.
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_typegetValue () const
 Accessor to value_.
const pts_typegetPts () const
 Accessor to pts_.
const value_typegetValue_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 1098 of file morpho/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 1116 of file morpho/attributes.hh.

01117           {
01118           };

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.

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

01125                                             : value_(lambda), pts_()
01126           {
01127           };

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.

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

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

01135                                                                          :
01136           value_(ntg_zero_val(value_type)), pts_()
01137 
01138           {
01139             pts_.push_back(p);
01140           };


Member Function Documentation

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 1148 of file morpho/attributes.hh.

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

01149           {
01150             mlc_dispatch(getValue)();
01151           };

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 1160 of file morpho/attributes.hh.

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

01161           {
01162             mlc_dispatch(getPts)();
01163           };

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 1174 of file morpho/attributes.hh.

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

01175           {
01176             return value_;
01177           };

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 1187 of file morpho/attributes.hh.

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

01188           {
01189             return pts_;
01190           };

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 1199 of file morpho/attributes.hh.

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

01200           {
01201             value_type  last = value_;
01202             std::copy(rhs.getPts().begin(),
01203                       rhs.getPts().end(),
01204                       std::back_inserter(pts_));
01205             value_ = ntg_zero_val(value_type);
01206             for (cst_iter_type p1 = pts_.begin(); p1 != pts_.end(); ++p1)
01207               for (cst_iter_type p2 = pts_.begin(); p2 != pts_.end(); ++p2)
01208                 {
01209                   unsigned d = 0;
01210                   dpoint_type   p = *p1 - *p2;
01211                   for (int i = 0; i < point_traits<point_type>::dim; ++i)
01212                     d += p.nth(i) * p.nth(i);
01213                   if (d > value_)
01214                     value_ = d;
01215                 }
01216             value_ /= 2;
01217             value_ = ntg::max(value_, last);
01218             value_ = ntg::max(value_, rhs.getValue());
01219           };

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 1228 of file morpho/attributes.hh.

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

01229           {
01230             return value_ < lambda;
01231           };

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 1240 of file morpho/attributes.hh.

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

01241           {
01242             return lambda != value_;
01243           };


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