#include <attributes.hh>
Inheritance diagram for oln::morpho::attr::dist_type< I, Exact >:
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_type & | getValue () const |
Accessor to value_. | |
dist_type (const lambda_type lambda) | |
Ctor from a lambda_type value. | |
const point_type & | getCenter () const |
Accessor to center_. | |
const point_type & | getCenter_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. |
I | Exact type of images to process. | |
Exact | The exact type. |
Definition at line 1261 of file morpho/attributes.hh.
oln::morpho::attr::dist_type< I, Exact >::dist_type | ( | ) | [inline] |
Basic Ctor.
Definition at line 1277 of file morpho/attributes.hh.
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 };
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 };
const value_type& oln::morpho::attr::dist_type< I, Exact >::getValue | ( | ) | const [inline] |
Accessor to value_.
Virtual method.
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 };
const point_type& oln::morpho::attr::dist_type< I, Exact >::getCenter | ( | ) | const [inline] |
Accessor to center_.
Virtual method.
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 };
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().
Definition at line 1334 of file morpho/attributes.hh.
References oln::morpho::attr::dist_type< I, Exact >::center_.
01335 { 01336 return center_; 01337 };
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().
Definition at line 1347 of file morpho/attributes.hh.
References oln::morpho::attr::dist_type< I, Exact >::value_.
01348 { 01349 return value_; 01350 };
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.
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 };
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.
Definition at line 1379 of file morpho/attributes.hh.
References oln::morpho::attr::dist_type< I, Exact >::value_.
01380 { 01381 return value_ < lambda; 01382 };
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.
Definition at line 1391 of file morpho/attributes.hh.
References oln::morpho::attr::dist_type< I, Exact >::value_.
01392 { 01393 return value_ != lambda; 01394 };