#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 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 1282 of file attributes.hh.
|
Basic Ctor.
Definition at line 1298 of file attributes.hh.
01299 { 01300 }; |
|
Ctor from a point and an image.
Definition at line 1307 of file attributes.hh. References oln::morpho::attr::dist_type< I, Exact >::center_.
|
|
Ctor from a lambda_type value.
Definition at line 1331 of file attributes.hh.
01331 : value_(lambda) 01332 { 01333 }; |
|
Accessor to center_. Virtual method.
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 }; |
|
Implementation of getCenter(). Override this method in order to provide a new version of getCenter().
Definition at line 1355 of file attributes.hh. References oln::morpho::attr::dist_type< I, Exact >::center_.
01356 { 01357 return center_; 01358 }; |
|
Accessor to value_. Virtual method.
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 }; |
|
Implementation of getValue(). Override this method in order to provide a new version of getValue().
Definition at line 1368 of file attributes.hh.
01369 { 01370 return value_; 01371 }; |
|
"<" operator implementation. This is an implementation of the += operator. Override this method to provide a new implementation of this operator.
Definition at line 1400 of file attributes.hh.
01401 { 01402 return value_ < lambda; 01403 }; |
|
!= operator implementation. This is an implementation of the += operator. Override this method to provide a new implementation of this operator.
Definition at line 1412 of file attributes.hh.
01413 { 01414 return value_ != lambda; 01415 }; |
|
+= operator implementation. This is an implementation of the += operator. Override this method to provide a new implementation of this operator.
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 }; |